Class PhysicsShapeHeightField
Hierarchy (View Summary)
- PhysicsShape
- PhysicsShapeHeightField
Constructors
constructor
-
new PhysicsShapeHeightField(
heightFieldSizeX: number,
heightFieldSizeZ: number,
numHeightFieldSamplesX: number,
numHeightFieldSamplesZ: number,
heightFieldData: Float32Array,
scene: Scene,
): PhysicsShapeHeightFieldConstructor of the Shape heightfield
Parameters
- heightFieldSizeX: number
The size of the heightfield in the X axis
- heightFieldSizeZ: number
The size of the heightfield in the Z axis
- numHeightFieldSamplesX: number
The number of samples along the X axis
- numHeightFieldSamplesZ: number
The number of samples along the Z axis
- heightFieldData: Float32Array
The data for the heightfield
- scene: Scene
scene to attach to
Returns PhysicsShapeHeightField
- heightFieldSizeX: number
Accessors
density
-
get density(): number
Returns the density of the physics shape.
Returns number
The density of the physics shape.
-
set density(density: number): void
Sets the density of the physics shape.
Parameters
- density: number
The density of the physics shape.
Returns void
- density: number
filter Collide Mask
-
get filterCollideMask(): number
Returns number
Bitmask of categories that this shape should collide with
-
set filterCollideMask(collideMask: number): void
Sets the collide mask of a shape. This is a bitfield of arbitrary "categories" to which this shape collides with. Given two shapes, the engine will check if the collide mask and membership overlap: shapeA.filterMembershipMask & shapeB.filterCollideMask
If this value is zero (i.e. shapeB only collides with categories which shapeA is not a member of) then the shapes will not collide.
Note, the engine will also perform the same test with shapeA and shapeB swapped; the shapes will not collide if either shape has a collideMask which prevents collision with the other shape.
Parameters
- collideMask: number
Bitmask of categories this shape should collide with
Returns void
- collideMask: number
filter Membership Mask
-
get filterMembershipMask(): number
Get the membership mask of a shape.
Returns number
Bitmask of categories which this shape is a member of.
-
set filterMembershipMask(membershipMask: number): void
Set the membership mask of a shape. This is a bitfield of arbitrary "categories" to which the shape is a member. This is used in combination with the collide mask to determine if this shape should collide with another.
Parameters
- membershipMask: number
Bitfield of categories of this shape.
Returns void
- membershipMask: number
is Trigger
-
get isTrigger(): boolean
Returns boolean
-
set isTrigger(isTrigger: boolean): void
Parameters
- isTrigger: boolean
Returns void
material
-
Returns the material of the physics shape.
Returns PhysicsMaterial
The material of the physics shape.
-
Parameters
- material: PhysicsMaterial
Returns void
type
Methods
add Child
-
addChild(
newChild: PhysicsShape,
translation?: Vector3,
rotation?: Quaternion,
scale?: Vector3,
): voidAdds a child shape to a container with an optional transform
Parameters
- newChild: PhysicsShape
The new PhysicsShape to add
Optionaltranslation: Vector3Optional position of the child shape relative to this shape
Optionalrotation: QuaternionOptional rotation of the child shape relative to this shape
Optionalscale: Vector3Optional scale of the child shape relative to this shape
Returns void
- newChild: PhysicsShape
add Child From Parent
-
addChildFromParent(
parentTransform: TransformNode,
newChild: PhysicsShape,
childTransform: TransformNode,
): voidUtility to add a child shape to this container, automatically computing the relative transform between the container shape and the child instance.
Parameters
- parentTransform: TransformNode
The transform node associated with this shape
- newChild: PhysicsShape
The new PhysicsShape to add
- childTransform: TransformNode
The transform node associated with the child shape
Returns void
- parentTransform: TransformNode
dispose
-
Dispose the shape and release its associated resources.
Returns void
get Bounding Box
-
Returns the bounding box of the physics shape.
Returns BoundingBox
The bounding box of the physics shape.
get Class Name
-
Returns the string "PhysicsShape".
Returns string
"PhysicsShape"
get Num Children
-
Returns the number of children of a physics shape.
Returns number
The number of children of a physics shape.
remove Child
-
Removes a child shape from this shape.
Parameters
- childIndex: number
The index of the child shape to remove
Returns void
- childIndex: number
Helper object to create a heightfield Shape