Linear velocity
2 posters
Linear velocity
I have a shooting game of bow and arrow. I want to move the arrow with some velocity in the direction it is pointed. I have accomplished it in the
following way:
Using 1 & 2 I determine the direction of the vector , normalize it and then apply velocity. However the result is not satisfactory. Considering
arrow is a long object ( not like a sphere), is there any other method to move it in the desired direction with the tip of the arrow pointing in the
desired direction?
Thank you.
Cheers,
Rahul.
following way:
- Code:
vec3 tip = {0.989,1.229,5.083}; //1. Tip of the arrow
vec3 centre = {3.146,-1.254,3.043}; //2. Centre Location of the arrow
vec3 result;
sio2Vec3Diff(&tip, ¢re, &result);
sio2Normalize(&result, &result);
_SIO2Spear->_btRigidBody->setLinearVelocity(( btVector3( result.x*40.0, result.y*40.0, result.z*40.0) ));
Using 1 & 2 I determine the direction of the vector , normalize it and then apply velocity. However the result is not satisfactory. Considering
arrow is a long object ( not like a sphere), is there any other method to move it in the desired direction with the tip of the arrow pointing in the
desired direction?
Thank you.
Cheers,
Rahul.
Rahul- Posts : 1
Join date : 2009-06-01
Re: Linear velocity
Check sio2rotate3d this will allow you to calculate a forward vector sound an arc.
Permissions in this forum:
You cannot reply to topics in this forum
|
|