way facing vector
way facing vector
ok i want to be able to shoot out a bullet and have the velocity set to go the dirrection i have shot how do i acheve this in irrlicht?
Code: Select all
irr::core::vector3df r = irr::core::vector3df(0,0,velocity);
irr::core::matrix4 m;
m.setRotationDegrees( node->getRotation() );
m.transformVect(r);
node->setPosition( node->getPosition() + r );
then you need to define modification value lets name it acceleration:then in your main loop you change velocity each frame:then you use code above to move object
Code: Select all
irr::core::vector3df acceleration = irr::core::vector3df(0,0,0.5f);
irr::core::vector3df velocity = irr::core::vector3df(0,0,0);
Code: Select all
velocity = velocity + acceleration;