Sign in to follow this  

Precalculated ball physics system

This topic is 4305 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I know this sounds like it shoud be in the maths/physics forum, but I'm interested in the design of the system rather than the actual physics. Basically I'm creating a billiards game, and due to the limited processing power available (im making it on a mobile phone, hence I'm using java) I want to precalculate all the physics so that the calculations don't have to be done at run time (i.e. when the balls are moving). My problem is how/where do I store the precalculated data, and how do I use the data for the shot? I figure I need some kind of event class that can store event information such as ball-ball collision, movement vector after collision, time of event etc. Now, should the balls store their own list of events, and react to them when they update? or should there be a seperate class that stores all the events and sends messages to the balls when an event occurs? Is there another way to do it? Do you know which system would be more efficient/accurate? I heard that Jimmy White's snooker precalculated all the physics, which is where i got the idea from. Does anyone know how it was done in that game? And are there any articles on creating such a system? Thanks in advance.

Share this post


Link to post
Share on other sites
So, your precalculated physics creates a script for each ball. That seems like a good idea. Now the question is how do you execute the scripts? Does each ball update its motion each frame according to its script, or does each ball continue its current motion until it gets a message telling it to change. Either way will probably work and I can't think of any obvious reason to choose one over the other. I would probably choose the former because I am not a big fan of message systems.

Share this post


Link to post
Share on other sites
thanks for the reply JB. I havn't had time to try to implement this yet, since I've been working on other things (mobile development is a bit of a minefield, but thats another story), if I do eventually manage to get time to do this I'll post here with some info on how I did it and how well it turned out.

Unlesss someone has anything else to add? ;)

Share this post


Link to post
Share on other sites

This topic is 4305 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this