C# Class Duality.Components.Physics.RigidBody

Inheritance: Component, ICmpInitializable, ICmpUpdatable, ICmpEditorUpdatable
Afficher le fichier Open project: BraveSirAndrew/duality Class Usage Examples

Private Properties

Свойство 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

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
OnCopyTo ( Component target, Duality provider ) : void

Private Methods

Méthode 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 méthode

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
Résultat void

AddShape() public méthode

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

ApplyLocalForce() public méthode

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
Résultat void

ApplyLocalForce() public méthode

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
Résultat void

ApplyLocalForce() public méthode

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
Résultat void

ApplyLocalImpulse() public méthode

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
Résultat void

ApplyLocalImpulse() public méthode

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
Résultat void

ApplyLocalImpulse() public méthode

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
Résultat void

ApplyWorldForce() public méthode

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
Résultat void

ApplyWorldForce() public méthode

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
Résultat void

ApplyWorldImpulse() public méthode

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
Résultat void

ApplyWorldImpulse() public méthode

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
Résultat void

AwakeAll() public static méthode

Awakes all currently existing RigidBodies.
public static AwakeAll ( ) : void
Résultat void

AwakeBody() public méthode

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
Résultat void

BeginUpdateBodyShape() public méthode

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

ClearJoints() public méthode

Removes all existing joints from the Collider.
public ClearJoints ( ) : void
Résultat void

ClearShapes() public méthode

Removes all existing shapes from the Collider.
public ClearShapes ( ) : void
Résultat void

EndUpdateBodyShape() public méthode

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

OnCopyTo() protected méthode

protected OnCopyTo ( Component target, Duality provider ) : void
target Component
provider Duality
Résultat void

PickShape() public méthode

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
Résultat Duality.Components.Physics.ShapeInfo

PickShapeGlobal() public static méthode

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
Résultat Duality.Components.Physics.ShapeInfo

PickShapes() public méthode

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

PickShapes() public méthode

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
Résultat List

PickShapesGlobal() public static méthode

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
Résultat List

PickShapesGlobal() public static méthode

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
Résultat List

QueryRectGlobal() public static méthode

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
Résultat List

RayCast() public static méthode

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. ///
Résultat List

RemoveJoint() public méthode

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

RemoveShape() public méthode

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

RigidBody() public méthode

public RigidBody ( ) : System
Résultat System

SynchronizeBodyShape() public méthode

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
Résultat void