1 | #ifndef __SPU_RAYCAST_TASK_H |
---|
2 | #define __SPU_RAYCAST_TASK_H |
---|
3 | |
---|
4 | #include "BulletCollision/CollisionDispatch/btCollisionObject.h" |
---|
5 | #include "BulletCollision/CollisionDispatch/btCollisionWorld.h" |
---|
6 | #include "LinearMath/btVector3.h" |
---|
7 | #include "../PlatformDefinitions.h" |
---|
8 | |
---|
9 | ATTRIBUTE_ALIGNED16(struct) RaycastGatheredObjectData |
---|
10 | { |
---|
11 | ppu_address_t m_collisionShape; |
---|
12 | void* m_spuCollisionShape; |
---|
13 | btVector3 m_primitiveDimensions; |
---|
14 | int m_shapeType; |
---|
15 | float m_collisionMargin; |
---|
16 | btTransform m_worldTransform; |
---|
17 | }; |
---|
18 | |
---|
19 | |
---|
20 | ATTRIBUTE_ALIGNED16(struct) SpuRaycastTaskWorkUnitOut |
---|
21 | { |
---|
22 | btVector3 hitNormal; /* out */ |
---|
23 | btScalar hitFraction; /* out */ |
---|
24 | btCollisionWorld::LocalShapeInfo shapeInfo; /* out */ |
---|
25 | }; |
---|
26 | |
---|
27 | /* Perform a raycast on collision object */ |
---|
28 | ATTRIBUTE_ALIGNED16(struct) SpuRaycastTaskWorkUnit |
---|
29 | { |
---|
30 | btVector3 rayFrom; /* in */ |
---|
31 | btVector3 rayTo; /* in */ |
---|
32 | SpuRaycastTaskWorkUnitOut* output; /* out */ |
---|
33 | }; |
---|
34 | |
---|
35 | #define SPU_RAYCAST_WORK_UNITS_PER_TASK 16 |
---|
36 | |
---|
37 | ATTRIBUTE_ALIGNED128(struct) SpuRaycastTaskDesc |
---|
38 | { |
---|
39 | SpuRaycastTaskWorkUnit workUnits[SPU_RAYCAST_WORK_UNITS_PER_TASK]; |
---|
40 | unsigned int numWorkUnits; |
---|
41 | void* spuCollisionObjectsWrappers; |
---|
42 | unsigned int numSpuCollisionObjectWrappers; |
---|
43 | int taskId; |
---|
44 | }; |
---|
45 | |
---|
46 | |
---|
47 | void processRaycastTask (void* userPtr, void* lsMemory); |
---|
48 | void* createRaycastLocalStoreMemory (); |
---|
49 | |
---|
50 | #endif |
---|