Interface IPhysicsEnabledObject
interface IPhysicsEnabledObject {
parent?: any;
position: Vector3;
rotation?: Vector3;
rotationQuaternion: Nullable<Quaternion>;
scaling: Vector3;
computeWorldMatrix(force: boolean): Matrix;
getAbsolutePivotPoint(): Vector3;
getAbsolutePosition(): Vector3;
getBoundingInfo(): BoundingInfo;
getChildMeshes?(directDescendantsOnly?: boolean): AbstractMesh[];
getClassName(): string;
getIndices?(): Nullable<IndicesArray>;
getScene?(): Scene;
getVerticesData(kind: string): Nullable<FloatArray>;
getWorldMatrix?(): Matrix;
rotate(axis: Vector3, amount: number, space?: Space): TransformNode;
setAbsolutePosition(absolutePosition: Vector3): TransformNode;
translate(axis: Vector3, distance: number, space?: Space): TransformNode;
}
parent?: any;
position: Vector3;
rotation?: Vector3;
rotationQuaternion: Nullable<Quaternion>;
scaling: Vector3;
computeWorldMatrix(force: boolean): Matrix;
getAbsolutePivotPoint(): Vector3;
getAbsolutePosition(): Vector3;
getBoundingInfo(): BoundingInfo;
getChildMeshes?(directDescendantsOnly?: boolean): AbstractMesh[];
getClassName(): string;
getIndices?(): Nullable<IndicesArray>;
getScene?(): Scene;
getVerticesData(kind: string): Nullable<FloatArray>;
getWorldMatrix?(): Matrix;
rotate(axis: Vector3, amount: number, space?: Space): TransformNode;
setAbsolutePosition(absolutePosition: Vector3): TransformNode;
translate(axis: Vector3, distance: number, space?: Space): TransformNode;
}
Properties
Optionalparent
parent?: any
The parent of the physics-enabled object
position
The position of the physics-enabled object
Optionalrotation
The rotation of the physics-enabled object
rotation Quaternion
The rotation of the physics-enabled object
scaling
The scale of the physics-enabled object
Methods
compute World Matrix
-
Computes the world matrix
Parameters
- force: boolean
Specifies if the world matrix should be computed by force
Returns Matrix
A world matrix
- force: boolean
get Absolute Pivot Point
get Absolute Position
get Bounding Info
-
The bounding info of the physics-enabled object
Returns BoundingInfo
The bounding info of the physics-enabled object
Optionalget Child Meshes
-
Gets the child meshes
Parameters
OptionaldirectDescendantsOnly: booleanSpecifies if only direct-descendants should be obtained
Returns AbstractMesh[]
An array of abstract meshes
get Class Name
-
Gets the class name of the mesh
Returns string
The class name
Optionalget Indices
Optionalget Scene
get Vertices Data
-
Gets the vertex data
Parameters
- kind: string
The type of vertex data
Returns Nullable<FloatArray>
A nullable array of numbers, or a float32 array
- kind: string
Optionalget World Matrix
rotate
set Absolute Position
-
Sets the absolute position of the mesh
Parameters
- absolutePosition: Vector3
The absolute position of the mesh
Returns TransformNode
The transform node
- absolutePosition: Vector3
Interface for a physics-enabled object
See
https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine