Physics stuff

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Physics stuff

Post by Tesselode »

OK, so I want to have a platform that isn't affected by gravity or other objects that can be rotated and can push a ball around. I tried using a static object for the platform and using body:setAngle, but then the ball can get stuck in or go through the platform and the platform doesn't apply any force to the ball. How do you think I should do this?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Physics stuff

Post by Robin »

I think you should use Joints for that. Not sure how. (I don't have that much experience with Joints.)
Help us help you: attach a .love.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Physics stuff

Post by kikito »

Tesselode wrote:A platform that isn't affected by gravity or other objects that can be rotated and can push a ball around
I'd really like to help you, but you need to be more specific. If the platform isn't supposed to affect other objects, how is it going to affect a ball, which is another object?

You mention that you want to change the angle of the platform. Do you need it to spin around a corner, or around its center of mass? What's its shape? Where is it in relation to the ground?

If you don't feel like answering all this, a simple image (i.e. ms paint) would suffice.

But yeah, almost certainly you will want to use a revoluteJoint.
When I write def I mean function.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Physics stuff

Post by Robin »

Now that I think of it, LovelyBigPlanet has “floating platforms”, which have a very high level of friction, but are not static. Probably not what you're looking for, though.
Help us help you: attach a .love.
User avatar
rhezalouis
Party member
Posts: 100
Joined: Mon Dec 07, 2009 10:27 am
Location: Indonesia
Contact:

[Response]CMIIW

Post by rhezalouis »

Something like this?
screenCapture
screenCapture
rotatingPlatform.png (2.28 KiB) Viewed 2849 times
Attachments
rotatingPlatform.love
LOVE0.6.2
(662 Bytes) Downloaded 73 times
Aargh, I am wasting my posts! My citizenshiiiip... :o
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Physics stuff

Post by Robin »

That.
Help us help you: attach a .love.
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: Physics stuff

Post by Tesselode »

Pretty much, except the ball shouldn't be able to push the platform. I think that today I'll post what I had that was sort of working.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Physics stuff

Post by Robin »

Tesselode wrote:except the ball shouldn't be able to push the platform.
Then you need to make the platform super heavy.
Help us help you: attach a .love.
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: Physics stuff

Post by Tesselode »

Robin wrote:
Tesselode wrote:except the ball shouldn't be able to push the platform.
Then you need to make the platform super heavy.
Well, that would just lessen the problem, not fix it.

Is there a way to do this with a static body for the platform?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Physics stuff

Post by Robin »

Tesselode wrote:Is there a way to do this with a static body for the platform?
Well, there's the rub: if it is static, it can't rotate.

Making it very heavy means that no other object has any noticeable influence on it. Isn't that good enough?
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 85 guests