Wednesday, February 20, 2013

Plasma gun

No screen today, only a little note.
Yesterday I've replaced static laser canon with a plasma gun. Technically you can imagine it as standard spaceship weapon in Star Wars series. It requires quite more of CPU cycles, but I think the result is worth it. Collisions in 3D can really be pain in the ass, fortunately I'm using XNA math library for vectors, matrices, etc. Is has this set of functions in xnacollision.h like:
BOOL IntersectRayTriangle( FXMVECTOR Origin, FXMVECTOR Direction, FXMVECTOR V0, CXMVECTOR V1, CXMVECTOR V2, FLOAT* pDist );
So collision detection is quite simple with this. When I finally sit down and force myself to write instancing and frustum culling every model will have its own bounding volume which make collision detections even simpler and faster.

No comments:

Post a Comment