Nuclide
Software Development Kit for id Technology
|
This entity class represents constraints for physically-simulated entities.
If you want to create an easy 'weld' type connection, a ballsocket or even a rope type connection - this class is what you need.
Public Member Functions | |
void | NSPhysicsConstraint (void) |
virtual void | SpawnKey (string, string) |
This method handles entity key/value pairs on map load. More... | |
virtual void | Save (float) |
Handles saving a copy of this entity to a given filehandle. More... | |
virtual void | Restore (string, string) |
Similar to NSIO::SpawnKey but for save-game fields. More... | |
virtual void | Input (entity, string, string) |
Called when we are being prompted by another object/function with an input message. More... | |
virtual void | Spawned (void) |
Called when the entity is fulled initialized. More... | |
virtual void | OnRemoveEntity (void) |
Handles what happens before the entity gets removed from the client game. More... | |
nonvirtual void | WakeTargets (void) |
Awakes the entities this constraint is connected to. More... | |
nonvirtual void | Break (entity) |
Breaks the constraint. More... | |
nonvirtual constraint_t | GetConstraintType (void) |
Returns the type of this constraint entity. More... | |
nonvirtual entity | GetEntity1 (void) |
Returns the first entity connection. More... | |
nonvirtual entity | GetEntity2 (void) |
Returns the second entity connection. More... | |
nonvirtual void | SetConstraintType (constraint_t) |
Will override the constraint type this entity represents. More... | |
nonvirtual void | SetEntity1 (entity) |
Sets the first entity in the connection. More... | |
nonvirtual void | SetEntity2 (entity) |
Sets the second entity in the connection. More... | |
nonvirtual void | SetSliderVelocity (float) |
Sets the velocity on a CONSTRAINT_SLIDER type NSPhysicsConstraint. More... | |
nonvirtual void | SetSliderMaxVelocity (float) |
Sets the max velocity on a CONSTRAINT_SLIDER type NSPhysicsConstraint. More... | |
nonvirtual void | SetSliderStop (float) |
Sets the maximum travel distance of the slider. More... | |
nonvirtual void | SetSliderFriction (float) |
Sets the friction of the slider. More... | |
nonvirtual float | GetSliderVelocity (void) |
Returns the velocity of a CONSTRAINT_SLIDER type NSPhysicsConstraint. More... | |
nonvirtual float | GetSliderMaxVelocity (void) |
Returns the max velocity of a CONSTRAINT_SLIDER type NSPhysicsConstraint. More... | |
nonvirtual float | GetSliderStop (void) |
Returns the maximum travel distance of the slider. More... | |
nonvirtual float | GetSliderFriction (void) |
Returns the friction of the slider. More... | |
nonvirtual float | GetConstraintSystemID (void) |
Returns the unique joint group ID associated with a phys_constraintsystem. More... | |
nonvirtual NSPhysicsConstraint | Ballsocket (entity, entity, vector, vector, float, bool) |
Creates a ballsocket constraint and returns it. More... | |
nonvirtual NSPhysicsConstraint | Weld (entity, entity, float, float, float, bool, bool) |
Creates a ballsocket constraint and returns it. More... | |
nonvirtual NSPhysicsConstraint | Rope (entity, entity, vector, vector) |
Creates a ballsocket constraint and returns it. More... | |
nonvirtual NSPhysicsConstraint | KeepUpright (entity, vector, float) |
nonvirtual void | ConstraintThink (void) |
void NSPhysicsConstraint::NSPhysicsConstraint | ( | void | ) |
NSPhysicsConstraint NSPhysicsConstraint::Ballsocket | ( | entity | firstEnt, |
entity | secondEnt, | ||
vector | pos1, | ||
vector | pos2, | ||
float | forceLimit, | ||
bool | noCollide | ||
) |
Creates a ballsocket constraint and returns it.
void NSPhysicsConstraint::Break | ( | entity | activatingEnt | ) |
Breaks the constraint.
void NSPhysicsConstraint::ConstraintThink | ( | void | ) |
float NSPhysicsConstraint::GetConstraintSystemID | ( | void | ) |
Returns the unique joint group ID associated with a phys_constraintsystem.
constraint_t NSPhysicsConstraint::GetConstraintType | ( | void | ) |
Returns the type of this constraint entity.
entity NSPhysicsConstraint::GetEntity1 | ( | void | ) |
Returns the first entity connection.
Should not return world/__NULL__
entity NSPhysicsConstraint::GetEntity2 | ( | void | ) |
Returns the second entity connection.
Can also return world/__NULL__
float NSPhysicsConstraint::GetSliderFriction | ( | void | ) |
Returns the friction of the slider.
float NSPhysicsConstraint::GetSliderMaxVelocity | ( | void | ) |
Returns the max velocity of a CONSTRAINT_SLIDER type NSPhysicsConstraint.
float NSPhysicsConstraint::GetSliderStop | ( | void | ) |
Returns the maximum travel distance of the slider.
float NSPhysicsConstraint::GetSliderVelocity | ( | void | ) |
Returns the velocity of a CONSTRAINT_SLIDER type NSPhysicsConstraint.
|
virtual |
Called when we are being prompted by another object/function with an input message.
Reimplemented from NSEntity.
Reimplemented in phys_convert, phys_hinge, phys_keepupright, and phys_slideconstraint.
NSPhysicsConstraint NSPhysicsConstraint::KeepUpright | ( | entity | firstEnt, |
vector | uprightAngle, | ||
float | angleLimit | ||
) |
|
virtual |
Handles what happens before the entity gets removed from the client game.
Reimplemented from NSIO.
|
virtual |
Similar to NSIO::SpawnKey
but for save-game fields.
Whatever you write into file handles within your NSIO::Save()
method needs to be read back in here.
Reimplemented from NSEntity.
Reimplemented in phys_convert, phys_hinge, phys_keepupright, and phys_slideconstraint.
NSPhysicsConstraint NSPhysicsConstraint::Rope | ( | entity | firstEnt, |
entity | secondEnt, | ||
vector | pos1, | ||
vector | pos2 | ||
) |
Creates a ballsocket constraint and returns it.
|
virtual |
Handles saving a copy of this entity to a given filehandle.
Within you want to use the NSIO::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.
Reimplemented from NSEntity.
Reimplemented in phys_convert, phys_hinge, phys_keepupright, and phys_slideconstraint.
void NSPhysicsConstraint::SetConstraintType | ( | constraint_t | setValue | ) |
Will override the constraint type this entity represents.
See constraint_t for choices.
void NSPhysicsConstraint::SetEntity1 | ( | entity | targetEnt | ) |
Sets the first entity in the connection.
Needs to be set.
void NSPhysicsConstraint::SetEntity2 | ( | entity | targetEnt | ) |
Sets the second entity in the connection.
Can be world.
void NSPhysicsConstraint::SetSliderFriction | ( | float | frictionValue | ) |
Sets the friction of the slider.
void NSPhysicsConstraint::SetSliderMaxVelocity | ( | float | maxVel | ) |
Sets the max velocity on a CONSTRAINT_SLIDER type NSPhysicsConstraint.
void NSPhysicsConstraint::SetSliderStop | ( | float | stopVal | ) |
Sets the maximum travel distance of the slider.
void NSPhysicsConstraint::SetSliderVelocity | ( | float | slideVel | ) |
Sets the velocity on a CONSTRAINT_SLIDER type NSPhysicsConstraint.
|
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 NSEntity.
Reimplemented in phys_convert.
|
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 NSIO.
Reimplemented from NSEntity.
Reimplemented in phys_convert, phys_hinge, phys_keepupright, and phys_slideconstraint.
void NSPhysicsConstraint::WakeTargets | ( | void | ) |
Awakes the entities this constraint is connected to.
NSPhysicsConstraint NSPhysicsConstraint::Weld | ( | entity | firstEnt, |
entity | secondEnt, | ||
float | bone1, | ||
float | bone2, | ||
float | forceLimit, | ||
bool | noCollide, | ||
bool | deleteEnt1OnBreak | ||
) |
Creates a ballsocket constraint and returns it.