Preparing search index...

    A spherical physics shape component.

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

    // Create a scene object with a sphere collider
    const obj = scene.createSceneObject('PhysicsObject');
    obj.name = 'SphereColliderObject';
    const collider = obj.addComponent('ColliderComponent');

    // Create a sphere shape and set its radius
    const sphere = Editor.Shape.createSphereShape(scene);
    sphere.radius = 1.5;
    collider.shape = sphere;

    console.log(`Created sphere collider on: ${obj.name}`);
    console.log(` radius: ${sphere.radius}`);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    id: Uuid

    The unique id of the entity.

    meta: Meta

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

    radius: number

    The radius of the sphere in world units.

    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