C# Класс Jitter.Collision.CollisionSystemBrute

O(n^2) Broadphase detection. Every body is checked against each other body. This is pretty fast for scene containing just a few(~30) bodies.
Наследование: CollisionSystem
Показать файл Открыть проект Примеры использования класса

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

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

CollisionSystemBrute ( ) : System

Creates a new instance of the CollisionSystemBrute class.

Detect ( bool multiThreaded ) : void

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

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.

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

Метод Описание
DetectCallback ( object obj ) : void

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

AddEntity() публичный Метод

Add a body to the collision system. Adding a body to the world does automatically add it to the collision system.
public AddEntity ( IBroadphaseEntity body ) : void
body IBroadphaseEntity The body to remove.
Результат void

CollisionSystemBrute() публичный Метод

Creates a new instance of the CollisionSystemBrute class.
public CollisionSystemBrute ( ) : System
Результат System

Detect() публичный Метод

Tells the collisionsystem to check all bodies for collisions. Hook into the CollisionSystem.PassedBroadphase and CollisionSystem.CollisionDetected events to get the results.
public Detect ( bool multiThreaded ) : void
multiThreaded bool If true internal multithreading is used.
Результат void

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 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 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 RemoveEntity ( IBroadphaseEntity body ) : bool
body IBroadphaseEntity The body to remove.
Результат bool