C# 클래스 Jitter.Collision.CollisionSystem

CollisionSystem. Used by the world class to detect all collisions. Can be used seperatly from the physics.
파일 보기 프로젝트 열기: tpb3d/TPB3D 1 사용 예제들

공개 메소드들

메소드 설명
AddEntity ( IBroadphaseEntity body ) : void

Add a body to the collision system. Adding a body to the world does automatically add it to the collision system.

CheckBothStaticOrInactive ( IBroadphaseEntity entity1, IBroadphaseEntity entity2 ) : bool

Checks the state of two bodies.

CheckBoundingBoxes ( IBroadphaseEntity entity1, IBroadphaseEntity entity2 ) : bool

Checks the AABB of the two rigid bodies.

CollisionSystem ( ) : System

Initializes a new instance of the CollisionSystem.

Detect ( IBroadphaseEntity entity1, IBroadphaseEntity entity2 ) : void

Checks two bodies for collisions using narrowphase.

Detect ( bool multiThreaded ) : void

Tells the collisionsystem to check all bodies for collisions. Hook into the PassedBroadphase and CollisionDetected events to get the results.

FindNearestTrianglePoint ( SoftBody sb, int id, Jitter.LinearMath.JVector &point ) : int
RaisePassedBroadphase ( IBroadphaseEntity entity1, IBroadphaseEntity entity2 ) : bool

Raises the PassedBroadphase event.

RaisePassedNarrowphase ( RigidBody body1, RigidBody body2, Jitter.LinearMath.JVector &point, Jitter.LinearMath.JVector &normal, float penetration ) : bool

Raises the PassedNarrowphase event.

Raycast ( Jitter.LinearMath.JVector rayOrigin, Jitter.LinearMath.JVector rayDirection, RaycastCallback raycast, RigidBody &body, Jitter.LinearMath.JVector &normal, float &fraction ) : bool

Sends a ray (definied by start and direction) through the scene (all bodies added). NOTE: For performance reasons terrain and trianglemeshshape aren't checked against rays (rays are of infinite length). They are checked against segments which start at rayOrigin and end in rayOrigin + rayDirection.

Raycast ( RigidBody body, Jitter.LinearMath.JVector rayOrigin, Jitter.LinearMath.JVector rayDirection, Jitter.LinearMath.JVector &normal, float &fraction ) : bool

Raycasts a single body. NOTE: For performance reasons terrain and trianglemeshshape aren't checked against rays (rays are of infinite length). They are checked against segments which start at rayOrigin and end in rayOrigin + rayDirection.

RemoveEntity ( IBroadphaseEntity body ) : bool

Remove a body from the collision system. Removing a body from the world does automatically remove it from the collision system.

보호된 메소드들

메소드 설명
RaiseCollisionDetected ( RigidBody body1, RigidBody body2, Jitter.LinearMath.JVector &point1, Jitter.LinearMath.JVector &point2, Jitter.LinearMath.JVector &normal, float penetration ) : void

Raises the CollisionDetected event.

비공개 메소드들

메소드 설명
DetectRigidRigid ( RigidBody body1, RigidBody body2 ) : void
DetectSoftRigid ( RigidBody rigidBody, SoftBody softBody ) : void
DetectSoftSoft ( SoftBody body1, SoftBody body2 ) : void
FindSupportPoints ( RigidBody body1, RigidBody body2, Shape shape1, Shape shape2, Jitter.LinearMath.JVector &point, Jitter.LinearMath.JVector &normal, Jitter.LinearMath.JVector &point1, Jitter.LinearMath.JVector &point2 ) : void
SupportMapping ( RigidBody body, Shape workingShape, Jitter.LinearMath.JVector &direction, Jitter.LinearMath.JVector &result ) : void

메소드 상세

AddEntity() 공개 추상적인 메소드

Add a body to the collision system. Adding a body to the world does automatically add it to the collision system.
public abstract AddEntity ( IBroadphaseEntity body ) : void
body IBroadphaseEntity The body to remove.
리턴 void

CheckBothStaticOrInactive() 공개 메소드

Checks the state of two bodies.
public CheckBothStaticOrInactive ( IBroadphaseEntity entity1, IBroadphaseEntity entity2 ) : bool
entity1 IBroadphaseEntity The first body.
entity2 IBroadphaseEntity The second body.
리턴 bool

CheckBoundingBoxes() 공개 메소드

Checks the AABB of the two rigid bodies.
public CheckBoundingBoxes ( IBroadphaseEntity entity1, IBroadphaseEntity entity2 ) : bool
entity1 IBroadphaseEntity The first body.
entity2 IBroadphaseEntity The second body.
리턴 bool

CollisionSystem() 공개 메소드

Initializes a new instance of the CollisionSystem.
public CollisionSystem ( ) : System
리턴 System

Detect() 공개 메소드

Checks two bodies for collisions using narrowphase.
public Detect ( IBroadphaseEntity entity1, IBroadphaseEntity entity2 ) : void
entity1 IBroadphaseEntity
entity2 IBroadphaseEntity
리턴 void

Detect() 공개 추상적인 메소드

Tells the collisionsystem to check all bodies for collisions. Hook into the PassedBroadphase and CollisionDetected events to get the results.
public abstract Detect ( bool multiThreaded ) : void
multiThreaded bool If true internal multithreading is used.
리턴 void

FindNearestTrianglePoint() 공개 정적인 메소드

public static FindNearestTrianglePoint ( SoftBody sb, int id, Jitter.LinearMath.JVector &point ) : int
sb Jitter.Dynamics.SoftBody
id int
point Jitter.LinearMath.JVector
리턴 int

RaiseCollisionDetected() 보호된 메소드

Raises the CollisionDetected event.
protected RaiseCollisionDetected ( RigidBody body1, RigidBody body2, Jitter.LinearMath.JVector &point1, Jitter.LinearMath.JVector &point2, Jitter.LinearMath.JVector &normal, float penetration ) : void
body1 RigidBody The first body involved in the collision.
body2 RigidBody The second body involved in the collision.
point1 Jitter.LinearMath.JVector
point2 Jitter.LinearMath.JVector
normal Jitter.LinearMath.JVector The normal pointing to body1.
penetration float The penetration depth.
리턴 void

RaisePassedBroadphase() 공개 메소드

Raises the PassedBroadphase event.
public RaisePassedBroadphase ( IBroadphaseEntity entity1, IBroadphaseEntity entity2 ) : bool
entity1 IBroadphaseEntity The first body.
entity2 IBroadphaseEntity The second body.
리턴 bool

RaisePassedNarrowphase() 공개 메소드

Raises the PassedNarrowphase event.
public RaisePassedNarrowphase ( RigidBody body1, RigidBody body2, Jitter.LinearMath.JVector &point, Jitter.LinearMath.JVector &normal, float penetration ) : bool
body1 RigidBody The first body.
body2 RigidBody The second body.
point Jitter.LinearMath.JVector
normal Jitter.LinearMath.JVector
penetration float
리턴 bool

Raycast() 공개 추상적인 메소드

Sends a ray (definied by start and direction) through the scene (all bodies added). NOTE: For performance reasons terrain and trianglemeshshape aren't checked against rays (rays are of infinite length). They are checked against segments which start at rayOrigin and end in rayOrigin + rayDirection.
public abstract Raycast ( Jitter.LinearMath.JVector rayOrigin, Jitter.LinearMath.JVector rayDirection, RaycastCallback raycast, RigidBody &body, Jitter.LinearMath.JVector &normal, float &fraction ) : bool
rayOrigin Jitter.LinearMath.JVector
rayDirection Jitter.LinearMath.JVector
raycast RaycastCallback
body RigidBody
normal Jitter.LinearMath.JVector
fraction float
리턴 bool

Raycast() 공개 추상적인 메소드

Raycasts a single body. NOTE: For performance reasons terrain and trianglemeshshape aren't checked against rays (rays are of infinite length). They are checked against segments which start at rayOrigin and end in rayOrigin + rayDirection.
public abstract Raycast ( RigidBody body, Jitter.LinearMath.JVector rayOrigin, Jitter.LinearMath.JVector rayDirection, Jitter.LinearMath.JVector &normal, float &fraction ) : bool
body RigidBody
rayOrigin Jitter.LinearMath.JVector
rayDirection Jitter.LinearMath.JVector
normal Jitter.LinearMath.JVector
fraction float
리턴 bool

RemoveEntity() 공개 추상적인 메소드

Remove a body from the collision system. Removing a body from the world does automatically remove it from the collision system.
public abstract RemoveEntity ( IBroadphaseEntity body ) : bool
body IBroadphaseEntity The body to remove.
리턴 bool