It represents a physics object.
Adds the specified angular velocity velocity to the current PhysObj.
Rotates the object so that it's angles are aligned to the ones inputted.
Applies the specified impulse in the mass center of the physics object. This will not work on players, use Entity:SetVelocity instead.
Applies the specified impulse on the physics object at the specified position.
Applies the specified angular impulse to the physics object. See PhysObj:CalculateForceOffset
Calculates the linear and angular impulse on the object's center of mass for an offset impulse. The outputs can be used with PhysObj:ApplyForceCenter and PhysObj:ApplyTorqueCenter, respectively. Be careful to convert the angular impulse to world frame (PhysObj:LocalToWorldVector) if you are going to use it with ApplyTorqueCenter.
Calculates the linear and angular velocities on the center of mass for an offset impulse. The outputs can be directly passed to PhysObj:AddVelocity and PhysObj:AddAngleVelocity, respectively. This will return zero length vectors if the physics object's motion is disabled. See PhysObj:IsMotionEnabled.
Allows you to move a PhysObj to a point and angle in 3D space.
Sets whether the physics object should collide with anything or not, including world. This function currently has major problems with player collisions, and as such should be avoided at all costs. A better alternative to this function would be using Entity:SetCollisionGroup( COLLISION_GROUP_WORLD ).
Sets whether the physobject should be able to move or not. This is the exact method the Physics Gun uses to freeze props. If a motion-disabled physics object is grabbed with the physics gun, the object will be able to move again. To disallow this, use GM:PhysgunPickup.
Gets the angular velocity of the object in degrees per second as a local vector. You can use dot product to read the magnitude from a specific axis.
Returns the sum of the linear and rotational kinetic energies of the physics object.
Returns the friction snapshot of this physics object. This is useful for determining if an object touching ground for example.
Returns the principal moments of inertia (Ixx, Iyy, Izz) of the physics object, in the local frame, with respect to the center of mass.
Returns the physics mesh of the object which is used for physobj-on-physobj collision.
Returns all convex physics meshes of the object. See Entity:PhysicsInitMultiConvex for more information.
Returns the position and angle of the physics object as a 3x4 matrix (VMatrix is 4x4 so the fourth row goes unused). The first three columns store the angle as a rotation matrix, and the fourth column stores the position vector.
Returns the surface area of the physics object in source-units². Or nil if the PhysObj is a generated sphere or box.
Returns the world velocity of a point in world coordinates about the object. This is useful for objects rotating around their own axis/origin.
Returns the volume in source units³. Or nil if the PhysObj is a generated sphere or box.
Returns whether the physics object is "sleeping". See PhysObj:Sleep for more information.
Returns if the physics object can move itself (by velocity, acceleration)
Returns whenever the physics object is penetrating another physics object. This is internally implemented as PhysObj:HasGameFlag( FVPHYSICS_PENETRATING ) and thus is only updated for non-static physics objects.
Mapping a vector in local frame of the physics object to world frame. this function does translation and rotation, with translation done first.
Rotate a vector from the local frame of the physics object to world frame. This function only rotates the vector, without any translation operation.
Prints debug info about the state of the physics object to the console.
Call this when the collision filter conditions change due to this object's state (e. g. changing solid type or collision group)
A convinience function for Angle:RotateAroundAxis.
Sets the amount of drag to apply to a physics object when attempting to rotate.
Sets the specified angular velocity on the PhysObj
Sets the specified instantaneous angular velocity on the PhysObj
Sets the buoyancy ratio of the physics object. (How well it floats in water)
Sets the linear and angular damping of the physics object.
Modifies how much drag (air resistance) affects the object.
Sets the angular inertia. See PhysObj:GetInertia. This does not affect linear inertia.
Sets the material of the physobject. Impact sounds will only change if this is called on client
Sets the velocity of the physics object for the next iteration.
Makes the physics object "sleep". The physics object will no longer be moving unless it is "woken up" by either a collision with another moving object, or by PhysObj:Wake. This is an optimization feature of the physics engine. Normally physics objects will automatically "sleep" when not moving for a short while, to save resources, but it can be used for other purposes, for example to temporarily suspend an object mid air.
Unlike PhysObj:SetPos and PhysObj:SetAngles, this allows the movement of a physobj while leaving physics interactions intact. This is used internally by the motion controller of the Gravity Gun , the +use pickup and the Physics Gun, and entities such as the crane. This is the ideal function to move a physics shadow created with Entity:PhysicsInitShadow or Entity:MakePhysicsObjectAShadow.
Wakes the physics object, so that it will continue to simulate physics/gravity. See PhysObj:Sleep for more information.
Converts a vector to a relative to the physics object coordinate system.