Skip to content

Class: CPhysicObject

Animated client physics object.

Source

src/xrGame/PhysicObject_script.cpp, CPhysicObject binding.

Custom Constructor

CPhysicObject

Remarks

Wrapper for animated physics props, especially door-like objects. The exposed methods control native object animation time, bone-attached sounds, and temporary dynamic-collision ignoring.

Extends

Extended by

Constructors

Constructor

ts
protected new CPhysicObject(): CPhysicObject;

Engine-created base object.

Returns

CPhysicObject

Inherited from

CGameObject.constructor

Methods

_construct()

ts
_construct(): DLL_Pure;

Construct engine-side object state.

Returns

DLL_Pure

Constructed base object.

Remarks

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

Inherited from

CGameObject._construct


anim_time_get()

ts
anim_time_get(): number;

Returns

number

Current animation time.


anim_time_set()

ts
anim_time_set(time: number): void;

Set current animation time.

Parameters

ParameterTypeDescription
timenumberAnimation time.

Returns

void


getEnabled()

ts
getEnabled(): boolean;

Returns

boolean

Whether the object is enabled in the client object loop.

Inherited from

CGameObject.getEnabled


getVisible()

ts
getVisible(): boolean;

Returns

boolean

Whether the object is visible.

Inherited from

CGameObject.getVisible


net_Export()

ts
net_Export(net_packet: net_packet): void;

Export network state to a packet.

Parameters

ParameterTypeDescription
net_packetnet_packetDestination network packet.

Returns

void

Inherited from

CGameObject.net_Export


net_Import()

ts
net_Import(net_packet: net_packet): void;

Import network state from a packet.

Parameters

ParameterTypeDescription
net_packetnet_packetSource network packet.

Returns

void

Inherited from

CGameObject.net_Import


net_Spawn()

ts
net_Spawn(cse_abstract: cse_abstract): boolean;

Spawn the client object from its server object.

Parameters

ParameterTypeDescription
cse_abstractcse_abstractServer object used for spawn data.

Returns

boolean

Whether spawn succeeded.

Remarks

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

Inherited from

CGameObject.net_Spawn


play_bones_sound()

ts
play_bones_sound(): void;

Start sounds attached to animated bones.

Returns

void


run_anim_back()

ts
run_anim_back(): void;

Run the object animation backward.

Returns

void


run_anim_forward()

ts
run_anim_forward(): void;

Run the object animation forward.

Returns

void


set_door_ignore_dynamics()

ts
set_door_ignore_dynamics(): void;

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

Returns

void


stop_anim()

ts
stop_anim(): boolean;

Stop the current object animation.

Returns

boolean

Whether animation was stopped.


stop_bones_sound()

ts
stop_bones_sound(): void;

Stop sounds attached to animated bones.

Returns

void


unset_door_ignore_dynamics()

ts
unset_door_ignore_dynamics(): void;

Restore normal dynamic-object collision handling.

Returns

void


use()

ts
use(object: CGameObject): boolean;

Use another object through the engine interaction path.

Parameters

ParameterTypeDescription
objectCGameObjectObject being used.

Returns

boolean

Whether the use action was handled.

Inherited from

CGameObject.use


Visual()

ts
Visual(): IXR_IRender_Visual;

Returns

IXR_IRender_Visual

Render visual assigned to the object.

Inherited from

CGameObject.Visual

Properties

__name

ts
readonly __name: string;

LuaBind instance constructor name.

Inherited from

CGameObject.__name


__name

ts
readonly static __name: string;

LuaBind class constructor name.

Inherited from

CGameObject.__name