A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by JoeJ » Tue Jul 30, 2013 4:09 pm
I tried to reproduce your scene with my assumed 'bad' settings, but it works for me like it should.
One noticeable difference is, if i update the joint target only once per second i get some oszilating motion around the target -
this is expected and the body should not hit the target in one step.
I'm confused how you get this super stiff teleporting behaviour from your video - i still think this is the problem.
Now, do you use a kinematic body for the box?? I use only regular dynamic bodies.
-

JoeJ
-
- Posts: 1489
- Joined: Tue Dec 21, 2010 6:18 pm
by Julio Jerez » Tue Jul 30, 2013 4:44 pm
it will not work with kinematic bodies, kenenoatci bodies do not reat to dynamics
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Bird » Tue Jul 30, 2013 4:55 pm
I'm confused how you get this super stiff teleporting behaviour from your video - i still think this is the problem.
As the user drags the mouse, I raytrace from the mouse position and place the box(joint) on top of the underlying geometry and then update KinematicJoint->setTargetMatrix() with the new position on every physics update. But now I think you're right about the problem being the large position differences per frame of the joint target but I don't know how to get around it.
Now, do you use a kinematic body for the box?? I use only regular dynamic bodies.
I'm just using a regular dynamic body too.
This is one of the very few features in Bullet and PhysX that I'm missing in Newton. Here's how easy it is to setup in PhysX( from the PhysX documentation )
Sometimes controlling an actor using forces or constraints is not sufficiently robust, precise or flexible. For example moving platforms or character controllers often need to manipulate an actor's position or have it exactly follow a specific path. Such a control scheme is provided by kinematic actors.
A kinematic actor is controlled using the PxRigidDynamic::setKinematicTarget() function. Each simulation step PhysX moves the actor to its target position, regardless of external forces, gravity, collision, etc. Thus one must continually call setKinematicTarget(), every time step, for each kinematic actor, to make them move along their desired paths. The movement of a kinematic actor affects dynamic actors with which it collides or to which it is constrained with a joint. The kinematic actor will appear to have infinite mass and will push regular dynamic actors out of the way.
To create a kinematic actor, simply create a regular dynamic actor then set its kinematic flag:
PxRigidBody::setRigidBodyFlag(PxRigidBodyFlag::eKINEMATIC, true);
Use the same function to transform a kinematic actor back to a regular dynamic actor. While you do need to provide a mass for the kinematic actor as for all dynamic actors, this mass will not actually be used for anything while the actor is in kinematic mode.
-
Bird
-
- Posts: 636
- Joined: Tue Nov 22, 2011 1:27 am
by Bird » Tue Jul 30, 2013 4:57 pm
Julio Jerez wrote:wait until I make a better picking function that will calculate the impulses better.
That will be next week, after I get over the stuff I am doing now.
I will complete the scaling, for compound by change the interface for taking a local scalex, scaley, scalez, top take a general matrix
this will support both global and local scale with having to do that Asshat solution that I try last week.
the I will do that picking function
Cool. Thanks. I've got plenty of other problems to solve while I'm waiting.

-Bird
-
Bird
-
- Posts: 636
- Joined: Tue Nov 22, 2011 1:27 am
by JoeJ » Tue Jul 30, 2013 5:18 pm
I raytrace from the mouse position and place the box(joint) on top of the underlying geometry
I emulated that by setting target up axis to ground plane (optional + box radius). But anything still fine. Really strange...
To smooth the target path, you could do something like target = oldTarget*0.98 + newTarget*0.02, or use some max distance.
As long as you stay on flat ground the missing raycast in between would not matter. Just to see if it changes anything.
-

JoeJ
-
- Posts: 1489
- Joined: Tue Dec 21, 2010 6:18 pm
by Julio Jerez » Thu Aug 29, 2013 10:05 am
Ok I am fixing the scale problem now. The firs fix I added to solver the scaling is really bad, and it does not works.
this will take a day or two. because I have to make some change in many places by there are trivial.
we can not have bad scaling of compound.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests