Barotrauma Server
|
Public Types | |
enum | Shape { Circle , Rectangle , Capsule , HorizontalCapsule } |
Public Member Functions | |
float | TransformRotation (float rotation) |
PhysicsBody (XElement element, float scale=1.0f, bool findNewContacts=true) | |
PhysicsBody (ColliderParams cParams, bool findNewContacts=true) | |
PhysicsBody (LimbParams lParams, bool findNewContacts=true) | |
PhysicsBody (float width, float height, float radius, float density, BodyType bodyType, Category collisionCategory, Category collidesWith, bool findNewContacts=true) | |
PhysicsBody (Body farseerBody) | |
PhysicsBody (ColliderParams colliderParams, Vector2 position, bool findNewContacts=true) | |
PhysicsBody (LimbParams limbParams, Vector2 position, bool findNewContacts=true) | |
PhysicsBody (XElement element, Vector2 position, float scale=1.0f, float? forceDensity=null, Category collisionCategory=Physics.CollisionItem, Category collidesWith=Physics.CollisionWall|Physics.CollisionLevel|Physics.CollisionPlatform, bool findNewContacts=true) | |
Vector2 | GetLocalFront (float? spritesheetRotation=null) |
Returns the farthest point towards the forward of the body. For capsules and circles, the front is at the top. For horizontal capsules, the front is at the right-most point. For rectangles, the front is either at the top or at the right, depending on which one of the two is greater: width or height. The rotation is in radians. | |
float | GetMaxExtent () |
Vector2 | GetSize () |
void | SetSize (Vector2 size) |
bool | IsValidValue (float value, string valueName, float minValue=float.MinValue, float maxValue=float.MaxValue) |
void | ResetDynamics () |
void | ApplyLinearImpulse (Vector2 impulse) |
void | ApplyLinearImpulse (Vector2 impulse, float maxVelocity) |
Apply an impulse to the body without increasing it's velocity above a specific limit. | |
void | ApplyLinearImpulse (Vector2 impulse, Vector2 point) |
void | ApplyLinearImpulse (Vector2 impulse, Vector2 point, float maxVelocity) |
Apply an impulse to the body without increasing it's velocity above a specific limit. | |
void | ApplyForce (Vector2 force, float maxVelocity=NetConfig.MaxPhysicsBodyVelocity) |
void | ApplyForce (Vector2 force, Vector2 point) |
void | ApplyTorque (float torque) |
bool | SetTransform (Vector2 simPosition, float rotation, bool setPrevTransform=true) |
bool | SetTransformIgnoreContacts (Vector2 simPosition, float rotation, bool setPrevTransform=true) |
void | SetPrevTransform (Vector2 simPosition, float rotation) |
void | MoveToTargetPosition (bool lerp=true) |
void | MoveToPos (Vector2 simPosition, float force, Vector2? pullPos=null) |
void | ApplyWaterForces () |
Applies buoyancy, drag and angular drag caused by water. | |
void | Update () |
void | UpdateDrawPosition (bool interpolate=true) |
void | CorrectPosition< T > (List< T > positionBuffer, out Vector2 newPosition, out Vector2 newVelocity, out float newRotation, out float newAngularVelocity) |
void | SmoothRotate (float targetRotation, float force=10.0f, bool wrapAngle=true) |
Rotate the body towards the target rotation in the "shortest direction", taking into account the current angular velocity to prevent overshooting. | |
float | WrapAngleToSameNumberOfRevolutions (float angle) |
Wraps the angle so it has "has the same number of revolutions" as this body, i.e. that the angles are at most 180 degrees apart. For example, if the angle of this body was 720, an angle of 5 would get wrapped to 725. | |
void | Remove () |
void | ServerWrite (IWriteMessage msg) |
Static Public Member Functions | |
static float | TransformRotation (float rot, float dir) |
static void | RemoveAll () |
static bool | IsValidShape (float radius, float height, float width) |
static Shape | DefineBodyShape (float radius, float width, float height) |
Public Attributes | |
float? | PositionSmoothingFactor |
Submarine | Submarine |
Static Public Attributes | |
const float | MinDensity = 0.01f |
const float | DefaultAngularDamping = 5.0f |
Protected Attributes | |
Vector2 | prevPosition |
float | prevRotation |
Vector2? | targetPosition |
float? | targetRotation |
Properties | |
static List< PhysicsBody > | List [get] |
bool | Removed [get] |
Vector2 | LastSentPosition [get] |
float | Height [get] |
float | Width [get] |
float | Radius [get] |
Shape | BodyShape [get] |
Vector2? | TargetPosition [get, set] |
float? | TargetRotation [get, set] |
Vector2 | DrawPosition [get] |
float | DrawRotation [get] |
float | Dir [get, set] |
bool | Enabled [get, set] |
bool | PhysEnabled [get, set] |
Vector2 | SimPosition [get] |
Vector2 | Position [get] |
Vector2 | DrawPositionOffset [get] |
Offset of the DrawPosition from the Position (i.e. how much the interpolated draw position is offset from the "actual position"). In display units. | |
Vector2 | PrevPosition [get] |
float | Rotation [get] |
float | TransformedRotation [get] |
Takes flipping (Dir) into account. | |
Vector2 | LinearVelocity [get, set] |
float | AngularVelocity [get, set] |
float | Mass [get] |
float | Density [get] |
Body | FarseerBody [get] |
object | UserData [get, set] |
float | Friction [set] |
BodyType | BodyType [get, set] |
Category | CollisionCategories [get, set] |
Category | CollidesWith [get, set] |
bool | SuppressSmoothRotationCalls [get, set] |
Ignore rotation calls for the rest of this and the next update. Automatically disabled after that. Used for temporarily suppressing the SmoothRotate calls to prevent conflicting or unitentionally amplified rotations. | |
Barotrauma.PhysicsBody.PhysicsBody | ( | XElement | element, |
float | scale = 1::0f, | ||
bool | findNewContacts = true ) |
Barotrauma.PhysicsBody.PhysicsBody | ( | ColliderParams | cParams, |
bool | findNewContacts = true ) |
Barotrauma.PhysicsBody.PhysicsBody | ( | LimbParams | lParams, |
bool | findNewContacts = true ) |
Barotrauma.PhysicsBody.PhysicsBody | ( | float | width, |
float | height, | ||
float | radius, | ||
float | density, | ||
BodyType | bodyType, | ||
Category | collisionCategory, | ||
Category | collidesWith, | ||
bool | findNewContacts = true ) |
Barotrauma.PhysicsBody.PhysicsBody | ( | Body | farseerBody | ) |
Barotrauma.PhysicsBody.PhysicsBody | ( | ColliderParams | colliderParams, |
Vector2 | position, | ||
bool | findNewContacts = true ) |
Barotrauma.PhysicsBody.PhysicsBody | ( | LimbParams | limbParams, |
Vector2 | position, | ||
bool | findNewContacts = true ) |
Barotrauma.PhysicsBody.PhysicsBody | ( | XElement | element, |
Vector2 | position, | ||
float | scale = 1::0f, | ||
float? | forceDensity = null, | ||
Category | collisionCategory = Physics::CollisionItem, | ||
Category | collidesWith = Physics::CollisionWall | Physics::CollisionLevel | Physics::CollisionPlatform, | ||
bool | findNewContacts = true ) |
void Barotrauma.PhysicsBody.ApplyForce | ( | Vector2 | force, |
float | maxVelocity = NetConfig::MaxPhysicsBodyVelocity ) |
void Barotrauma.PhysicsBody.ApplyLinearImpulse | ( | Vector2 | impulse | ) |
void Barotrauma.PhysicsBody.ApplyLinearImpulse | ( | Vector2 | impulse, |
float | maxVelocity ) |
Apply an impulse to the body without increasing it's velocity above a specific limit.
void Barotrauma.PhysicsBody.ApplyLinearImpulse | ( | Vector2 | impulse, |
Vector2 | point, | ||
float | maxVelocity ) |
Apply an impulse to the body without increasing it's velocity above a specific limit.
void Barotrauma.PhysicsBody.ApplyTorque | ( | float | torque | ) |
void Barotrauma.PhysicsBody.ApplyWaterForces | ( | ) |
Applies buoyancy, drag and angular drag caused by water.
void Barotrauma.PhysicsBody.CorrectPosition< T > | ( | List< T > | positionBuffer, |
out Vector2 | newPosition, | ||
out Vector2 | newVelocity, | ||
out float | newRotation, | ||
out float | newAngularVelocity ) |
T | : | PosInfo |
|
static |
Vector2 Barotrauma.PhysicsBody.GetLocalFront | ( | float? | spritesheetRotation = null | ) |
Returns the farthest point towards the forward of the body. For capsules and circles, the front is at the top. For horizontal capsules, the front is at the right-most point. For rectangles, the front is either at the top or at the right, depending on which one of the two is greater: width or height. The rotation is in radians.
float Barotrauma.PhysicsBody.GetMaxExtent | ( | ) |
Vector2 Barotrauma.PhysicsBody.GetSize | ( | ) |
|
static |
bool Barotrauma.PhysicsBody.IsValidValue | ( | float | value, |
string | valueName, | ||
float | minValue = float::MinValue, | ||
float | maxValue = float::MaxValue ) |
void Barotrauma.PhysicsBody.MoveToTargetPosition | ( | bool | lerp = true | ) |
void Barotrauma.PhysicsBody.Remove | ( | ) |
|
static |
void Barotrauma.PhysicsBody.ResetDynamics | ( | ) |
void Barotrauma.PhysicsBody.ServerWrite | ( | IWriteMessage | msg | ) |
void Barotrauma.PhysicsBody.SetPrevTransform | ( | Vector2 | simPosition, |
float | rotation ) |
void Barotrauma.PhysicsBody.SetSize | ( | Vector2 | size | ) |
bool Barotrauma.PhysicsBody.SetTransform | ( | Vector2 | simPosition, |
float | rotation, | ||
bool | setPrevTransform = true ) |
bool Barotrauma.PhysicsBody.SetTransformIgnoreContacts | ( | Vector2 | simPosition, |
float | rotation, | ||
bool | setPrevTransform = true ) |
void Barotrauma.PhysicsBody.SmoothRotate | ( | float | targetRotation, |
float | force = 10::0f, | ||
bool | wrapAngle = true ) |
Rotate the body towards the target rotation in the "shortest direction", taking into account the current angular velocity to prevent overshooting.
targetRotation | Desired rotation in radians |
force | How fast the body should be rotated. Does not represent any real unit, you may want to experiment with different values to get the desired effect. |
wrapAngle | Should the angles be wrapped. Set to false if it makes a difference whether the angle of the body is 0.0f or 360.0f. |
|
static |
float Barotrauma.PhysicsBody.TransformRotation | ( | float | rotation | ) |
void Barotrauma.PhysicsBody.Update | ( | ) |
void Barotrauma.PhysicsBody.UpdateDrawPosition | ( | bool | interpolate = true | ) |
float Barotrauma.PhysicsBody.WrapAngleToSameNumberOfRevolutions | ( | float | angle | ) |
Wraps the angle so it has "has the same number of revolutions" as this body, i.e. that the angles are at most 180 degrees apart. For example, if the angle of this body was 720, an angle of 5 would get wrapped to 725.
|
static |
|
static |
float? Barotrauma.PhysicsBody.PositionSmoothingFactor |
|
protected |
|
protected |
Submarine Barotrauma.PhysicsBody.Submarine |
|
protected |
|
protected |
|
getset |
|
get |
|
getset |
|
getset |
|
getset |
|
get |
|
getset |
|
get |
|
get |
Offset of the DrawPosition from the Position (i.e. how much the interpolated draw position is offset from the "actual position"). In display units.
|
get |
|
getset |
|
get |
|
set |
|
get |
|
get |
|
getset |
|
staticget |
|
get |
|
getset |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
getset |
Ignore rotation calls for the rest of this and the next update. Automatically disabled after that. Used for temporarily suppressing the SmoothRotate calls to prevent conflicting or unitentionally amplified rotations.
|
getset |
|
getset |
|
get |
Takes flipping (Dir) into account.
|
getset |
|
get |