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

    Class PlaneGeometry

    A procedural plane-shaped geometry.

    Typically, you would:

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

      By default, the constructor creates a plane centered on the object space origin with a width and length of 1 and 5 segments in either axis (50 triangles). The normal vector of the plane is aligned along the positive Y axis. The plane is created with UVs in the range of 0 to 1.

      Parameters

      • Optionalopts: {
            calculateTangents?: boolean;
            halfExtents?: Vec2;
            lengthSegments?: number;
            widthSegments?: number;
        } = {}

        Options object.

        • OptionalcalculateTangents?: boolean

          Generate tangent information. Defaults to false.

        • OptionalhalfExtents?: Vec2

          The half dimensions of the plane in the X and Z axes. Defaults to [0.5, 0.5].

        • OptionallengthSegments?: number

          The number of divisions along the Z axis of the plane. Defaults to 5.

        • OptionalwidthSegments?: number

          The number of divisions along the X axis of the plane. Defaults to 5.

      Returns PlaneGeometry

      const geometry = new pc.PlaneGeometry({
      halfExtents: new pc.Vec2(1, 1),
      widthSegments: 10,
      lengthSegments: 10
      });

    Properties

    blendIndices: undefined | number[]

    Blend indices.

    blendWeights: undefined | number[]

    Blend weights.

    colors: undefined | number[]

    Colors.

    Methods