need help with basic physics / vectors.
Posted: Sat Jul 14, 2007 7:52 am
Hi, I have worked through most of the examples and I'm now trying to add a little more to them [C#].
I can make an object, move it around the map, rotate it etc. What I would now like to do is actually give it a velocity. ie kick a ball.
So my question is how do i get the get the scenemanager to keep drawing the position based on a velocity (ie push one button then keep the ball moving) cos at the moment I have to hold the button down.
I am basically hacking example 4 at the moment. i would like to basically build a billiards type game eventually.
I am a physics graduate, so i have the physics and maths concepts. I am trying to learn the programing concepts.
I have tried things like;
node.position.X = node.position.X + vel * time
where vel is just some velocity i define.
but i cant get hold of the timer in the eventhandler.
and it doesn't let me multiply node.position.X with a float (or int etc).
and even if I could get that to work, I don't want to just draw the ball once in its new calculated position, I want ts position to be continually updated after receiving only one event.
any help or direction on where to get it would be appreciated.
I can make an object, move it around the map, rotate it etc. What I would now like to do is actually give it a velocity. ie kick a ball.
So my question is how do i get the get the scenemanager to keep drawing the position based on a velocity (ie push one button then keep the ball moving) cos at the moment I have to hold the button down.
I am basically hacking example 4 at the moment. i would like to basically build a billiards type game eventually.
I am a physics graduate, so i have the physics and maths concepts. I am trying to learn the programing concepts.
I have tried things like;
node.position.X = node.position.X + vel * time
where vel is just some velocity i define.
but i cant get hold of the timer in the eventhandler.
and it doesn't let me multiply node.position.X with a float (or int etc).
and even if I could get that to work, I don't want to just draw the ball once in its new calculated position, I want ts position to be continually updated after receiving only one event.
any help or direction on where to get it would be appreciated.