Creating a rigidBody at a point in camera space?
Posted: Thu Mar 09, 2017 10:11 pm
Hi, I can currently create a rigidBody at world space position (given a specific x, y and z).
This works fine if my bullet model is just randomly placed in the scene, but I'm now attempting to fire bullets from the end of my gun (which is attached to the gun by removing the viewMatrix multiplication in my MVP uniform, so I'm doing the same for my bullets since they need to come from the gun which can be facing any direction).
Is there a way to create a rigidBody in camera space, then move my bullet to that location?
Or maybe it's best to somehow draw the bullet in camera space, but as you move away, it remains there in world space, then simply take it's position?
I'm unsure how to approach this, so any help is appreciated. Thanks.
This works fine if my bullet model is just randomly placed in the scene, but I'm now attempting to fire bullets from the end of my gun (which is attached to the gun by removing the viewMatrix multiplication in my MVP uniform, so I'm doing the same for my bullets since they need to come from the gun which can be facing any direction).
Is there a way to create a rigidBody in camera space, then move my bullet to that location?
Or maybe it's best to somehow draw the bullet in camera space, but as you move away, it remains there in world space, then simply take it's position?
I'm unsure how to approach this, so any help is appreciated. Thanks.