Barotrauma Client
Loading...
Searching...
No Matches
Barotrauma.Ragdoll Class Referenceabstract
Inheritance diagram for Barotrauma.Ragdoll:
Barotrauma.AnimController Barotrauma.FishAnimController Barotrauma.HumanoidAnimController

Public Member Functions

bool TryGetCollider (int index, out PhysicsBody collider)
 
void SubtractMass (Limb limb)
 
virtual void Recreate (RagdollParams ragdollParams=null)
 Call this to create the ragdoll from the RagdollParams.
 
 Ragdoll (Character character, string seed, RagdollParams ragdollParams=null)
 
void SaveRagdoll (string fileNameWithoutExtension=null)
 Saves all serializable data in the currently selected ragdoll params. This method should properly handle character flipping.
 
void ResetRagdoll (bool forceReload=false)
 Resets the serializable data to the currently selected ragdoll params. Force reloading always loads the xml stored on the disk.
 
void ResetJoints ()
 Resets the current joint values to the serialized joint params.
 
void ResetLimbs ()
 Resets the current limb values to the serialized limb params.
 
void AddJoint (JointParams jointParams)
 
void AddLimb (Limb limb)
 
void RemoveLimb (Limb limb)
 
bool OnLimbCollision (Fixture f1, Fixture f2, Contact contact)
 
float GetImpactDamage (float impact, float? impactTolerance=null)
 
bool SeverLimbJoint (LimbJoint limbJoint)
 
virtual void Flip ()
 
Vector2 GetCenterOfMass ()
 
void MoveLimb (Limb limb, Vector2 pos, float amount, bool pullFromCenter=false)
 
Parameters
pullFromCenterif false, force is applied to the position of pullJoint

 
void ResetPullJoints (Func< Limb, bool > condition=null)
 
void FindHull (Vector2? worldPosition=null, bool setSubmarine=true)
 
void Teleport (Vector2 moveAmount, Vector2 velocityChange, bool detachProjectiles=true)
 
void UpdateRagdoll (float deltaTime, Camera cam)
 
void ForceRefreshFloorY ()
 
float GetSurfaceY ()
 Get the position of the surface of water at the position of the character, in display units (taking into account connected hulls above the hull the character is in)
 
void SetPosition (Vector2 simPosition, bool lerp=false, bool ignorePlatforms=true, bool forceMainLimbToCollider=false, bool moveLatchers=true)
 
void HangWithRope ()
 
void HoldToRope ()
 
void DragWithRope ()
 
Limb GetLimb (LimbType limbType, bool excludeSevered=true)
 Note that if there are multiple limbs of the same type, only the first (valid) limb is returned.
 
Vector2GetMouthPosition ()
 
Vector2 GetColliderBottom ()
 
Limb FindLowestLimb ()
 
void ReleaseStuckLimbs ()
 
void HideAndDisable (LimbType limbType, float duration=0, bool ignoreCollisions=true)
 
void RestoreTemporarilyDisabled ()
 
void Remove ()
 

Static Public Member Functions

static void UpdateAll (float deltaTime, Camera cam)
 
static void RemoveAll ()
 

Public Attributes

LimbJoint[] LimbJoints
 
Vector2 movement
 
Structure Stairs
 
Direction TargetDir
 
bool forceStanding
 
bool forceNotStanding
 

Static Public Attributes

const float MAX_SPEED = 20
 

Protected Member Functions

void CreateColliders ()
 
void CreateJoints ()
 
void CreateLimbs ()
 
void AddLimb (LimbParams limbParams)
 
List< LimbGetConnectedLimbs (Limb limb)
 
void LogAccessedRemovedCharacterError ()
 
void StopHangingWithRope ()
 
void StopHoldingToRope ()
 
void StopGettingDraggedWithRope ()
 
void TrySetLimbPosition (Limb limb, Vector2 original, Vector2 simPosition, float rotation, bool lerp=false, bool ignorePlatforms=true)
 
void CheckDistFromCollider ()
 

Protected Attributes

Hull currentHull
 
Character character
 
float strongestImpact
 
Vector2 targetMovement
 
Vector2 overrideTargetMovement
 
float floorY
 
float standOnFloorY
 
Fixture floorFixture
 
Vector2 floorNormal = Vector2.UnitY
 
float surfaceY
 
bool inWater
 
bool headInWater
 
bool onGround
 
Direction dir
 
List< PhysicsBodycollider
 
int colliderIndex = 0
 
bool levitatingCollider = true
 
bool shouldHoldToRope
 
bool shouldHangWithRope
 
bool shouldBeDraggedWithRope
 

Properties

RagdollParams RagdollParams [get, protected set]
 
Limb[] Limbs [get]
 
bool HasMultipleLimbsOfSameType [get]
 
bool Frozen [get, set]
 
Character Character [get]
 
bool OnGround [get]
 
float ColliderHeightFromFloor [get]
 In sim units. Joint scale applied.
 
bool IsStuck [get]
 
PhysicsBody Collider [get]
 
int ColliderIndex [get, set]
 
float FloorY [get]
 
float Mass [get]
 
Limb MainLimb [get]
 
Vector2 WorldPosition [get]
 
bool SimplePhysicsEnabled [get, set]
 
Vector2 TargetMovement [get, set]
 
float? HeadPosition [get]
 
float? HeadAngle [get]
 
float? TorsoPosition [get]
 
float? TorsoAngle [get]
 
float ImpactTolerance [get]
 
bool Draggable [get]
 
CanEnterSubmarine CanEnterSubmarine [get]
 
float Dir [get]
 
Direction Direction [get]
 
bool InWater [get]
 
bool HeadInWater [get]
 
Hull CurrentHull [get, set]
 
bool IgnorePlatforms [get, set]
 
bool IsFlipped [get]
 
bool BodyInRest [get, set]
 
bool Invalid [get]
 
bool IsHoldingToRope [get]
 Is attached to something with a rope.
 
bool IsHangingWithRope [get]
 Is hanging to something with a rope, so that can reel towards it. Currently only possible in water.
 
bool IsDraggedWithRope [get]
 Has someone attached to the character with a rope?
 

Constructor & Destructor Documentation

◆ Ragdoll()

Barotrauma.Ragdoll.Ragdoll ( Character character,
string seed,
RagdollParams ragdollParams = null )

Member Function Documentation

◆ AddJoint()

void Barotrauma.Ragdoll.AddJoint ( JointParams jointParams)

◆ AddLimb() [1/2]

void Barotrauma.Ragdoll.AddLimb ( Limb limb)

◆ AddLimb() [2/2]

void Barotrauma.Ragdoll.AddLimb ( LimbParams limbParams)
protected

◆ CheckDistFromCollider()

void Barotrauma.Ragdoll.CheckDistFromCollider ( )
protected

◆ CreateColliders()

void Barotrauma.Ragdoll.CreateColliders ( )
protected

◆ CreateJoints()

void Barotrauma.Ragdoll.CreateJoints ( )
protected

◆ CreateLimbs()

void Barotrauma.Ragdoll.CreateLimbs ( )
protected

◆ DragWithRope()

void Barotrauma.Ragdoll.DragWithRope ( )

◆ FindHull()

void Barotrauma.Ragdoll.FindHull ( Vector2? worldPosition = null,
bool setSubmarine = true )

◆ FindLowestLimb()

Limb Barotrauma.Ragdoll.FindLowestLimb ( )

◆ Flip()

virtual void Barotrauma.Ragdoll.Flip ( )
virtual

◆ ForceRefreshFloorY()

void Barotrauma.Ragdoll.ForceRefreshFloorY ( )

◆ GetCenterOfMass()

Vector2 Barotrauma.Ragdoll.GetCenterOfMass ( )

◆ GetColliderBottom()

Vector2 Barotrauma.Ragdoll.GetColliderBottom ( )

◆ GetConnectedLimbs()

List< Limb > Barotrauma.Ragdoll.GetConnectedLimbs ( Limb limb)
protected

◆ GetImpactDamage()

float Barotrauma.Ragdoll.GetImpactDamage ( float impact,
float? impactTolerance = null )

◆ GetLimb()

Limb Barotrauma.Ragdoll.GetLimb ( LimbType limbType,
bool excludeSevered = true )

Note that if there are multiple limbs of the same type, only the first (valid) limb is returned.

◆ GetMouthPosition()

Vector2? Barotrauma.Ragdoll.GetMouthPosition ( )

◆ GetSurfaceY()

float Barotrauma.Ragdoll.GetSurfaceY ( )

Get the position of the surface of water at the position of the character, in display units (taking into account connected hulls above the hull the character is in)

◆ HangWithRope()

void Barotrauma.Ragdoll.HangWithRope ( )

◆ HideAndDisable()

void Barotrauma.Ragdoll.HideAndDisable ( LimbType limbType,
float duration = 0,
bool ignoreCollisions = true )

◆ HoldToRope()

void Barotrauma.Ragdoll.HoldToRope ( )

◆ LogAccessedRemovedCharacterError()

void Barotrauma.Ragdoll.LogAccessedRemovedCharacterError ( )
protected

◆ MoveLimb()

void Barotrauma.Ragdoll.MoveLimb ( Limb limb,
Vector2 pos,
float amount,
bool pullFromCenter = false )

Parameters
pullFromCenterif false, force is applied to the position of pullJoint

◆ OnLimbCollision()

bool Barotrauma.Ragdoll.OnLimbCollision ( Fixture f1,
Fixture f2,
Contact contact )

◆ Recreate()

virtual void Barotrauma.Ragdoll.Recreate ( RagdollParams ragdollParams = null)
virtual

Call this to create the ragdoll from the RagdollParams.

Reimplemented in Barotrauma.AnimController, and Barotrauma.HumanoidAnimController.

◆ ReleaseStuckLimbs()

void Barotrauma.Ragdoll.ReleaseStuckLimbs ( )

◆ Remove()

void Barotrauma.Ragdoll.Remove ( )

◆ RemoveAll()

static void Barotrauma.Ragdoll.RemoveAll ( )
static

◆ RemoveLimb()

void Barotrauma.Ragdoll.RemoveLimb ( Limb limb)

◆ ResetJoints()

void Barotrauma.Ragdoll.ResetJoints ( )

Resets the current joint values to the serialized joint params.

◆ ResetLimbs()

void Barotrauma.Ragdoll.ResetLimbs ( )

Resets the current limb values to the serialized limb params.

◆ ResetPullJoints()

void Barotrauma.Ragdoll.ResetPullJoints ( Func< Limb, bool > condition = null)

◆ ResetRagdoll()

void Barotrauma.Ragdoll.ResetRagdoll ( bool forceReload = false)

Resets the serializable data to the currently selected ragdoll params. Force reloading always loads the xml stored on the disk.

◆ RestoreTemporarilyDisabled()

void Barotrauma.Ragdoll.RestoreTemporarilyDisabled ( )

◆ SaveRagdoll()

void Barotrauma.Ragdoll.SaveRagdoll ( string fileNameWithoutExtension = null)

Saves all serializable data in the currently selected ragdoll params. This method should properly handle character flipping.

◆ SetPosition()

void Barotrauma.Ragdoll.SetPosition ( Vector2 simPosition,
bool lerp = false,
bool ignorePlatforms = true,
bool forceMainLimbToCollider = false,
bool moveLatchers = true )

◆ SeverLimbJoint()

bool Barotrauma.Ragdoll.SeverLimbJoint ( LimbJoint limbJoint)

◆ StopGettingDraggedWithRope()

void Barotrauma.Ragdoll.StopGettingDraggedWithRope ( )
protected

◆ StopHangingWithRope()

void Barotrauma.Ragdoll.StopHangingWithRope ( )
protected

◆ StopHoldingToRope()

void Barotrauma.Ragdoll.StopHoldingToRope ( )
protected

◆ SubtractMass()

void Barotrauma.Ragdoll.SubtractMass ( Limb limb)

◆ Teleport()

void Barotrauma.Ragdoll.Teleport ( Vector2 moveAmount,
Vector2 velocityChange,
bool detachProjectiles = true )

◆ TryGetCollider()

bool Barotrauma.Ragdoll.TryGetCollider ( int index,
out PhysicsBody collider )

◆ TrySetLimbPosition()

void Barotrauma.Ragdoll.TrySetLimbPosition ( Limb limb,
Vector2 original,
Vector2 simPosition,
float rotation,
bool lerp = false,
bool ignorePlatforms = true )
protected

◆ UpdateAll()

static void Barotrauma.Ragdoll.UpdateAll ( float deltaTime,
Camera cam )
static

◆ UpdateRagdoll()

void Barotrauma.Ragdoll.UpdateRagdoll ( float deltaTime,
Camera cam )

Member Data Documentation

◆ character

Character Barotrauma.Ragdoll.character
protected

◆ collider

List<PhysicsBody> Barotrauma.Ragdoll.collider
protected

◆ colliderIndex

int Barotrauma.Ragdoll.colliderIndex = 0
protected

◆ currentHull

Hull Barotrauma.Ragdoll.currentHull
protected

◆ dir

Direction Barotrauma.Ragdoll.dir
protected

◆ floorFixture

Fixture Barotrauma.Ragdoll.floorFixture
protected

◆ floorNormal

Vector2 Barotrauma.Ragdoll.floorNormal = Vector2.UnitY
protected

◆ floorY

float Barotrauma.Ragdoll.floorY
protected

◆ forceNotStanding

bool Barotrauma.Ragdoll.forceNotStanding

◆ forceStanding

bool Barotrauma.Ragdoll.forceStanding

◆ headInWater

bool Barotrauma.Ragdoll.headInWater
protected

◆ inWater

bool Barotrauma.Ragdoll.inWater
protected

◆ levitatingCollider

bool Barotrauma.Ragdoll.levitatingCollider = true
protected

◆ LimbJoints

LimbJoint [] Barotrauma.Ragdoll.LimbJoints

◆ MAX_SPEED

const float Barotrauma.Ragdoll.MAX_SPEED = 20
static

◆ movement

Vector2 Barotrauma.Ragdoll.movement

◆ onGround

bool Barotrauma.Ragdoll.onGround
protected

◆ overrideTargetMovement

Vector2 Barotrauma.Ragdoll.overrideTargetMovement
protected

◆ shouldBeDraggedWithRope

bool Barotrauma.Ragdoll.shouldBeDraggedWithRope
protected

◆ shouldHangWithRope

bool Barotrauma.Ragdoll.shouldHangWithRope
protected

◆ shouldHoldToRope

bool Barotrauma.Ragdoll.shouldHoldToRope
protected

◆ Stairs

Structure Barotrauma.Ragdoll.Stairs

◆ standOnFloorY

float Barotrauma.Ragdoll.standOnFloorY
protected

◆ strongestImpact

float Barotrauma.Ragdoll.strongestImpact
protected

◆ surfaceY

float Barotrauma.Ragdoll.surfaceY
protected

◆ TargetDir

Direction Barotrauma.Ragdoll.TargetDir

◆ targetMovement

Vector2 Barotrauma.Ragdoll.targetMovement
protected

Property Documentation

◆ BodyInRest

bool Barotrauma.Ragdoll.BodyInRest
getset

◆ CanEnterSubmarine

CanEnterSubmarine Barotrauma.Ragdoll.CanEnterSubmarine
get

◆ Character

Character Barotrauma.Ragdoll.Character
get

◆ Collider

PhysicsBody Barotrauma.Ragdoll.Collider
get

◆ ColliderHeightFromFloor

float Barotrauma.Ragdoll.ColliderHeightFromFloor
get

In sim units. Joint scale applied.

◆ ColliderIndex

int Barotrauma.Ragdoll.ColliderIndex
getset

◆ CurrentHull

Hull Barotrauma.Ragdoll.CurrentHull
getset

◆ Dir

float Barotrauma.Ragdoll.Dir
get

◆ Direction

Direction Barotrauma.Ragdoll.Direction
get

◆ Draggable

bool Barotrauma.Ragdoll.Draggable
get

◆ FloorY

float Barotrauma.Ragdoll.FloorY
get

◆ Frozen

bool Barotrauma.Ragdoll.Frozen
getset

◆ HasMultipleLimbsOfSameType

bool Barotrauma.Ragdoll.HasMultipleLimbsOfSameType
get

◆ HeadAngle

float? Barotrauma.Ragdoll.HeadAngle
getabstract

◆ HeadInWater

bool Barotrauma.Ragdoll.HeadInWater
get

◆ HeadPosition

float? Barotrauma.Ragdoll.HeadPosition
getabstract

◆ IgnorePlatforms

bool Barotrauma.Ragdoll.IgnorePlatforms
getset

◆ ImpactTolerance

float Barotrauma.Ragdoll.ImpactTolerance
get

◆ Invalid

bool Barotrauma.Ragdoll.Invalid
get

◆ InWater

bool Barotrauma.Ragdoll.InWater
get

◆ IsDraggedWithRope

bool Barotrauma.Ragdoll.IsDraggedWithRope
get

Has someone attached to the character with a rope?

◆ IsFlipped

bool Barotrauma.Ragdoll.IsFlipped
get

◆ IsHangingWithRope

bool Barotrauma.Ragdoll.IsHangingWithRope
get

Is hanging to something with a rope, so that can reel towards it. Currently only possible in water.

◆ IsHoldingToRope

bool Barotrauma.Ragdoll.IsHoldingToRope
get

Is attached to something with a rope.

◆ IsStuck

bool Barotrauma.Ragdoll.IsStuck
get

◆ Limbs

Limb [] Barotrauma.Ragdoll.Limbs
get

◆ MainLimb

Limb Barotrauma.Ragdoll.MainLimb
get

◆ Mass

float Barotrauma.Ragdoll.Mass
get

◆ OnGround

bool Barotrauma.Ragdoll.OnGround
get

◆ RagdollParams

RagdollParams Barotrauma.Ragdoll.RagdollParams
getprotected setabstract

◆ SimplePhysicsEnabled

bool Barotrauma.Ragdoll.SimplePhysicsEnabled
getset

◆ TargetMovement

Vector2 Barotrauma.Ragdoll.TargetMovement
getset

◆ TorsoAngle

float? Barotrauma.Ragdoll.TorsoAngle
getabstract

◆ TorsoPosition

float? Barotrauma.Ragdoll.TorsoPosition
getabstract

◆ WorldPosition

Vector2 Barotrauma.Ragdoll.WorldPosition
get

The documentation for this class was generated from the following file: