Options
All
  • Public
  • Public/Protected
  • All
Menu

Class for building Constructive Solid Geometry

Hierarchy

  • CSG

Index

Constructors

Properties

matrix: Matrix

The world matrix

position: Vector3

Stores the position

rotation: Vector3

Stores the rotation

rotationQuaternion: Nullable<Quaternion>

Stores the rotation quaternion

scaling: Vector3

Stores the scaling vector

Methods

  • buildMeshGeometry(name: string, scene?: Scene, keepSubMeshes?: boolean): Mesh
  • Build Raw mesh from CSG Coordinates here are in world space

    Parameters

    • name: string

      The name of the mesh geometry

    • Optional scene: Scene

      The Scene

    • Optional keepSubMeshes: boolean

      Specifies if the submeshes should be kept

    Returns Mesh

    A new Mesh

  • Clones, or makes a deep copy, of the CSG

    Returns CSG

    A new CSG

  • copyTransformAttributes(csg: CSG): CSG
  • This is used to keep meshes transformations so they can be restored when we build back a Babylon Mesh NB : All CSG operations are performed in world coordinates

    Parameters

    • csg: CSG

      The CSG to copy the transform attributes from

    Returns CSG

    This CSG

  • Intersect this CSG with another CSG

    Parameters

    • csg: CSG

      The CSG to intersect against this CSG

    Returns CSG

    A new CSG

  • intersectInPlace(csg: CSG): void
  • Intersects this CSG with another CSG in place

    Parameters

    • csg: CSG

      The CSG to intersect against this CSG

    Returns void

  • Return a new CSG solid with solid and empty space switched. This solid is not modified.

    Returns CSG

    A new CSG solid with solid and empty space switched

  • inverseInPlace(): void
  • Inverses the CSG in place

    Returns void

  • Subtracts this CSG with another CSG

    Parameters

    • csg: CSG

      The CSG to subtract against this CSG

    Returns CSG

    A new CSG

  • subtractInPlace(csg: CSG): void
  • Subtracts this CSG with another CSG in place

    Parameters

    • csg: CSG

      The CSG to subtract against this CSG

    Returns void

  • Build Mesh from CSG taking material and transforms into account

    Parameters

    • name: string

      The name of the Mesh

    • Optional material: Nullable<Material>

      The material of the Mesh

    • Optional scene: Scene

      The Scene

    • Optional keepSubMeshes: boolean

      Specifies if submeshes should be kept

    Returns Mesh

    The new Mesh

  • Unions this CSG with another CSG

    Parameters

    • csg: CSG

      The CSG to union against this CSG

    Returns CSG

    The unioned CSG

  • unionInPlace(csg: CSG): void
  • Unions this CSG with another CSG in place

    Parameters

    • csg: CSG

      The CSG to union against this CSG

    Returns void

  • FromMesh(mesh: Mesh, absolute?: boolean): CSG
  • Convert the Mesh to CSG

    Parameters

    • mesh: Mesh

      The Mesh to convert to CSG

    • Optional absolute: boolean

      If true, the final (local) matrix transformation is set to the identity and not to that of mesh. It can help when dealing with right-handed meshes (default: false)

    Returns CSG

    A new CSG from the Mesh

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited constructor
  • Static method

Settings

Theme