Engine API Reference - v2.21.0-beta.10
    Preparing search index...

    Class CircleGeometry

    A procedural circle-shaped geometry - a flat disc in the XZ plane.

    Typically, you would:

    1. Create a CircleGeometry 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.CircleGeometry();
    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 CircleGeometry instance.

      By default, the constructor creates a circle centered on the object space origin with a radius of 0.5, 64 sectors and 8 rings. The normal vector of the circle is aligned along the positive Y axis. The circle is created with UVs in the range of 0 to 1, mapped planarly across its bounding square.

      Parameters

      • Optionalopts: {
            calculateTangents?: boolean;
            radius?: number;
            ringExponent?: number;
            rings?: number;
            sectors?: number;
        } = {}

        Options object.

        • OptionalcalculateTangents?: boolean

          Generate tangent information. Defaults to false.

        • Optionalradius?: number

          The radius of the circle. Defaults to 0.5.

        • OptionalringExponent?: number

          Controls the radial distribution of the rings. A value of 1 spaces the rings uniformly, larger values concentrate the rings (and so the tessellation detail) towards the center of the circle. Defaults to 1.

        • Optionalrings?: number

          The number of concentric rings of vertices between the center and the outer edge of the circle. Defaults to 8.

        • Optionalsectors?: number

          The number of divisions around the circumference of the circle. Defaults to 64.

      Returns CircleGeometry

      const geometry = new pc.CircleGeometry({
      radius: 100,
      sectors: 128,
      rings: 64,
      ringExponent: 2
      });

    Properties

    blendIndices: number[] | undefined

    Blend indices.

    blendWeights: number[] | undefined

    Blend weights.

    colors: number[] | undefined

    Colors.

    Methods

    • Generates normal information from the positions and triangle indices.

      Returns void

    • Generates tangent information from the positions, normals, texture coordinates and triangle indices.

      Returns void