C# Class Duality.Components.Physics.RigidBody

Inheritance: Component, ICmpInitializable, ICmpUpdatable, ICmpEditorUpdatable
Datei anzeigen Open project: BraveSirAndrew/duality Class Usage Examples

Private Properties

Property Type Description
CheckValidTransform void
CleanupBody void
CleanupJoints void
FlagBodyShape bool
ICmpEditorUpdatable void
ICmpInitializable void
ICmpInitializable void
ICmpUpdatable void
InitBody void
Initialize void
NotifyCollisionBegin void
NotifyCollisionEnd void
NotifyCollisionSolve void
OnTransformChanged void
ProcessCollisionEvents void
ProcessSingleCollisionEvent void
Raycast_DefaultCallback float
RemoveDisposedJoints void
SetFarseerBodyType void
SetJoints void
SetShapes void
Shutdown void
UpdateBodyMass void
UpdateBodyShape void
body_OnCollision bool
body_OnSeparation void
body_PostSolve void

Public Methods

Method Description
AddJoint ( Duality.Components.Physics.JointInfo joint, RigidBody other = null ) : void

Adds a new joint to the Collider

AddShape ( Duality.Components.Physics.ShapeInfo shape ) : void

Adds a new shape to the Collider

ApplyLocalForce ( System.Vector2 force ) : void

Applies a Transform-local force to the objects mass center. You don't need to apply Time.TimeMult here, the physics simulation takes care of this.

ApplyLocalForce ( System.Vector2 force, System.Vector2 applyAt ) : void

Applies a Transform-local force to the specified local point. You don't need to apply Time.TimeMult here, the physics simulation takes care of this.

ApplyLocalForce ( float angularForce ) : void

Applies a Transform-local angular force to the object. You don't need to apply Time.TimeMult here, the physics simulation takes care of this.

ApplyLocalImpulse ( System.Vector2 impulse ) : void

Applies a Transform-local impulse to the objects mass center. You don't usually need to apply Time.TimeMult here because it is inteded to be a one-time force impact.

ApplyLocalImpulse ( System.Vector2 impulse, System.Vector2 applyAt ) : void

Applies a Transform-local impulse to the specified point. You don't usually need to apply Time.TimeMult here because it is inteded to be a one-time force impact.

ApplyLocalImpulse ( float angularImpulse ) : void

Applies a Transform-local angular impulse to the object. You don't usually need to apply Time.TimeMult here because it is inteded to be a one-time force impact.

ApplyWorldForce ( System.Vector2 force ) : void

Applies a world force to the objects mass center. You don't need to apply Time.TimeMult here, the physics simulation takes care of this.

ApplyWorldForce ( System.Vector2 force, System.Vector2 applyAt ) : void

Applies a world force to the specified world point. You don't need to apply Time.TimeMult here, the physics simulation takes care of this.

ApplyWorldImpulse ( System.Vector2 impulse ) : void

Applies a world impulse to the objects mass center. You don't usually need to apply Time.TimeMult here because it is inteded to be a one-time force impact.

ApplyWorldImpulse ( System.Vector2 impulse, System.Vector2 applyAt ) : void

Applies a world impulse to the specified world point. You don't usually need to apply Time.TimeMult here because it is inteded to be a one-time force impact.

AwakeAll ( ) : void

Awakes all currently existing RigidBodies.

AwakeBody ( ) : void

Awakes the body if it has been in a resting state that is now being left, such as when changing physical properties at runtime. You usually don't need to call this.

BeginUpdateBodyShape ( ) : void

Prepares this RigidBody for a large-scale shape update. This isn't required but might boost update performance.

ClearJoints ( ) : void

Removes all existing joints from the Collider.

ClearShapes ( ) : void

Removes all existing shapes from the Collider.

EndUpdateBodyShape ( ) : void

Restores this RigidBody after a large-scale shape update. See BeginUpdateBodyShape.

PickShape ( System.Vector2 worldCoord ) : Duality.Components.Physics.ShapeInfo

Performs a physical picking operation and returns the shape in which the specified world coordinate is located in.

PickShapeGlobal ( System.Vector2 worldCoord ) : Duality.Components.Physics.ShapeInfo

Performs a global physical picking operation and returns the shape in which the specified world coordinate is located in.

PickShapes ( System.Vector2 worldCoord ) : List

Performs a physical picking operation and returns the shapes that intersect the specified world coordinate.

PickShapes ( System.Vector2 worldCoord, System.Vector2 size ) : List

Performs a physical picking operation and returns the shapes that intersect the specified world coordinate area.

PickShapesGlobal ( System.Vector2 worldCoord ) : List

Performs a global physical picking operation and returns the shapes that intersect the specified world coordinate.

PickShapesGlobal ( System.Vector2 worldCoord, System.Vector2 size ) : List

Performs a global physical picking operation and returns the shapes that intersect the specified world coordinate area.

QueryRectGlobal ( System.Vector2 worldCoord, System.Vector2 size ) : List

Performs a global physical AABB query and returns the bodies that might be roughly contained or intersected by the specified region.

RayCast ( System.Vector2 worldCoordA, System.Vector2 worldCoordB, RayCastCallback callback = null ) : List

Performs a 2d physical raycast in world coordinates.

RemoveJoint ( Duality.Components.Physics.JointInfo joint ) : void

Removes an existing joint from the Collider.

RemoveShape ( Duality.Components.Physics.ShapeInfo shape ) : void

Removes an existing shape from the Collider.

RigidBody ( ) : System
SynchronizeBodyShape ( ) : void

Forces previously scheduled body shape updates to execute. Changes to a RigidBodies shape are normally cached and executed in the following frame. Calling this method guarantes all scheduled updates to be performed immediately.

Protected Methods

Method Description
OnCopyTo ( Component target, Duality provider ) : void

Private Methods

Method Description
CheckValidTransform ( ) : void
CleanupBody ( ) : void
CleanupJoints ( ) : void
FlagBodyShape ( ) : bool
ICmpEditorUpdatable ( ) : void
ICmpInitializable ( InitContext context ) : void
ICmpInitializable ( ShutdownContext context ) : void
ICmpUpdatable ( ) : void
InitBody ( ) : void
Initialize ( ) : void
NotifyCollisionBegin ( CollisionEventArgs args ) : void
NotifyCollisionEnd ( CollisionEventArgs args ) : void
NotifyCollisionSolve ( CollisionEventArgs args ) : void
OnTransformChanged ( object sender, TransformChangedEventArgs e ) : void
ProcessCollisionEvents ( ) : void
ProcessSingleCollisionEvent ( ColEvent colEvent ) : void
Raycast_DefaultCallback ( RayCastData data ) : float
RemoveDisposedJoints ( ) : void
SetFarseerBodyType ( BodyType value ) : void
SetJoints ( IEnumerable joints ) : void
SetShapes ( IEnumerable shapes ) : void
Shutdown ( ) : void
UpdateBodyMass ( ) : void
UpdateBodyShape ( ) : void
body_OnCollision ( Fixture fixtureA, Fixture fixtureB, Contact contact ) : bool
body_OnSeparation ( Fixture fixtureA, Fixture fixtureB ) : void
body_PostSolve ( Contact contact, ContactConstraint impulse ) : void

Method Details

AddJoint() public method

Adds a new joint to the Collider
public AddJoint ( Duality.Components.Physics.JointInfo joint, RigidBody other = null ) : void
joint Duality.Components.Physics.JointInfo
other RigidBody
return void

AddShape() public method

Adds a new shape to the Collider
public AddShape ( Duality.Components.Physics.ShapeInfo shape ) : void
shape Duality.Components.Physics.ShapeInfo
return void

ApplyLocalForce() public method

Applies a Transform-local force to the objects mass center. You don't need to apply Time.TimeMult here, the physics simulation takes care of this.
public ApplyLocalForce ( System.Vector2 force ) : void
force System.Vector2
return void

ApplyLocalForce() public method

Applies a Transform-local force to the specified local point. You don't need to apply Time.TimeMult here, the physics simulation takes care of this.
public ApplyLocalForce ( System.Vector2 force, System.Vector2 applyAt ) : void
force System.Vector2
applyAt System.Vector2
return void

ApplyLocalForce() public method

Applies a Transform-local angular force to the object. You don't need to apply Time.TimeMult here, the physics simulation takes care of this.
public ApplyLocalForce ( float angularForce ) : void
angularForce float
return void

ApplyLocalImpulse() public method

Applies a Transform-local impulse to the objects mass center. You don't usually need to apply Time.TimeMult here because it is inteded to be a one-time force impact.
public ApplyLocalImpulse ( System.Vector2 impulse ) : void
impulse System.Vector2
return void

ApplyLocalImpulse() public method

Applies a Transform-local impulse to the specified point. You don't usually need to apply Time.TimeMult here because it is inteded to be a one-time force impact.
public ApplyLocalImpulse ( System.Vector2 impulse, System.Vector2 applyAt ) : void
impulse System.Vector2
applyAt System.Vector2
return void

ApplyLocalImpulse() public method

Applies a Transform-local angular impulse to the object. You don't usually need to apply Time.TimeMult here because it is inteded to be a one-time force impact.
public ApplyLocalImpulse ( float angularImpulse ) : void
angularImpulse float
return void

ApplyWorldForce() public method

Applies a world force to the objects mass center. You don't need to apply Time.TimeMult here, the physics simulation takes care of this.
public ApplyWorldForce ( System.Vector2 force ) : void
force System.Vector2
return void

ApplyWorldForce() public method

Applies a world force to the specified world point. You don't need to apply Time.TimeMult here, the physics simulation takes care of this.
public ApplyWorldForce ( System.Vector2 force, System.Vector2 applyAt ) : void
force System.Vector2
applyAt System.Vector2
return void

ApplyWorldImpulse() public method

Applies a world impulse to the objects mass center. You don't usually need to apply Time.TimeMult here because it is inteded to be a one-time force impact.
public ApplyWorldImpulse ( System.Vector2 impulse ) : void
impulse System.Vector2
return void

ApplyWorldImpulse() public method

Applies a world impulse to the specified world point. You don't usually need to apply Time.TimeMult here because it is inteded to be a one-time force impact.
public ApplyWorldImpulse ( System.Vector2 impulse, System.Vector2 applyAt ) : void
impulse System.Vector2
applyAt System.Vector2
return void

AwakeAll() public static method

Awakes all currently existing RigidBodies.
public static AwakeAll ( ) : void
return void

AwakeBody() public method

Awakes the body if it has been in a resting state that is now being left, such as when changing physical properties at runtime. You usually don't need to call this.
public AwakeBody ( ) : void
return void

BeginUpdateBodyShape() public method

Prepares this RigidBody for a large-scale shape update. This isn't required but might boost update performance.
public BeginUpdateBodyShape ( ) : void
return void

ClearJoints() public method

Removes all existing joints from the Collider.
public ClearJoints ( ) : void
return void

ClearShapes() public method

Removes all existing shapes from the Collider.
public ClearShapes ( ) : void
return void

EndUpdateBodyShape() public method

Restores this RigidBody after a large-scale shape update. See BeginUpdateBodyShape.
public EndUpdateBodyShape ( ) : void
return void

OnCopyTo() protected method

protected OnCopyTo ( Component target, Duality provider ) : void
target Component
provider Duality
return void

PickShape() public method

Performs a physical picking operation and returns the shape in which the specified world coordinate is located in.
public PickShape ( System.Vector2 worldCoord ) : Duality.Components.Physics.ShapeInfo
worldCoord System.Vector2
return Duality.Components.Physics.ShapeInfo

PickShapeGlobal() public static method

Performs a global physical picking operation and returns the shape in which the specified world coordinate is located in.
public static PickShapeGlobal ( System.Vector2 worldCoord ) : Duality.Components.Physics.ShapeInfo
worldCoord System.Vector2
return Duality.Components.Physics.ShapeInfo

PickShapes() public method

Performs a physical picking operation and returns the shapes that intersect the specified world coordinate.
public PickShapes ( System.Vector2 worldCoord ) : List
worldCoord System.Vector2
return List

PickShapes() public method

Performs a physical picking operation and returns the shapes that intersect the specified world coordinate area.
public PickShapes ( System.Vector2 worldCoord, System.Vector2 size ) : List
worldCoord System.Vector2
size System.Vector2
return List

PickShapesGlobal() public static method

Performs a global physical picking operation and returns the shapes that intersect the specified world coordinate.
public static PickShapesGlobal ( System.Vector2 worldCoord ) : List
worldCoord System.Vector2
return List

PickShapesGlobal() public static method

Performs a global physical picking operation and returns the shapes that intersect the specified world coordinate area.
public static PickShapesGlobal ( System.Vector2 worldCoord, System.Vector2 size ) : List
worldCoord System.Vector2
size System.Vector2
return List

QueryRectGlobal() public static method

Performs a global physical AABB query and returns the bodies that might be roughly contained or intersected by the specified region.
public static QueryRectGlobal ( System.Vector2 worldCoord, System.Vector2 size ) : List
worldCoord System.Vector2
size System.Vector2
return List

RayCast() public static method

Performs a 2d physical raycast in world coordinates.
public static RayCast ( System.Vector2 worldCoordA, System.Vector2 worldCoordB, RayCastCallback callback = null ) : List
worldCoordA System.Vector2 The starting point.
worldCoordB System.Vector2 The desired end point.
callback RayCastCallback /// The callback that is invoked for each hit on the raycast. Note that the order in which each hit occurs isn't deterministic /// and may appear random. Return -1 to ignore the curret shape, 0 to terminate the raycast, data.Fraction to clip the ray for current hit, or 1 to continue. ///
return List

RemoveJoint() public method

Removes an existing joint from the Collider.
public RemoveJoint ( Duality.Components.Physics.JointInfo joint ) : void
joint Duality.Components.Physics.JointInfo
return void

RemoveShape() public method

Removes an existing shape from the Collider.
public RemoveShape ( Duality.Components.Physics.ShapeInfo shape ) : void
shape Duality.Components.Physics.ShapeInfo
return void

RigidBody() public method

public RigidBody ( ) : System
return System

SynchronizeBodyShape() public method

Forces previously scheduled body shape updates to execute. Changes to a RigidBodies shape are normally cached and executed in the following frame. Calling this method guarantes all scheduled updates to be performed immediately.
public SynchronizeBodyShape ( ) : void
return void