PhysicsBody

Barotrauma.PhysicsBody

Functions

ApplyForce(force, point)

ApplyForce

Parameters

  • force Microsoft.Xna.Framework.Vector2

  • point Microsoft.Xna.Framework.Vector2

ApplyForce(force, maxVelocity)

ApplyForce

Parameters

  • force Microsoft.Xna.Framework.Vector2

  • maxVelocity number

ApplyLinearImpulse(impulse, maxVelocity)

ApplyLinearImpulse

Parameters

  • impulse Microsoft.Xna.Framework.Vector2

  • maxVelocity number

ApplyLinearImpulse(impulse)

ApplyLinearImpulse

Parameters

  • impulse Microsoft.Xna.Framework.Vector2

ApplyLinearImpulse(impulse, point, maxVelocity)

ApplyLinearImpulse

Parameters

  • impulse Microsoft.Xna.Framework.Vector2

  • point Microsoft.Xna.Framework.Vector2

  • maxVelocity number

ApplyLinearImpulse(impulse, point)

ApplyLinearImpulse

Parameters

  • impulse Microsoft.Xna.Framework.Vector2

  • point Microsoft.Xna.Framework.Vector2

ApplyTorque(torque)

ApplyTorque

Parameters

  • torque number

ApplyWaterForces()

ApplyWaterForces

ClientRead(msg, sendingTime, parentDebugName)

ClientRead

Parameters

  • msg Networking.IReadMessage

  • sendingTime number

Returns

  • PosInfo

CorrectPosition(positionBuffer, newPosition, newVelocity, newRotation, newAngularVelocity)

CorrectPosition

Parameters

  • newPosition Microsoft.Xna.Framework.Vector2&

  • newVelocity Microsoft.Xna.Framework.Vector2&

  • newRotation Single&

  • newAngularVelocity Single&

DebugDraw(spriteBatch, color, forceColor)

DebugDraw

Parameters

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

  • color Microsoft.Xna.Framework.Color

  • forceColor bool

Draw(deformSprite, cam, scale, color, invert)

Draw

Parameters

  • deformSprite DeformableSprite

  • cam Camera

  • scale Microsoft.Xna.Framework.Vector2

  • color Microsoft.Xna.Framework.Color

  • invert bool

Draw(spriteBatch, sprite, color, depth, scale, mirrorX, mirrorY, origin)

Draw

Parameters

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

  • sprite Sprite

  • color Microsoft.Xna.Framework.Color

  • depth optional Single

  • scale number

  • mirrorX bool

  • mirrorY bool

  • origin optional Microsoft.Xna.Framework.Vector2

Equals(obj)

Equals

Parameters

  • obj Object

Returns

  • bool

GetHashCode()

GetHashCode

Returns

  • number

GetLocalFront(spritesheetRotation)

GetLocalFront

Parameters

  • spritesheetRotation optional Single

Returns

  • Microsoft.Xna.Framework.Vector2

GetMaxExtent()

GetMaxExtent

Returns

  • number

GetSize()

GetSize

Returns

  • Microsoft.Xna.Framework.Vector2

GetType()

GetType

Returns

  • Type

IsValidValue(value, valueName, minValue, maxValue)

IsValidValue

Parameters

  • value number

  • minValue number

  • maxValue number

Returns

  • bool

MoveToPos(simPosition, force, pullPos)

MoveToPos

Parameters

  • simPosition Microsoft.Xna.Framework.Vector2

  • force number

  • pullPos optional Microsoft.Xna.Framework.Vector2

MoveToTargetPosition(lerp)

MoveToTargetPosition

Parameters

  • lerp bool

PhysicsBody(lParams, findNewContacts)

PhysicsBody

Parameters

  • lParams LimbParams

  • findNewContacts bool

PhysicsBody(colliderParams, position, findNewContacts)

PhysicsBody

Parameters

  • colliderParams ColliderParams

  • position Microsoft.Xna.Framework.Vector2

  • findNewContacts bool

PhysicsBody(limbParams, position, findNewContacts)

PhysicsBody

Parameters

  • limbParams LimbParams

  • position Microsoft.Xna.Framework.Vector2

  • findNewContacts bool

PhysicsBody(cParams, findNewContacts)

PhysicsBody

Parameters

  • cParams ColliderParams

  • findNewContacts bool

PhysicsBody(width, height, radius, density, bodyType, collisionCategory, collidesWith, findNewContacts)

PhysicsBody

Parameters

  • width number

  • height number

  • radius number

  • density number

  • bodyType FarseerPhysics.BodyType

  • collisionCategory FarseerPhysics.Dynamics.Category

  • collidesWith FarseerPhysics.Dynamics.Category

  • findNewContacts bool

PhysicsBody(element, position, scale, forceDensity, collisionCategory, collidesWith, findNewContacts)

PhysicsBody

Parameters

  • element Xml.Linq.XElement

  • position Microsoft.Xna.Framework.Vector2

  • scale number

  • forceDensity optional Single

  • collisionCategory FarseerPhysics.Dynamics.Category

  • collidesWith FarseerPhysics.Dynamics.Category

  • findNewContacts bool

PhysicsBody(element, scale, findNewContacts)

PhysicsBody

Parameters

  • element Xml.Linq.XElement

  • scale number

  • findNewContacts bool

PhysicsBody(farseerBody)

PhysicsBody

Parameters

  • farseerBody FarseerPhysics.Dynamics.Body

PhysicsBody.DefineBodyShape(radius, width, height)

DefineBodyShape

Parameters

  • radius number

  • width number

  • height number

Returns

  • Shape

PhysicsBody.IsValidShape(radius, height, width)

IsValidShape

Parameters

  • radius number

  • height number

  • width number

Returns

  • bool

PhysicsBody.RemoveAll()

RemoveAll

PhysicsBody.TransformRotation(rot, dir)

TransformRotation

Parameters

  • rot number

  • dir number

Returns

  • number

Remove()

Remove

ResetDynamics()

ResetDynamics

ServerWrite(msg)

ServerWrite

Parameters

  • msg Networking.IWriteMessage

SetPrevTransform(simPosition, rotation)

SetPrevTransform

Parameters

  • simPosition Microsoft.Xna.Framework.Vector2

  • rotation number

SetSize(size)

SetSize

Parameters

  • size Microsoft.Xna.Framework.Vector2

SetTransform(simPosition, rotation, setPrevTransform)

SetTransform

Parameters

  • simPosition Microsoft.Xna.Framework.Vector2

  • rotation number

  • setPrevTransform bool

Returns

  • bool

SetTransformIgnoreContacts(simPosition, rotation, setPrevTransform)

SetTransformIgnoreContacts

Parameters

  • simPosition Microsoft.Xna.Framework.Vector2

  • rotation number

  • setPrevTransform bool

Returns

  • bool

SmoothRotate(targetRotation, force, wrapAngle)

SmoothRotate

Parameters

  • targetRotation number

  • force number

  • wrapAngle bool

ToString()

ToString

Returns

TransformRotation(rotation)

TransformRotation

Parameters

  • rotation number

Returns

  • number

Update()

Update

UpdateDrawPosition(interpolate)

UpdateDrawPosition

Parameters

  • interpolate bool

WrapAngleToSameNumberOfRevolutions(angle)

WrapAngleToSameNumberOfRevolutions

Parameters

  • angle number

Returns

  • number

Fields

AngularVelocity

AngularVelocity, field of type number

  • AngularVelocity

BodyShape

BodyShape, field of type Shape

  • BodyShape

BodyType

BodyType, field of type FarseerPhysics.BodyType

  • BodyType

CollidesWith

CollidesWith, field of type FarseerPhysics.Dynamics.Category

  • CollidesWith

CollisionCategories

CollisionCategories, field of type FarseerPhysics.Dynamics.Category

  • CollisionCategories

Density

Density, field of type number

  • Density

Dir

Dir, field of type number

  • Dir

DrawPosition

DrawPosition, field of type Microsoft.Xna.Framework.Vector2

  • DrawPosition

DrawPositionOffset

DrawPositionOffset, field of type Microsoft.Xna.Framework.Vector2

  • DrawPositionOffset

DrawRotation

DrawRotation, field of type number

  • DrawRotation

Enabled

Enabled, field of type bool

  • Enabled

FarseerBody

FarseerBody, field of type FarseerPhysics.Dynamics.Body

  • FarseerBody

Friction

Friction, field of type number

  • Friction

Height

Height, field of type number

  • Height

LastSentPosition

LastSentPosition, field of type Microsoft.Xna.Framework.Vector2

  • LastSentPosition

LinearVelocity

LinearVelocity, field of type Microsoft.Xna.Framework.Vector2

  • LinearVelocity

Mass

Mass, field of type number

  • Mass

PhysEnabled

PhysEnabled, field of type bool

  • PhysEnabled

PhysicsBody.DefaultAngularDamping

PhysicsBody.DefaultAngularDamping, field of type number

PhysicsBody.List

PhysicsBody.List, field of type table

PhysicsBody.MinDensity

PhysicsBody.MinDensity, field of type number

Position

Position, field of type Microsoft.Xna.Framework.Vector2

  • Position

PositionSmoothingFactor

PositionSmoothingFactor, field of type ?Single

  • PositionSmoothingFactor

PrevPosition

PrevPosition, field of type Microsoft.Xna.Framework.Vector2

  • PrevPosition

Radius

Radius, field of type number

  • Radius

Removed

Removed, field of type bool

  • Removed

Rotation

Rotation, field of type number

  • Rotation

SimPosition

SimPosition, field of type Microsoft.Xna.Framework.Vector2

  • SimPosition

Submarine

Submarine, field of type Submarine

  • Submarine

SuppressSmoothRotationCalls

SuppressSmoothRotationCalls, field of type bool

  • SuppressSmoothRotationCalls

TargetPosition

TargetPosition, field of type ?Microsoft.Xna.Framework.Vector2

  • TargetPosition

TargetRotation

TargetRotation, field of type ?Single

  • TargetRotation

TransformedRotation

TransformedRotation, field of type number

  • TransformedRotation

UserData

UserData, field of type Object

  • UserData

Width

Width, field of type number

  • Width