collision detection of rotated vertex_buffer
#1 Members - Reputation: 210
Posted 08 October 2012 - 03:21 PM
i can transform it and rotate/scale etc with DirectXAPI.
But if i want to perform calculations for my collision detection i need the transformed vertex points in my vertex_buffer.
is there a way i can copy back a transformed vertex_buffer so i can test all my triangles for collision detection.
Or should i perform transformation on my vertexbuffer before i copy them for rendering?
#2 Members - Reputation: 11
Posted 08 October 2012 - 08:08 PM
Edited by ___, 08 October 2012 - 08:09 PM.
https://sites.google.com/site/imoomohomozumo/
#3 Members - Reputation: 210
Posted 09 October 2012 - 01:26 AM
It is in the way you say with my level. i want lots of parts of my level to roate and go from different positions. Kind of like Uncharted game when the floor gives in and the player slides down.
i think the best way for me would be to transform my vertex array before i copy it to the buffer. that way i always have the updated array.
But it feels not good doing this because all my rotations is made by the CPU right?
can i user D3DXMatrixRotate.. on a vertex-struct array?
It would be great if i could use the DirectX API as usual for transforming my verticies...
#4 Members - Reputation: 3700
Posted 09 October 2012 - 02:59 AM
The voices in my head may not be real, but they have some good ideas!
#5 GDNet+ - Reputation: 1731
Posted 10 October 2012 - 01:01 AM
I bet this floor is not part of the level. It's likely an entity which gets drawn very similarly to the level.Kind of like Uncharted game when the floor gives in and the player slides down.
In Bullet, your level would be a shape. From that, we would create a rigidbody using that shape, and the rigidbody would apply a transformation to the shape. This is the established way to approach this problem and I'm inclined to think it is the best way.i think the best way for me would be to transform my vertex array before i copy it to the buffer. that way i always have the updated array.
#6 Members - Reputation: 267
Posted 10 October 2012 - 05:58 AM
I bet this floor is not part of the level. It's likely an entity which gets drawn very similarly to the level.
Kind of like Uncharted game when the floor gives in and the player slides down.In Bullet, your level would be a shape. From that, we would create a rigidbody using that shape, and the rigidbody would apply a transformation to the shape. This is the established way to approach this problem and I'm inclined to think it is the best way.i think the best way for me would be to transform my vertex array before i copy it to the buffer. that way i always have the updated array.
do you have a sample of that with directx and bullet?
#7 GDNet+ - Reputation: 1731
Posted 10 October 2012 - 07:23 AM
People using this approach would likely start from btBvhTriangleMeshShape.
Personally I am not a big fan of using a single shape for the whole world so no, I don't have that code available myself. There's a library example however.
Keep in mind that the concept applies to all other shapes as well, let them be a box or a sphere.
#8 Members - Reputation: 210
Posted 10 October 2012 - 07:43 AM
so i think it is best to combine my "graphics-level" and "physics-level" in one.
I might build a muuuch more simple mesh in blender that will represent collision forms only.
But i almost only have boxes and simple shapes so the triangle count is very low.






