Utility class to create primitive objects

Example

const cube = ObjectUtils.createPrimitive("Cube", { name: "Cube", position: { x: 0, y: 0, z: 0 } });

Constructors

Methods

  • Creates an occluder object that only render depth but not color

    Parameters

    • type: "Quad" | "Cube" | "Sphere" | "RoundedCube"

      The type of primitive to create

    Returns Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>

    The created object

  • Creates a primitive object like a Cube or Sphere

    Parameters

    • type: "ShaderBall"

      The type of primitive to create

    • Optional opts: ObjectOptions

      Options to create the object

    Returns Group<Object3DEventMap>

    The created object

  • Parameters

    • type: PrimitiveType | "Quad" | "Cube" | "Sphere" | "RoundedCube"
    • Optional opts: ObjectOptions

    Returns Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>

  • Creates a Sprite object

    Parameters

    Returns Sprite<Object3DEventMap>

    The created object

Generated using TypeDoc