Engine API Reference - v2.7.4
    Preparing search index...

    Class ConeGeometry

    A procedural cone-shaped geometry.

    Typically, you would:

    1. Create a ConeGeometry instance.
    2. Generate a Mesh from the geometry.
    3. Create a MeshInstance referencing the mesh.
    4. Create an Entity with a RenderComponent and assign the MeshInstance to it.
    5. Add the entity to the Scene.
    // Create a mesh instance
    const geometry = new pc.ConeGeometry();
    const mesh = pc.Mesh.fromGeometry(app.graphicsDevice, geometry);
    const material = new pc.StandardMaterial();
    const meshInstance = new pc.MeshInstance(mesh, material);

    // Create an entity
    const entity = new pc.Entity();
    entity.addComponent('render', {
    meshInstances: [meshInstance]
    });

    // Add the entity to the scene hierarchy
    app.scene.root.addChild(entity);

    Hierarchy (View Summary)

    Index

    Constructors

    • Create a new ConeGeometry instance.

      By default, the constructor creates a cone standing vertically centered on the XZ-plane with a base radius of 0.5, a height of 1.0, 5 height segments and 18 cap segments. The cone is created with UVs in the range of 0 to 1.

      Parameters

      • Optionalopts: {
            baseRadius?: number;
            calculateTangents?: boolean;
            capSegments?: number;
            height?: number;
            heightSegments?: number;
            peakRadius?: number;
        } = {}

        Options object.

        • OptionalbaseRadius?: number

          The base radius of the cone. Defaults to 0.5.

        • OptionalcalculateTangents?: boolean

          Generate tangent information. Defaults to false.

        • OptionalcapSegments?: number

          The number of divisions around the tubular body of the cone. Defaults to 18.

        • Optionalheight?: number

          The length of the body of the cone. Defaults to 1.

        • OptionalheightSegments?: number

          The number of divisions along the length of the cone. Defaults to 5.

        • OptionalpeakRadius?: number

          The peak radius of the cone. Defaults to 0.

      Returns ConeGeometry

      const geometry = new pc.ConeGeometry({
      baseRadius: 1,
      height: 2,
      heightSegments: 2,
      capSegments: 20
      });

    Properties

    blendIndices: undefined | number[]

    Blend indices.

    blendWeights: undefined | number[]

    Blend weights.

    colors: undefined | number[]

    Colors.

    Methods