Class: MockPhysicsShell
Mock of the X-Ray engine physics shell.
Implements
physics_shell
Constructors
Constructor
new MockPhysicsShell(): MockPhysicsShell;Returns
MockPhysicsShell
Methods
create()
static create(): MockPhysicsShell;Returns
MockPhysicsShell
mock()
static mock(): physics_shell;Returns
physics_shell
Properties
angularVelocity
angularVelocity: MockVector;apply_force
apply_force: Mock<(x: number, y: number, z: number) => void>;Apply force to the shell.
Param
x
Force x component.
Param
y
Force y component.
Param
z
Force z component.
Implementation of
physics_shell.apply_forceblock_breaking
block_breaking: Mock<() => void>;Prevent shell elements and joints from breaking.
Implementation of
physics_shell.block_breakingelements
elements: physics_element[] = [];elementsByBoneId
elementsByBoneId: Map<number, physics_element>;elementsByBoneName
elementsByBoneName: Map<string, physics_element>;force
force: MockVector;get_angular_vel
get_angular_vel: Mock<(velocity: vector) => void>;Write current angular velocity into a vector.
Remarks
The passed vector is overwritten with the root element's angular velocity.
Param
velocity
Output vector.
Implementation of
physics_shell.get_angular_velget_element_by_bone_id
get_element_by_bone_id: Mock<(id: number) => physics_element>;Get an element by model bone id.
Remarks
Returns the element attached to the bone, if the shell has one for that id. Invalid ids can trip native assertions in debug builds.
Param
id
Bone id.
Returns
Matching physics element.
Implementation of
physics_shell.get_element_by_bone_idget_element_by_bone_name
get_element_by_bone_name: Mock<(name: string) => physics_element>;Get an element by model bone name.
Remarks
The bone name must exist in the shell's kinematics. Invalid names can trip native assertions in debug builds.
Param
bone_name
Bone name.
Returns
Matching physics element.
Implementation of
physics_shell.get_element_by_bone_nameget_element_by_order
get_element_by_order: Mock<(order: number) => physics_element>;Get an element by shell storage order.
Remarks
order must be lower than get_elements_number(); invalid values trip a native assertion.
Param
order
Element order.
Returns
Matching physics element.
Implementation of
physics_shell.get_element_by_orderget_elements_number
get_elements_number: Mock<() => number>;Returns
Number of elements in the shell.
Implementation of
physics_shell.get_elements_numberget_joint_by_bone_id
get_joint_by_bone_id: Mock<(id: number) => physics_joint>;Get a joint by model bone id.
Remarks
Returns the joint attached to the bone, if the shell has one for that id. Invalid ids can trip native assertions in debug builds.
Param
id
Bone id.
Returns
Matching physics joint.
Implementation of
physics_shell.get_joint_by_bone_idget_joint_by_bone_name
get_joint_by_bone_name: Mock<(name: string) => physics_joint>;Get a joint by model bone name.
Remarks
The bone name must exist in the shell's kinematics. Invalid names can trip native assertions in debug builds.
Param
name
Bone name.
Returns
Matching physics joint.
Implementation of
physics_shell.get_joint_by_bone_nameget_joint_by_order
get_joint_by_order: Mock<(order: number) => physics_joint>;Get a joint by shell storage order.
Remarks
order must be lower than get_joints_number(); invalid values trip a native assertion.
Param
order
Joint order.
Returns
Matching physics joint.
Implementation of
physics_shell.get_joint_by_orderget_joints_number
get_joints_number: Mock<() => number>;Returns
Number of joints in the shell.
Implementation of
physics_shell.get_joints_numberget_linear_vel
get_linear_vel: Mock<(velocity: vector) => void>;Write current linear velocity into a vector.
Remarks
The passed vector is overwritten with the root element's linear velocity.
Param
velocity
Output vector.
Implementation of
physics_shell.get_linear_velis_breakable
is_breakable: Mock<() => boolean>;Returns
Whether the shell can break.
Implementation of
physics_shell.is_breakableis_breaking_blocked
is_breaking_blocked: Mock<() => boolean>;Returns
Whether breaking is currently blocked.
Implementation of
physics_shell.is_breaking_blockedisBreakable
isBreakable: boolean = false;isBreakingBlocked
isBreakingBlocked: boolean = false;joints
joints: physics_joint[] = [];jointsByBoneId
jointsByBoneId: Map<number, physics_joint>;jointsByBoneName
jointsByBoneName: Map<string, physics_joint>;linearVelocity
linearVelocity: MockVector;unblock_breaking
unblock_breaking: Mock<() => void>;Allow shell elements and joints to break again.
Implementation of
physics_shell.unblock_breaking