Search found 9 matches

by knarf
Wed Jul 09, 2014 12:35 pm
Forum: Support and Development
Topic: Collision and destroy problems
Replies: 0
Views: 1225

Collision and destroy problems

I have the exact same problem as OP on LOVE 0.9.1

Code: Select all

myjoint:setCollideConnected(false)
(with myjoint being a RevoluteJoint) results in:

Code: Select all

attempt to call method 'setCollideConnected' (a nil value)
by knarf
Sat Sep 03, 2011 9:08 pm
Forum: Support and Development
Topic: Physics, revolute joints, anchors. How does it works?
Replies: 15
Views: 8604

Re: Physics, revolute joints, anchors. How does it works?

Considering that we have 2 legs, 2 joints per each leg (hips and knees), and 2 basic actions for each joint (contract and extend) wouldn't we need at least 8 keys to effectively control all the joints? Have you played QWOP ? Basically, Q and W control the thights and O and P control the calves. Q m...
by knarf
Sat Sep 03, 2011 3:41 pm
Forum: Support and Development
Topic: Physics, revolute joints, anchors. How does it works?
Replies: 15
Views: 8604

Re: Physics, revolute joints, anchors. How does it works?

Okay I've reach a point where I'm not far from what I want. The included love has a body with 2-parts legs, rotation is blocked almost similar to a human and I've even added some gameplay: you have to jump the highest you can. My personal record is 349 at the moment :awesome: . The controls are terr...
by knarf
Sat Sep 03, 2011 1:39 pm
Forum: Support and Development
Topic: Physics, revolute joints, anchors. How does it works?
Replies: 15
Views: 8604

Re: Physics, revolute joints, anchors. How does it works?

Also, I still don't understand why I have to set a width of 2*window_width (see code) to actually get a width of window_width for the ground. When you create a rectangle in Box2d, "x" and "y" are the center of the rectangle, not its top left corner. Create the ground rectangle a...
by knarf
Sat Sep 03, 2011 12:58 pm
Forum: Support and Development
Topic: Physics, revolute joints, anchors. How does it works?
Replies: 15
Views: 8604

Re: Physics, revolute joints, anchors. How does it works?

You need to give the bodies rotational inertia, i.e.: torso = box(width/2, height/2, 20, 100, 15, .1) -- instead of torso = box(width/2, height/2, 20, 100, 15) This is better. But the legs are not rotating around the right axes :huh: I've removed collision between the legs with Categories and Masks...
by knarf
Fri Sep 02, 2011 3:26 pm
Forum: Support and Development
Topic: Physics, revolute joints, anchors. How does it works?
Replies: 15
Views: 8604

Re: Physics, revolute joints, anchors. How does it works?

You need to use body:getAngle() to get the rotation of the body, so you can draw it rotated. Remember, you can't draw physics objects directly, you need to infer from the body's position and rotation how to draw it. Shape:getPoints() coordinates are already rotated and I draw a polygon with them. T...
by knarf
Fri Sep 02, 2011 3:02 pm
Forum: Support and Development
Topic: Physics, revolute joints, anchors. How does it works?
Replies: 15
Views: 8604

Re: Physics, revolute joints, anchors. How does it works?

GijsB wrote:you need to draw image's, and then rotate them with the rotation of the Body!
...what? I'm already rotating them with body:setAngle. What's the correct way to rotate a body?
by knarf
Fri Sep 02, 2011 12:24 pm
Forum: Support and Development
Topic: Physics, revolute joints, anchors. How does it works?
Replies: 15
Views: 8604

Physics, revolute joints, anchors. How does it works?

This is the first time I'm using "realistic physics" (box2D and the likes) so it's pretty new to me. I've started by following the small tutorial on the wiki. Btw, some functions of love.physics are not documented on the wiki (newBody?) and the official box2D manual linked on the wiki is d...