Are there any more, like, extensive physics tutorials?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Are there any more, like, extensive physics tutorials?
I've had problems with making physics stuff not making things rotate and the tutorial just makes a ball which doesn't solve any problems... just asking
Re: Are there any more, like, extensive physics tutorials?
The physics world just calculates what happens to objects of a certain shape, size, mass, etc. Give it the right variables and it'll give you your outcome.
If you want a ball that will rotate, thats lets say 20 in mass, 50x50 px you'd create a body then a shape to the body, create a sprite in the graphics world, then calculate a physics step, update the spite to the physics body rotation, x, and y. The rest is done for you. Its not that hard, just takes some getting used to.
If you give me a simple example of what you want I can write it up quick and post a .love
this brings me back to my days with ODE and Pygame... I still have nightmares
If you want a ball that will rotate, thats lets say 20 in mass, 50x50 px you'd create a body then a shape to the body, create a sprite in the graphics world, then calculate a physics step, update the spite to the physics body rotation, x, and y. The rest is done for you. Its not that hard, just takes some getting used to.
If you give me a simple example of what you want I can write it up quick and post a .love
this brings me back to my days with ODE and Pygame... I still have nightmares
Re: Are there any more, like, extensive physics tutorials?
But I like, made a rectangle body that was tilted at 45 degrees and when it fell and hit the ground it didn't lean over...
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Are there any more, like, extensive physics tutorials?
How are you drawing the rectangle shape? You should be using shape:getPoints() rather than shape:getBoundingBox().
Re: Are there any more, like, extensive physics tutorials?
I made it draw an image and it showed it rotated at an angle, but the rotation didn't change when it hit the ground.
Also: Would it be a bad idea to set everything's mass to 1? The code this thread was created about (notice I posted it quite a while ago) i got rid of I'm pretty sure but I could recreate it, maybe it'd work then idk
Also: Would it be a bad idea to set everything's mass to 1? The code this thread was created about (notice I posted it quite a while ago) i got rid of I'm pretty sure but I could recreate it, maybe it'd work then idk
-
- Prole
- Posts: 40
- Joined: Wed Aug 03, 2011 3:13 pm
Re: Are there any more, like, extensive physics tutorials?
I'm currently working on an editor for box2D in Love. I'll be releasing the first step very soon and that might help you a lot. The first step is just a parser that parses a data set you give it and handles the creation of all your bodies, shapes, and joints. The next step will be to make an editor that saves to this format I'm working on.
My idea is to group bodies, shapes, and joints into what I'm calling sets. A set is basically a bunch of bodies that work together with joints. Once you have that setup, you can create as many entities of that set that you want. And, you can scale and rotate this entities as will.
I'll have some code examples in a few days.
My idea is to group bodies, shapes, and joints into what I'm calling sets. A set is basically a bunch of bodies that work together with joints. Once you have that setup, you can create as many entities of that set that you want. And, you can scale and rotate this entities as will.
I'll have some code examples in a few days.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests