public sealed class Sandbox.PhysicsGroup
Represents a set of PhysicsBody objects. Think ragdoll.
Methods
Showing 9 methods
public void AddAngularVelocity(Vector3 vel)
Adds given amount of angular velocity to all physics bodies in this group.
Parameters
vel: How much angular force to add?
public void AddVelocity(Vector3 vel)
Adds given amount of velocity (`Sandbox.PhysicsBody.ApplyForce(Vector3)`) to all physics bodies in this group.
Parameters
vel: How much linear force to add?
public void ApplyAngularImpulse(Vector3 vel, bool withMass = False)
Adds given amount of angular linear impulse (`Sandbox.PhysicsBody.ApplyAngularImpulse(Vector3)`) to all physics bodies in this group.
Parameters
vel: Angular velocity to apply.withMass: Whether to multiply the velocity by mass of the `Sandbox.PhysicsBody` on a per-body basis. Default: False
public void ApplyImpulse(Vector3 vel, bool withMass = False)
Adds given amount of linear impulse (`Sandbox.PhysicsBody.ApplyImpulse(Vector3)`) to all physics bodies in this group.
Parameters
vel: Velocity to apply.withMass: Whether to multiply the velocity by mass of the `Sandbox.PhysicsBody` on a per-body basis. Default: False
public void RebuildMass()
Calls `Sandbox.PhysicsBody.RebuildMass` on all bodies of this group.
public void Remove()
Delete this group, and all of its bodies
public void SetSurface(string name)
Sets the physical properties of each PhysicsShape of this group.
No results match this filter.
Properties
Showing 12 properties
public float Sandbox.PhysicsGroup.AngularDamping { get; set; }
Sets `Sandbox.PhysicsBody.AngularDamping` on all bodies in this group.
public Vector3 Sandbox.PhysicsGroup.AngularVelocity { get; set; }
Sets `Sandbox.PhysicsBody.AngularVelocity` on all bodies of this group.
public System.Collections.Generic.IEnumerable`1<Sandbox.PhysicsBody> Sandbox.PhysicsGroup.Bodies { get; set; }
Returns all physics bodies that belong to this physics group.
public int Sandbox.PhysicsGroup.BodyCount { get; set; }
Returns amount of physics bodies that belong to this physics group.
public System.Collections.Generic.IEnumerable`1<Sandbox.Physics.PhysicsJoint> Sandbox.PhysicsGroup.Joints { get; set; }
Any and all joints that are attached to any body in this group.
public float Sandbox.PhysicsGroup.LinearDamping { get; set; }
Sets `Sandbox.PhysicsBody.LinearDamping` on all bodies in this group.
public float Sandbox.PhysicsGroup.Mass { get; set; }
The total mass of all the dynamicPhysicsBodies in this group. When setting the total mass, it will be set on each body proportionally to each of their old masses, i.e. if a body had 25% of previous total mass, it will have 25% of new total mass.
public Vector3 Sandbox.PhysicsGroup.MassCenter { get; set; }
Returns the center of mass for this group of physics bodies.
public Vector3 Sandbox.PhysicsGroup.Pos { get; set; }
Returns position of the first physics body of this group, or zero vector if it has none.
Note
TODO: How useful is this in its current form? Should it be removed, or at least renamed to Position?
public bool Sandbox.PhysicsGroup.Sleeping { get; set; }
Physics bodies automatically go to sleep after a certain amount of time of inactivity to save on performance. You can use this to wake the body up, or prematurely send it to sleep.
public Vector3 Sandbox.PhysicsGroup.Velocity { get; set; }
Sets `Sandbox.PhysicsBody.Velocity` on all bodies of this group.
public Sandbox.PhysicsWorld Sandbox.PhysicsGroup.World { get; set; }
The world in which this group belongs
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.PhysicsGroup |