Skip to content

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_force

density

ts
density: number = 1;

fix

ts
fix: Mock<() => void>;

Fix the element in place.

Implementation of

ts
physics_element.fix

force

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_vel

get_density

ts
get_density: Mock<() => number>;

Returns

Element density.

Implementation of

ts
physics_element.get_density

get_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_vel

get_mass

ts
get_mass: Mock<() => number>;

Returns

Element mass.

Implementation of

ts
physics_element.get_mass

get_volume

ts
get_volume: Mock<() => number>;

Returns

Element volume.

Implementation of

ts
physics_element.get_volume

global_transform

ts
global_transform: Mock<() => matrix>;

Returns

Current global transform.

Implementation of

ts
physics_element.global_transform

is_breakable

ts
is_breakable: Mock<() => boolean>;

Returns

Whether the element can break.

Implementation of

ts
physics_element.is_breakable

is_fixed

ts
is_fixed: Mock<() => boolean>;

Returns

Whether the element is fixed.

Implementation of

ts
physics_element.is_fixed

isBreakable

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_fixed

transform

ts
transform: matrix;

volume

ts
volume: number = 1;