![]() |
Nuclide
Software Development Kit for id Technology (BETA)
|
This entity class represents physically-simulated entities.
Units of mass is defined in kilograms, a standard unit of measurement. You will find the API to be mostly compatible of that offered by Garry's Mod.
Public Member Functions | |
| void | ncPhysicsEntity (void) |
| virtual void | Respawn (void) |
| Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state. | |
| virtual void | SpawnKey (string, string) |
| This method handles entity key/value pairs on map load. | |
| virtual void | SetModel (string) |
| Sets the 3D model representation of the entity from a file path and name. | |
| virtual void | Spawned (void) |
| Called when the entity is fulled initialized. | |
| virtual void | Pain (entity, entity, int, vector, vector, int) |
| Called whenever the entity receives damage. | |
| virtual void | Death (entity, entity, int, vector, vector, int) |
| Called when the health is equal or below 0. | |
| virtual void | EvaluateEntity (void) |
| Run each tic after physics are run to determine if we need to send updates over the network. | |
| virtual float | SendEntity (entity, float) |
| Called by the engine whenever we need to send a client an update about this entity. | |
| virtual void | Save (float) |
| Handles saving a copy of this entity to a given filehandle. | |
| virtual void | Restore (string, string) |
| Similar to ncIO::SpawnKey() but for save-game fields. | |
| virtual void | Touch (entity) |
| Called whenever we're touching another entity. | |
| virtual void | ReceiveEntity (float, float) |
| Client: Handles network updates from the server for the associated entity. | |
| virtual void | postdraw (void) |
| Client: Run after the rendering of 3D world is complete. | |
| nonvirtual void | _UpdateBuoyancy (void) |
| nonvirtual void | _UpdateMass (void) |
| nonvirtual void | SetFriction (float) |
| Sets the friction multiplier for this entity. | |
| nonvirtual float | GetFriction (void) |
| Returns the friction multiplayer for this entity. | |
| nonvirtual float | CalculateImpactDamage (int, int) |
| Called by the physics routine to figure out the impact damage. | |
| nonvirtual vector | AlignAngles (vector, vector) |
| Call to align angles of the object to the ones passed. | |
| nonvirtual void | ApplyForceCenter (vector) |
| Call to apply a force (absolute velocity vector) to the center of the entity. | |
| nonvirtual void | ApplyForceOffset (vector, vector) |
| Call to apply force (absolute velocity vector) to an absolute position on the entity. | |
| nonvirtual void | ApplyTorqueCenter (vector) |
| Call to apply torque (angular velocity vector) to the center of the entity. | |
| nonvirtual void | EnableDrag (bool) |
| Call to set whether the entity should be affected by drag. | |
| nonvirtual void | EnableGravity (bool) |
| Call to set whether the entity should be affected by gravity. | |
| nonvirtual void | EnableMotion (bool) |
| Call to set whether the entity should be able to move. | |
| nonvirtual float | GetLinearDamping (void) |
| Returns the linear damping of the entity. | |
| nonvirtual float | GetAngularDamping (void) |
| Returns the angular damping of the entity. | |
| nonvirtual float | GetEnergy (void) |
| Returns the linear and rotational kinetic energy combined. | |
| nonvirtual float | GetInertia (void) |
| Returns the inertia modifier of this entity. | |
| nonvirtual float | GetInvInertia (void) |
| Returns 1 divided by the angular inertia of this entity. | |
| nonvirtual float | GetInvMass (void) |
| Returns 1 divided by the mass of this entity. | |
| nonvirtual float | GetMass (void) |
| Returns the mass of the entity. | |
| nonvirtual vector | GetMassCenter (void) |
| Returns the center of mass of the entity. | |
| nonvirtual float | GetRotDamping (void) |
| Returns the rotational damping of the entity. | |
| nonvirtual float | GetSpeedDamping (void) |
| Returns the speed damping of the entity. | |
| nonvirtual float | GetSurfaceArea (void) |
| Returns the surface area of the entity. | |
| nonvirtual float | GetVolume (void) |
| Returns the volume of the entity. | |
| nonvirtual bool | IsAsleep (void) |
| Returns whether the entity is at rest and not moving. | |
| nonvirtual bool | IsCollisionEnabled (void) |
| Returns whether the entity is able to collide with anything. | |
| nonvirtual bool | IsDragEnabled (void) |
| Returns whether the entity is affected by drag. | |
| nonvirtual bool | IsGravityEnabled (void) |
| Returns whether the entity is affected by gravity. | |
| nonvirtual bool | IsMotionEnabled (void) |
| Returns whether the entity is able to move by itself. | |
| nonvirtual bool | IsMoveable (void) |
| Returns whether the entity is able to move. | |
| nonvirtual bool | IsPenetrating (void) |
| Returns whether the entity is penetrating another object. | |
| nonvirtual void | SetAngleDragCoefficient (float) |
| Call to set the amount of rotational drag the entity experiences. | |
| nonvirtual void | SetBuoyancyRatio (float) |
| Call to set the buoyancy ratio of the entity. | |
| nonvirtual void | SetDamping (float, float) |
| Call to set the linear and angular damping of the entity. | |
| nonvirtual void | SetDragCoefficient (float) |
| Call to set how much drag affects the entity. | |
| nonvirtual void | SetInertia (float) |
| Sets the angular inertia for this entity. | |
| nonvirtual void | SetMass (float) |
| Sets the mass of the entity in kilograms. | |
| nonvirtual void | Wake (void) |
| Call to enable physics simulation on this entity. | |
| nonvirtual void | Sleep (void) |
| Call to freeze physics simulation on this entity. | |
| void ncPhysicsEntity::ncPhysicsEntity | ( | void | ) |
| void ncPhysicsEntity::_UpdateBuoyancy | ( | void | ) |
| void ncPhysicsEntity::_UpdateMass | ( | void | ) |
| vector ncPhysicsEntity::AlignAngles | ( | vector | from, |
| vector | to ) |
Call to align angles of the object to the ones passed.
| void ncPhysicsEntity::ApplyForceCenter | ( | vector | vecForce | ) |
Call to apply a force (absolute velocity vector) to the center of the entity.
| void ncPhysicsEntity::ApplyForceOffset | ( | vector | vecForce, |
| vector | vecOffset ) |
Call to apply force (absolute velocity vector) to an absolute position on the entity.
| void ncPhysicsEntity::ApplyTorqueCenter | ( | vector | vecTorque | ) |
Call to apply torque (angular velocity vector) to the center of the entity.
| float ncPhysicsEntity::CalculateImpactDamage | ( | int | iDamage, |
| int | dmgType ) |
Called by the physics routine to figure out the impact damage.
|
virtual |
Called when the health is equal or below 0.
Reimplemented from ncSurfacePropEntity.
| void ncPhysicsEntity::EnableDrag | ( | bool | setEnabled | ) |
Call to set whether the entity should be affected by drag.
| void ncPhysicsEntity::EnableGravity | ( | bool | setEnabled | ) |
Call to set whether the entity should be affected by gravity.
| void ncPhysicsEntity::EnableMotion | ( | bool | setEnabled | ) |
Call to set whether the entity should be able to move.
|
virtual |
Run each tic after physics are run to determine if we need to send updates over the network.
Reimplemented from ncSurfacePropEntity.
| float ncPhysicsEntity::GetAngularDamping | ( | void | ) |
Returns the angular damping of the entity.
| float ncPhysicsEntity::GetEnergy | ( | void | ) |
Returns the linear and rotational kinetic energy combined.
| float ncPhysicsEntity::GetFriction | ( | void | ) |
Returns the friction multiplayer for this entity.
| float ncPhysicsEntity::GetInertia | ( | void | ) |
Returns the inertia modifier of this entity.
| float ncPhysicsEntity::GetInvInertia | ( | void | ) |
Returns 1 divided by the angular inertia of this entity.
| float ncPhysicsEntity::GetInvMass | ( | void | ) |
Returns 1 divided by the mass of this entity.
| float ncPhysicsEntity::GetLinearDamping | ( | void | ) |
Returns the linear damping of the entity.
| float ncPhysicsEntity::GetMass | ( | void | ) |
Returns the mass of the entity.
| vector ncPhysicsEntity::GetMassCenter | ( | void | ) |
Returns the center of mass of the entity.
| float ncPhysicsEntity::GetRotDamping | ( | void | ) |
Returns the rotational damping of the entity.
| float ncPhysicsEntity::GetSpeedDamping | ( | void | ) |
Returns the speed damping of the entity.
| float ncPhysicsEntity::GetSurfaceArea | ( | void | ) |
Returns the surface area of the entity.
| float ncPhysicsEntity::GetVolume | ( | void | ) |
Returns the volume of the entity.
| bool ncPhysicsEntity::IsAsleep | ( | void | ) |
Returns whether the entity is at rest and not moving.
| bool ncPhysicsEntity::IsCollisionEnabled | ( | void | ) |
Returns whether the entity is able to collide with anything.
| bool ncPhysicsEntity::IsDragEnabled | ( | void | ) |
Returns whether the entity is affected by drag.
| bool ncPhysicsEntity::IsGravityEnabled | ( | void | ) |
Returns whether the entity is affected by gravity.
| bool ncPhysicsEntity::IsMotionEnabled | ( | void | ) |
Returns whether the entity is able to move by itself.
| bool ncPhysicsEntity::IsMoveable | ( | void | ) |
Returns whether the entity is able to move.
| bool ncPhysicsEntity::IsPenetrating | ( | void | ) |
Returns whether the entity is penetrating another object.
|
virtual |
Called whenever the entity receives damage.
Reimplemented from ncSurfacePropEntity.
|
virtual |
Client: Run after the rendering of 3D world is complete.
2D calls can happen here.
Reimplemented from ncRenderableEntity.
|
virtual |
Client: Handles network updates from the server for the associated entity.
Reimplemented from ncSurfacePropEntity.
|
virtual |
Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state.
Reimplemented from ncSurfacePropEntity.
Reimplemented in func_physbox, item_item_crate, ncItem, prop_physics, prop_static, and prop_static.
|
virtual |
Similar to ncIO::SpawnKey() but for save-game fields.
Whatever you write into file handles within your ncIO::Save() method needs to be read back in here.
Reimplemented from ncSurfacePropEntity.
|
virtual |
Handles saving a copy of this entity to a given filehandle.
Within you want to use the ncIO::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.
Reimplemented from ncSurfacePropEntity.
|
virtual |
Called by the engine whenever we need to send a client an update about this entity.
Reimplemented from ncSurfacePropEntity.
| void ncPhysicsEntity::SetAngleDragCoefficient | ( | float | setValue | ) |
Call to set the amount of rotational drag the entity experiences.
| void ncPhysicsEntity::SetBuoyancyRatio | ( | float | setValue | ) |
Call to set the buoyancy ratio of the entity.
0 is not buoyant, 1 is very buoyant.
| void ncPhysicsEntity::SetDamping | ( | float | linearDamp, |
| float | angleDamp ) |
Call to set the linear and angular damping of the entity.
| void ncPhysicsEntity::SetDragCoefficient | ( | float | dragValue | ) |
Call to set how much drag affects the entity.
| void ncPhysicsEntity::SetFriction | ( | float | val | ) |
Sets the friction multiplier for this entity.
Default is 1.0
| void ncPhysicsEntity::SetInertia | ( | float | val | ) |
Sets the angular inertia for this entity.
| void ncPhysicsEntity::SetMass | ( | float | val | ) |
Sets the mass of the entity in kilograms.
|
virtual |
Sets the 3D model representation of the entity from a file path and name.
Reimplemented from ncSurfacePropEntity.
| void ncPhysicsEntity::Sleep | ( | void | ) |
Call to freeze physics simulation on this entity.
|
virtual |
Called when the entity is fulled initialized.
Any spawn key/value info pairs have already been dealt with. So now we can make full decisions on the entity. Always make sure to call super::Spawned(); inside your method when overriding.
Reimplemented from ncSurfacePropEntity.
Reimplemented in ncItem, ncWeapon, and prop_static.
|
virtual |
This method handles entity key/value pairs on map load.
You can easily convert the strValue parameter using the ReadFloat etc. methods that are part of ncIO.
Reimplemented from ncSurfacePropEntity.
Reimplemented in func_physbox, item_item_crate, ncItem, ncWeapon, prop_physics, and prop_static.
|
virtual |
| void ncPhysicsEntity::Wake | ( | void | ) |
Call to enable physics simulation on this entity.