IPhysicsObject
Jump to navigation
Jump to search
IPhysicsObject
is the basic representation of a rigid VPhysics object. It can be accessed with CBaseEntity::VPhysicsGetObject()
.
Member functions
Properties
SetMass()
SetInertia()
- Overrides this object's mass/inertia. Todo: Units
SetDamping()
Confirm:Sets rotation damping (how fast the object stops spinning)
SetDragCoefficient()
- Set friction. Todo: Units
SetBuoyancyRatio()
- Sets buoyancy Todo: "Ratio"?
Forces
ApplyForceCenter()
ApplyForceOffset()
- Applies inches/s force.
ApplyTorqueCenter()
- Applies degrees/s rotation.
AddVelocity()
SetVelocity()
SetVelocityInstantaneous()
- Adds or sets velocity in a physically incorrect way that affects the object regardless of its current mass/inertia.
SetPosition()
SetPositionMatrix()
- Teleports the object to a new location. Todo: Impact of teleporting an object short distances every frame vs. letting it find its own way.
Multiple IPhysicsObjects
An entity can represent up to 1024 IPhysicsObject
s. This happens in Valve's code with vehicle wheels and whenever a model has $collisionjoints.
