Preparing search index...

    Represents a 2D or 3D shape object.

        // Editor.Shape is a factory for physics shapes (Box, Sphere, Capsule, …).
    // Use it to produce an Editor.Components.Physics.Shape and assign that
    // to a ColliderComponent's `shape` property to give the collider a
    // geometry for physics simulation.
    const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
    const scene = model.project.scene;

    // Create a scene object with a physics Collider.
    const obj = scene.createSceneObject('PhysicsBox');
    const collider = obj.addComponent('ColliderComponent') as Editor.Components.Physics.ColliderComponent;

    // Produce a physics Box shape and attach it to the collider.
    const box = Editor.Shape.createBoxShape(scene);
    collider.shape = box;

    console.log(`Collider on ${obj.name} uses shape ${box.getTypeName()}`);

    // Available factory methods: createBoxShape, createSphereShape,
    // createCapsuleShape, createConeShape, createCylinderShape,
    // createLevelSetShape, createMeshShape.
    Index

    Constructors

    Methods

    • Creates a box-shaped physics collision component and adds it to the given scene.

      Parameters

      Returns Box

    • Creates a capsule-shaped physics collision component and adds it to the given scene.

      Parameters

      Returns Capsule

    • Creates a cone-shaped physics collision component and adds it to the given scene.

      Parameters

      Returns Cone

    • Creates a cylinder-shaped physics collision component and adds it to the given scene.

      Parameters

      Returns Cylinder

    • Creates a level set physics collision component and adds it to the given scene.

      Parameters

      Returns LevelSet

    • Creates a mesh-based physics collision component and adds it to the given scene.

      Parameters

      Returns Mesh

    • Creates a sphere-shaped physics collision component and adds it to the given scene.

      Parameters

      Returns Sphere