Preparing search index...

    Physics mesh shape component for collision detection using custom meshes.

        const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
    const scene = model.project.scene;

    // Create a scene object with a mesh-based collider
    const obj = scene.createSceneObject('PhysicsObject');
    obj.name = 'MeshColliderObject';
    const collider = obj.addComponent('ColliderComponent');

    // Create a mesh shape — for complex collision geometry from a RenderMesh
    const meshShape = Editor.Shape.createMeshShape(scene);
    meshShape.convex = true;
    collider.shape = meshShape;

    console.log(`Created mesh collider on: ${obj.name}`);
    console.log(` convex: ${meshShape.convex}`);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    convex: boolean

    Whether the mesh uses convex collision.

    id: Uuid

    The unique id of the entity.

    The render mesh used for collision geometry.

    meta: Meta

    Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.

    skin: Skin

    The skin asset used for collision geometry.

    type: string

    The entity's type.

    Methods

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object refers to the same instance as the given object.

      Parameters

      Returns boolean