![]() |
Nuclide
Software Development Kit for id Technology (BETA)
|
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 | ncPhysicsConstraint (void) |
| virtual void | SpawnKey (string, string) |
| This method handles entity key/value pairs on map load. | |
| 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 | Input (entity, string, string) |
| Called when we are being prompted by another object/function with an input message. | |
| virtual void | Spawned (void) |
| Called when the entity is fulled initialized. | |
| virtual void | OnRemoveEntity (void) |
| Handles what happens before the entity gets removed from the client game. | |
| nonvirtual void | WakeTargets (void) |
| Awakes the entities this constraint is connected to. | |
| nonvirtual void | Break (entity) |
| Breaks the constraint. | |
| nonvirtual constraint_t | GetConstraintType (void) |
| Returns the type of this constraint entity. | |
| nonvirtual entity | GetEntity1 (void) |
| Returns the first entity connection. | |
| nonvirtual entity | GetEntity2 (void) |
| Returns the second entity connection. | |
| nonvirtual void | SetConstraintType (constraint_t) |
| Will override the constraint type this entity represents. | |
| nonvirtual void | SetEntity1 (entity) |
| Sets the first entity in the connection. | |
| nonvirtual void | SetEntity2 (entity) |
| Sets the second entity in the connection. | |
| nonvirtual void | SetSliderVelocity (float) |
| Sets the velocity on a CONSTRAINT_SLIDER type ncPhysicsConstraint. | |
| nonvirtual void | SetSliderMaxVelocity (float) |
| Sets the max velocity on a CONSTRAINT_SLIDER type ncPhysicsConstraint. | |
| nonvirtual void | SetSliderStop (float) |
| Sets the maximum travel distance of the slider. | |
| nonvirtual void | SetSliderFriction (float) |
| Sets the friction of the slider. | |
| nonvirtual float | GetSliderVelocity (void) |
| Returns the velocity of a CONSTRAINT_SLIDER type ncPhysicsConstraint. | |
| nonvirtual float | GetSliderMaxVelocity (void) |
| Returns the max velocity of a CONSTRAINT_SLIDER type ncPhysicsConstraint. | |
| nonvirtual float | GetSliderStop (void) |
| Returns the maximum travel distance of the slider. | |
| nonvirtual float | GetSliderFriction (void) |
| Returns the friction of the slider. | |
| nonvirtual float | GetConstraintSystemID (void) |
| Returns the unique joint group ID associated with a phys_constraintsystem. | |
| nonvirtual ncPhysicsConstraint | Ballsocket (entity, entity, vector, vector, float, bool) |
| Creates a ballsocket constraint and returns it. | |
| nonvirtual ncPhysicsConstraint | Weld (entity, entity, float, float, float, bool, bool) |
| Creates a ballsocket constraint and returns it. | |
| nonvirtual ncPhysicsConstraint | Rope (entity, entity, vector, vector) |
| Creates a ballsocket constraint and returns it. | |
| nonvirtual ncPhysicsConstraint | KeepUpright (entity, vector, float) |
| nonvirtual void | ConstraintThink (void) |
| void ncPhysicsConstraint::ncPhysicsConstraint | ( | void | ) |
| ncPhysicsConstraint ncPhysicsConstraint::Ballsocket | ( | entity | firstEnt, |
| entity | secondEnt, | ||
| vector | pos1, | ||
| vector | pos2, | ||
| float | forceLimit, | ||
| bool | noCollide ) |
Creates a ballsocket constraint and returns it.
| void ncPhysicsConstraint::Break | ( | entity | activatingEnt | ) |
Breaks the constraint.
| void ncPhysicsConstraint::ConstraintThink | ( | void | ) |
| float ncPhysicsConstraint::GetConstraintSystemID | ( | void | ) |
Returns the unique joint group ID associated with a phys_constraintsystem.
| constraint_t ncPhysicsConstraint::GetConstraintType | ( | void | ) |
Returns the type of this constraint entity.
| entity ncPhysicsConstraint::GetEntity1 | ( | void | ) |
Returns the first entity connection.
Should not return world/__NULL__
| entity ncPhysicsConstraint::GetEntity2 | ( | void | ) |
Returns the second entity connection.
Can also return world/__NULL__
| float ncPhysicsConstraint::GetSliderFriction | ( | void | ) |
Returns the friction of the slider.
| float ncPhysicsConstraint::GetSliderMaxVelocity | ( | void | ) |
Returns the max velocity of a CONSTRAINT_SLIDER type ncPhysicsConstraint.
| float ncPhysicsConstraint::GetSliderStop | ( | void | ) |
Returns the maximum travel distance of the slider.
| float ncPhysicsConstraint::GetSliderVelocity | ( | void | ) |
Returns the velocity of a CONSTRAINT_SLIDER type ncPhysicsConstraint.
|
virtual |
Called when we are being prompted by another object/function with an input message.
Reimplemented from ncEntity.
Reimplemented in phys_convert, phys_hinge, phys_keepupright, and phys_slideconstraint.
| ncPhysicsConstraint ncPhysicsConstraint::KeepUpright | ( | entity | firstEnt, |
| vector | uprightAngle, | ||
| float | angleLimit ) |
|
virtual |
Handles what happens before the entity gets removed from the client game.
Reimplemented from ncTrigger.
|
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 ncEntity.
Reimplemented in phys_convert, phys_hinge, phys_keepupright, and phys_slideconstraint.
| ncPhysicsConstraint ncPhysicsConstraint::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 ncIO::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.
Reimplemented from ncEntity.
Reimplemented in phys_convert, phys_hinge, phys_keepupright, and phys_slideconstraint.
| void ncPhysicsConstraint::SetConstraintType | ( | constraint_t | setValue | ) |
Will override the constraint type this entity represents.
See constraint_t for choices.
| void ncPhysicsConstraint::SetEntity1 | ( | entity | targetEnt | ) |
Sets the first entity in the connection.
Needs to be set.
| void ncPhysicsConstraint::SetEntity2 | ( | entity | targetEnt | ) |
Sets the second entity in the connection.
Can be world.
| void ncPhysicsConstraint::SetSliderFriction | ( | float | frictionValue | ) |
Sets the friction of the slider.
| void ncPhysicsConstraint::SetSliderMaxVelocity | ( | float | maxVel | ) |
Sets the max velocity on a CONSTRAINT_SLIDER type ncPhysicsConstraint.
| void ncPhysicsConstraint::SetSliderStop | ( | float | stopVal | ) |
Sets the maximum travel distance of the slider.
| void ncPhysicsConstraint::SetSliderVelocity | ( | float | slideVel | ) |
Sets the velocity on a CONSTRAINT_SLIDER type ncPhysicsConstraint.
|
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 ncEntity.
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 ncIO.
Reimplemented from ncEntity.
Reimplemented in phys_convert, phys_hinge, phys_keepupright, and phys_slideconstraint.
| void ncPhysicsConstraint::WakeTargets | ( | void | ) |
Awakes the entities this constraint is connected to.
| ncPhysicsConstraint ncPhysicsConstraint::Weld | ( | entity | firstEnt, |
| entity | secondEnt, | ||
| float | bone1, | ||
| float | bone2, | ||
| float | forceLimit, | ||
| bool | noCollide, | ||
| bool | deleteEnt1OnBreak ) |
Creates a ballsocket constraint and returns it.