Skip to content

Class: MockPhysicObject

Mock of the X-Ray engine CPhysicObject.

Extends

  • MockCGameObject

Implements

  • CPhysicObject

Constructors

Constructor

ts
new MockPhysicObject(): MockPhysicObject;

Returns

MockPhysicObject

Inherited from

ts
MockCGameObject.constructor

Methods

create()

ts
static create(): MockPhysicObject;

Returns

MockPhysicObject

Overrides

ts
MockCGameObject.create

mock()

ts
static mock(): CPhysicObject;

Returns

CPhysicObject

Overrides

ts
MockCGameObject.mock

Properties

__name

ts
__name: string = "CGameObject";

LuaBind instance constructor name.

Implementation of

ts
CPhysicObject.__name

Inherited from

ts
MockCGameObject.__name

_construct

ts
_construct: MockedFunction<() => DLL_Pure>;

Construct engine-side object state.

Remarks

Lifecycle hook used by the engine. Calling it from gameplay scripts can reinitialize native state unexpectedly.

Returns

Constructed base object.

Implementation of

ts
CPhysicObject._construct

Inherited from

ts
MockCGameObject._construct

anim_time_get

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

Returns

Current animation time.

Implementation of

ts
CPhysicObject.anim_time_get

anim_time_set

ts
anim_time_set: Mock<(time: number) => void>;

Set current animation time.

Param

time

Animation time.

Implementation of

ts
CPhysicObject.anim_time_set

animationTime

ts
animationTime: number = 0;

getEnabled

ts
getEnabled: MockedFunction<() => boolean>;

Returns

Whether the object is enabled in the client object loop.

Implementation of

ts
CPhysicObject.getEnabled

Inherited from

ts
MockCGameObject.getEnabled

getVisible

ts
getVisible: MockedFunction<() => boolean>;

Returns

Whether the object is visible.

Implementation of

ts
CPhysicObject.getVisible

Inherited from

ts
MockCGameObject.getVisible

net_Export

ts
net_Export: MockedFunction<(net_packet: net_packet) => void>;

Export network state to a packet.

Param

net_packet

Destination network packet.

Implementation of

ts
CPhysicObject.net_Export

Inherited from

ts
MockCGameObject.net_Export

net_Import

ts
net_Import: MockedFunction<(net_packet: net_packet) => void>;

Import network state from a packet.

Param

net_packet

Source network packet.

Implementation of

ts
CPhysicObject.net_Import

Inherited from

ts
MockCGameObject.net_Import

net_Spawn

ts
net_Spawn: MockedFunction<(cse_abstract: cse_abstract) => boolean>;

Spawn the client object from its server object.

Remarks

Lifecycle hook used during network spawn. Return false to reject spawn in custom subclasses.

Param

cse_abstract

Server object used for spawn data.

Returns

Whether spawn succeeded.

Implementation of

ts
CPhysicObject.net_Spawn

Inherited from

ts
MockCGameObject.net_Spawn

play_bones_sound

ts
play_bones_sound: Mock<UnknownFunction>;

Start sounds attached to animated bones.

Implementation of

ts
CPhysicObject.play_bones_sound

run_anim_back

ts
run_anim_back: Mock<UnknownFunction>;

Run the object animation backward.

Implementation of

ts
CPhysicObject.run_anim_back

run_anim_forward

ts
run_anim_forward: Mock<UnknownFunction>;

Run the object animation forward.

Implementation of

ts
CPhysicObject.run_anim_forward

set_door_ignore_dynamics

ts
set_door_ignore_dynamics: Mock<UnknownFunction>;

Ignore dynamic objects while the door-like object is moving.

Implementation of

ts
CPhysicObject.set_door_ignore_dynamics

stop_anim

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

Stop the current object animation.

Returns

Whether animation was stopped.

Implementation of

ts
CPhysicObject.stop_anim

stop_bones_sound

ts
stop_bones_sound: Mock<UnknownFunction>;

Stop sounds attached to animated bones.

Implementation of

ts
CPhysicObject.stop_bones_sound

unset_door_ignore_dynamics

ts
unset_door_ignore_dynamics: Mock<UnknownFunction>;

Restore normal dynamic-object collision handling.

Implementation of

ts
CPhysicObject.unset_door_ignore_dynamics

use

ts
use: MockedFunction<(object: CGameObject) => boolean>;

Use another object through the engine interaction path.

Param

object

Object being used.

Returns

Whether the use action was handled.

Implementation of

ts
CPhysicObject.use

Inherited from

ts
MockCGameObject.use

Visual

ts
Visual: MockedFunction<() => IXR_IRender_Visual>;

Returns

Render visual assigned to the object.

Implementation of

ts
CPhysicObject.Visual

Inherited from

ts
MockCGameObject.Visual