Ball in a loopy track

nikhil

29-10-2006 23:18:05

Hi all..

The prolem i'm having is that i've a circular track, and theres a ball in it.. i'm supposed to have the ball in constant motion.. I'm using Newton and can apply a force to it at all the times..

The problem is that the track is a loop and goes in many direction, so I cann't just apply a force in one direction.. moreover the ball at no point should traverse the path in the opposite direction.. like in Car races.. the cars only move in one direction to finish the laps..

What adds to the complexity is the fact that the ball can bounce and it should not fall of the tracks edges.. The track has walls.. so I'm supposed to be limiting the amount of bounce too..

For now.. can any one help how to get the ball moving along the track.. The bounce stuff may be i can figure out laters..


Thanks
Nikhil

nikhil

30-10-2006 03:57:22

Is there anyway to've some kind of 'ray' jumping out of the ball, which i can then use to detect an upcoming collision.

I'm looking for a ray that tells me how far up the ball is from the tracks ground. So I can control the height it can bounce to..


Thanks Nik

walaber

30-10-2006 05:08:40

you can use the Raycast class to cast a ray, and see what RigidBody's it hits... you can see it used in any of the demos that implement dragging objects around.

nikhil

30-10-2006 07:33:05

you can use the Raycast class to cast a ray, and see what RigidBody's it hits... you can see it used in any of the demos that implement dragging objects around.

Can I also get the points of intersection of the ray with the rigid bodies? I tried giving the ray casting demo a look, but, ummm.. couldn't figure out much :shock: . I'm going to give it a more serious look again and get on the forums with specific parts I'm not able to make out.

Oh! Lastly did you mean, I should try using the "BasicRaycast" or implement the "Raycast" on my own.

Thanks

nik..

nikhil

30-10-2006 13:22:00

After looking through the First Person Camera with Ogrenewt -> SOLUTION post, i was able to implement RayCast with OgreNewt.. So I'm able to limit the height of the ball from the track.

But I'm still left with figuring out, how to give it a perpetual motion of its own???

You can've a look at the track here


thnks
nik