Best way to grab object?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Best way to grab object?

Postby razi » Wed Sep 01, 2010 7:46 am

Hello,
Im working on a first person game, and I want player to be able to grab rigid objects. What is generally best way to do it? I tried two alternatives:
1. connect the object with joint in front of player
+quick reaction to update position when looking around
-unlimited strength, when theres 100kg object between me and grabbed object, it still pulls it, just to be able to be in front of me

2. set custom force callback, with gravity center in point in front of me
+natural behavior of object most of time
-slow to react when looking around, doing a lot of circles around the point, adjust strength of callback/ damping just slightly makes it better

I want natural way of holding it, no forced moving to its position, but I want it to react quickly without this "dancing" in front of me. :)
Can someone suggest me good way?

Thank you.
User avatar
razi
 
Posts: 21
Joined: Wed Sep 01, 2010 7:13 am

Re: Best way to grab object?

Postby ledahut » Wed Sep 01, 2010 8:48 am

Did you try the CustomKinematicController joint?
with CustomKinematicControllerSetPickMode to 0 and CustomKinematicControllerSetMaxAngularFriction to big value [or values proportional to your mass].
ledahut
 
Posts: 98
Joined: Mon Jun 21, 2010 8:03 am
Location: France

Re: Best way to grab object?

Postby razi » Wed Sep 01, 2010 10:49 am

Hi,
thanks, I tried it and to get object at least moving I need to set MaxLinearFriction to 50 or so, with both, Linear a Angular Friction set to something like 300, it seems to do the job, but when player moves it has quite a jerky moving. :?
User avatar
razi
 
Posts: 21
Joined: Wed Sep 01, 2010 7:13 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 209 guests