What do the settings mean? Multitouch football

6 views
Skip to first unread message

Vladimir

unread,
Mar 4, 2010, 2:06:31 PM3/4/10
to Physics2D.Net
Hello,

Nice engine. I'm making a multitouch football game and I have a couple
of questions.
When I "kick" the ball too hard the player goes through the ball. What
do the settings for the engine mean? (iterations, splitimpulse,
bias, ...),
What I did is attach the bodies from physics2d to TUIO(multitouch)
events directly. First i tried updating them with every event but they
would keep on moving even when the player is not moving. TUIO does not
send not moving event. I ended up checking the collided event for the
ball. When the player collides with the ball I assign that body the
speed from multitouch movement and then I remove the velocity and acc
in the physicstimer tick event. Do you think this is the right way?

Thanks,
Vladimir

JonoPorter

unread,
Mar 4, 2010, 6:21:51 PM3/4/10
to Physics2D.Net
This is all from memory so could be wrong:
iterations is the number of times per timestep it tries to resolve
collisions. A higher number will make stacking more stable will also
make it take more cpu cycles.
SplitImpulse is a mode that splits impulse calculations for normal
impulse and bias impulse.
Bias is a variable that is used to calculate how much extra impulse is
given to a collision to resolve penetration.

If you are having issue with objects going through each other try
making the objects thicker or increase the rate at which the engine is
updated.

Generally in Physics you don't want to manipulate velocities directly.
Try Adding force instead of velocity.

You can also create a join between where the players finger is and the
players character. like how the mouse works in the demo.

Vladimir

unread,
Mar 5, 2010, 6:23:26 AM3/5/10
to Physics2D.Net
Thanks, I understand that the approach for force is better than
velocity but the problem is more in the objects representing the
fingers because they keep on moving after the fingers stop. Is it the
right way to remove the velocity in the Tick or am I missing a boolean
value of some sort in the engine. Can I solve this with joints? What
type of joint am I suppose to use for this connection?

Jonathan Porter

unread,
Mar 5, 2010, 12:09:06 PM3/5/10
to Vladimir, Physics2D.Net
The FixedHingeJoint is what I used in the demo. If you look at the RegisterMousePicking method in the DemoHelper class you will see a complete implementation.

--
You received this message because you are subscribed to the Google Groups "Physics2D.Net" group.
To post to this group, send email to physics...@googlegroups.com.
To unsubscribe from this group, send email to physics2ddotn...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/physics2ddotnet?hl=en.


Reply all
Reply to author
Forward
0 new messages