C# Класс Duality.Components.Physics.RigidBody

Наследование: Component, ICmpInitializable, ICmpUpdatable, ICmpEditorUpdatable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
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

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
OnCopyTo ( Component target, Duality provider ) : void

Приватные методы

Метод Описание
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

Описание методов

AddJoint() публичный метод

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
Результат void

AddShape() публичный метод

Adds a new shape to the Collider
public AddShape ( Duality.Components.Physics.ShapeInfo shape ) : void
shape Duality.Components.Physics.ShapeInfo
Результат void

ApplyLocalForce() публичный метод

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
Результат void

ApplyLocalForce() публичный метод

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
Результат void

ApplyLocalForce() публичный метод

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
Результат void

ApplyLocalImpulse() публичный метод

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
Результат void

ApplyLocalImpulse() публичный метод

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
Результат void

ApplyLocalImpulse() публичный метод

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
Результат void

ApplyWorldForce() публичный метод

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
Результат void

ApplyWorldForce() публичный метод

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
Результат void

ApplyWorldImpulse() публичный метод

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
Результат void

ApplyWorldImpulse() публичный метод

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
Результат void

AwakeAll() публичный статический метод

Awakes all currently existing RigidBodies.
public static AwakeAll ( ) : void
Результат void

AwakeBody() публичный метод

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
Результат void

BeginUpdateBodyShape() публичный метод

Prepares this RigidBody for a large-scale shape update. This isn't required but might boost update performance.
public BeginUpdateBodyShape ( ) : void
Результат void

ClearJoints() публичный метод

Removes all existing joints from the Collider.
public ClearJoints ( ) : void
Результат void

ClearShapes() публичный метод

Removes all existing shapes from the Collider.
public ClearShapes ( ) : void
Результат void

EndUpdateBodyShape() публичный метод

Restores this RigidBody after a large-scale shape update. See BeginUpdateBodyShape.
public EndUpdateBodyShape ( ) : void
Результат void

OnCopyTo() защищенный метод

protected OnCopyTo ( Component target, Duality provider ) : void
target Component
provider Duality
Результат void

PickShape() публичный метод

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
Результат Duality.Components.Physics.ShapeInfo

PickShapeGlobal() публичный статический метод

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
Результат Duality.Components.Physics.ShapeInfo

PickShapes() публичный метод

Performs a physical picking operation and returns the shapes that intersect the specified world coordinate.
public PickShapes ( System.Vector2 worldCoord ) : List
worldCoord System.Vector2
Результат List

PickShapes() публичный метод

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
Результат List

PickShapesGlobal() публичный статический метод

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
Результат List

PickShapesGlobal() публичный статический метод

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
Результат List

QueryRectGlobal() публичный статический метод

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
Результат List

RayCast() публичный статический метод

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. ///
Результат List

RemoveJoint() публичный метод

Removes an existing joint from the Collider.
public RemoveJoint ( Duality.Components.Physics.JointInfo joint ) : void
joint Duality.Components.Physics.JointInfo
Результат void

RemoveShape() публичный метод

Removes an existing shape from the Collider.
public RemoveShape ( Duality.Components.Physics.ShapeInfo shape ) : void
shape Duality.Components.Physics.ShapeInfo
Результат void

RigidBody() публичный метод

public RigidBody ( ) : System
Результат System

SynchronizeBodyShape() публичный метод

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
Результат void