Class: MockPhysicsElement
Mock of the X-Ray engine physics element.
Implements
physics_element
Constructors
Constructor
ts
new MockPhysicsElement(): MockPhysicsElement;Returns
MockPhysicsElement
Methods
create()
ts
static create(): MockPhysicsElement;Returns
MockPhysicsElement
mock()
ts
static mock(): physics_element;Returns
physics_element
Properties
angularVelocity
ts
angularVelocity: MockVector;apply_force
ts
apply_force: Mock<(x: number, y: number, z: number) => void>;Apply force to the element.
Param
x
Force x component.
Param
y
Force y component.
Param
z
Force z component.
Implementation of
ts
physics_element.apply_forcedensity
ts
density: number = 1;fix
ts
fix: Mock<() => void>;Fix the element in place.
Implementation of
ts
physics_element.fixforce
ts
force: MockVector;get_angular_vel
ts
get_angular_vel: Mock<(velocity: vector) => void>;Write current angular velocity into a vector.
Remarks
The passed vector is overwritten.
Param
velocity
Output vector.
Implementation of
ts
physics_element.get_angular_velget_density
ts
get_density: Mock<() => number>;Returns
Element density.
Implementation of
ts
physics_element.get_densityget_linear_vel
ts
get_linear_vel: Mock<(velocity: vector) => void>;Write current linear velocity into a vector.
Remarks
The passed vector is overwritten.
Param
velocity
Output vector.
Implementation of
ts
physics_element.get_linear_velget_mass
ts
get_mass: Mock<() => number>;Returns
Element mass.
Implementation of
ts
physics_element.get_massget_volume
ts
get_volume: Mock<() => number>;Returns
Element volume.
Implementation of
ts
physics_element.get_volumeglobal_transform
ts
global_transform: Mock<() => matrix>;Returns
Current global transform.
Implementation of
ts
physics_element.global_transformis_breakable
ts
is_breakable: Mock<() => boolean>;Returns
Whether the element can break.
Implementation of
ts
physics_element.is_breakableis_fixed
ts
is_fixed: Mock<() => boolean>;Returns
Whether the element is fixed.
Implementation of
ts
physics_element.is_fixedisBreakable
ts
isBreakable: boolean = false;isFixed
ts
isFixed: boolean = false;linearVelocity
ts
linearVelocity: MockVector;mass
ts
mass: number = 1;release_fixed
ts
release_fixed: Mock<() => void>;Release a fixed element.
Implementation of
ts
physics_element.release_fixedtransform
ts
transform: matrix;volume
ts
volume: number = 1;