CSG

Class for building Constructive Solid Geometry

Hierarchy

  • CSG

Index

Properties

matrix

Find examples in Playground
matrix: Matrix

The world matrix

position

Find examples in Playground
position: Vector3

Stores the position

rotation

Find examples in Playground
rotation: Vector3

Stores the rotation

rotationQuaternion

Find examples in Playground
rotationQuaternion: Nullable<Quaternion>

Stores the rotation quaternion

scaling

Find examples in Playground
scaling: Vector3

Stores the scaling vector

Methods

buildMeshGeometry

Find examples in Playground
  • 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

    • scene: Scene

      The BABYLON.Scene

    • keepSubMeshes: boolean

      Specifies if the submeshes should be kept

    Returns Mesh

    A new BABYLON.Mesh

clone

Find examples in Playground
  • Clones, or makes a deep copy, of the BABYLON.CSG

    Returns CSG

    A new BABYLON.CSG

copyTransformAttributes

Find examples in Playground
  • 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 BABYLON.CSG to copy the transform attributes from

    Returns CSG

    This BABYLON.CSG

intersect

Find examples in Playground
  • Intersect this CSG with another CSG

    Parameters

    • csg: CSG

      The CSG to intersect against this CSG

    Returns CSG

    A new BABYLON.CSG

intersectInPlace

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

    Parameters

    • csg: CSG

      The CSG to intersect against this CSG

    Returns void

inverse

Find examples in Playground
  • inverse(): CSG
  • Return a new BABYLON.CSG solid with solid and empty space switched. This solid is not modified.

    Returns CSG

    A new BABYLON.CSG solid with solid and empty space switched

inverseInPlace

Find examples in Playground
  • inverseInPlace(): void
  • Inverses the BABYLON.CSG in place

    Returns void

subtract

Find examples in Playground
  • Subtracts this CSG with another CSG

    Parameters

    • csg: CSG

      The CSG to subtract against this CSG

    Returns CSG

    A new BABYLON.CSG

subtractInPlace

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

    Parameters

    • csg: CSG

      The CSG to subtact against this CSG

    Returns void

toMesh

Find examples in Playground
  • Build Mesh from CSG taking material and transforms into account

    Parameters

    • name: string

      The name of the BABYLON.Mesh

    • material: Nullable<Material>

      The material of the BABYLON.Mesh

    • scene: Scene

      The BABYLON.Scene

    • keepSubMeshes: boolean

      Specifies if submeshes should be kept

    Returns Mesh

    The new BABYLON.Mesh

union

Find examples in Playground
  • Unions this CSG with another CSG

    Parameters

    • csg: CSG

      The CSG to union against this CSG

    Returns CSG

    The unioned CSG

unionInPlace

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

    Parameters

    • csg: CSG

      The CSG to union against this CSG

    Returns void

Static FromMesh

Find examples in Playground
  • Convert the BABYLON.Mesh to BABYLON.CSG

    Parameters

    • mesh: Mesh

      The BABYLON.Mesh to convert to BABYLON.CSG

    Returns CSG

    A new BABYLON.CSG from the BABYLON.Mesh

Generated using TypeDoc