Collider used by the Hair Visual for its simulation.

// Add a callback for onCollisionEnter on this collider

// @input Physics.ColliderComponent collider

script.collider.onCollisionEnter.add(function(eventArgs) {
var collision = eventArgs.collision;
print("CollisionEnter(" + collision.id + "): contacts=" + collision.contactCount + " ---> " + collision.collider.getSceneObject().name);
});
interface ColliderComponent {
    angularVelocity: vec3;
    debugDrawEnabled: boolean;
    enabled: boolean;
    filter: Filter;
    fitVisual: boolean;
    forceCompound: boolean;
    intangible: boolean;
    matter: Matter;
    onCollisionEnter: event1<CollisionEnterEventArgs, void>;
    onCollisionExit: event1<CollisionExitEventArgs, void>;
    onCollisionStay: event1<CollisionStayEventArgs, void>;
    onOverlapEnter: event1<OverlapEnterEventArgs, void>;
    onOverlapExit: event1<OverlapExitEventArgs, void>;
    onOverlapStay: event1<OverlapStayEventArgs, void>;
    overlapFilter: Filter;
    rotateSmoothFactor: number;
    sceneObject: SceneObject;
    shape: Shape;
    smooth: boolean;
    translateSmoothFactor: number;
    uniqueIdentifier: string;
    velocity: vec3;
    worldSettings: Physics.WorldSettingsAsset;
    clearMotion(): void;
    destroy(): void;
    getSceneObject(): SceneObject;
    getTransform(): Transform;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

angularVelocity: vec3

Angular velocity, expressed as an axis of rotation scaled by angular speed (radians/s).

debugDrawEnabled: boolean

Toggle collider wire rendering for visualizing collider geometry shape and where it is placed.

enabled: boolean

If disabled, the Component will stop enacting its behavior.

filter: Filter

Collision filter to use for this collider.

fitVisual: boolean

If enabled, the collider shape extends to fit the visual mesh, if any. Only applicable for Box and Sphere shapes.

forceCompound: boolean

Nested collider/body components may be merged into compound shapes. By default, this occurs only for dynamic bodies and not for static colliders. If forceCompound is set, this occurs for static colliders as well.

intangible: boolean

If enabled, the collider doesn't interact with the world but may still be detected with ray casts and intersection events.

matter: Matter

The matter used by the collider to define its physical substance, such as friction and bounciness.

onCollisionEnter: event1<CollisionEnterEventArgs, void>

Signals when objects initially collide.

onCollisionExit: event1<CollisionExitEventArgs, void>

Signals when objects stop colliding.

onCollisionStay: event1<CollisionStayEventArgs, void>

Signals every frame while objects continue to collide.

onOverlapEnter: event1<OverlapEnterEventArgs, void>

Signals when colliders first overlap.

onOverlapExit: event1<OverlapExitEventArgs, void>

Signals when colliders stop overlapping.

onOverlapStay: event1<OverlapStayEventArgs, void>

Signals every frame while colliders continue to overlap.

overlapFilter: Filter

Collision filter used for overlap events.

rotateSmoothFactor: number

Smoothing spring factor, for rotation.

sceneObject: SceneObject
shape: Shape

The Shape object used for collision.

smooth: boolean

Smooth transform changes using a dampened spring. Useful to reduce motion noise. This only applies to the simulation and changes from outside the simulation. The scene object's transform is not affected. It has no effect for dynamic bodies.

translateSmoothFactor: number

Smoothing spring factor, for translation. This controls the restitution strength of the spring, so low values are smoother but lag more.

uniqueIdentifier: string
velocity: vec3

Linear velocity (cm/s).

The WorldSettingsAsset used by the collider to define the physics simulation settings.

Methods

  • Clears all velocities and forces on a collider.

    Returns void

  • Destroys the component.

    Returns void

  • Returns the name of this object's type.

    Returns string

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean