Sign in to follow this  

Creating an object class I think i need help

This topic is 3730 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, I'm creating my Objects class in my Physics Simulation 'game' I've been working on; however, I'm having a hard trouble creating the well abstract class Object. This class is suppose to give me the freedom of having any object I want easily created on the screen, and apply either an image, or shape to it depending on what that object is for the game. What I do know about what I want in this Object class is the following -the x,y vectors -width and height of images/shape -mass -object velocity/acceleration depending on other independent stuff in game -objects forces -image/shape depending on what i would want it to be. Do i not need it? and so far that is it, if you could add anything please let me know. I know saying force is very vague but I'm going to have force in 2d dimensions, velocity, projectile velocity, centripetal force if any, and just keep working on it as I chug a long in my physics class. So my question is would you just create an objects class with all things that could be equal and create some type of image structure, array, etc... that would apply to that class object only when you wanted it to? I'm having a hard time visualizing it with an image, and I'm also thinking it will be a pain creating the class without any variable for image, or drawshape. I am confused... please help!

Share this post


Link to post
Share on other sites
I get the impression that you're not familiar at all with calculus-based physics. In which case you're pretty much boned with respect to coding any kind of physics simulation. I'm sure you could muddle around a bit with the derived formulas that they feed you in high school physics, but you probably won't get very far.

Quote:
I know saying force is very vague but I'm going to have force in 2d dimensions, velocity, projectile velocity, centripetal force if any,

Any constant force is easily represented with just a vector. And a velocity is not a force.

Share this post


Link to post
Share on other sites
Quote:
Original post by drakostar
I get the impression that you're not familiar at all with calculus-based physics. In which case you're pretty much boned with respect to coding any kind of physics simulation. I'm sure you could muddle around a bit with the derived formulas that they feed you in high school physics, but you probably won't get very far.

Quote:
I know saying force is very vague but I'm going to have force in 2d dimensions, velocity, projectile velocity, centripetal force if any,

Any constant force is easily represented with just a vector. And a velocity is not a force.


I believe I'm in Calc based physics right now. Yes, I mis quoted myself, sorry. This is a capitalist society so you could sue me if you wanted. Or, you could be nice, and just help me.

Plus, what level of mathematics would I need to know, so I don't go over my head here? Huh, huh, huh?

Share this post


Link to post
Share on other sites
I was being honest. So sorry if that offends you.

Can you do cross and dot products? Does this (a = dv/dt, v = ds/dt) look familiar?

If you answer yes to those questions, then you're decently well positioned to do some kind of basic physics simulation. But I'd cut out the idea of using images for objects, for now. Keep it to squares or circles for easy collision detection.

Share this post


Link to post
Share on other sites
Quote:
Original post by drakostar
I was being honest. So sorry if that offends you.

Can you do cross and dot products? Does this (a = dv/dt, v = ds/dt) look familiar?

If you answer yes to those questions, then you're decently well positioned to do some kind of basic physics simulation. But I'd cut out the idea of using images for objects, for now. Keep it to squares or circles for easy collision detection.


yes, i'm taking as of now Calculus 3, and that chapter was a breeze. and derivative of a vector = velocity, and derivative of that velocity = acceleration and magnitude of that velocity = speed. Would that be correct?

Oh and you could integrate acceleration to get velocity, and integrate velocity to get the object's actual position.

yes, I am familiar with this stuff I believe.

Share this post


Link to post
Share on other sites

This topic is 3730 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