H3D.org Forum Index Programming Issues
reseting the fallen boxes | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| angel98 | Posted on: 2012/7/26 19:02 |
Just popping in ![]() Joined: 2012/7/26 From: Posts: 1 |
reseting the fallen boxes Hello :)
I have made a movable box sitting on a pedestal. IIt can be pushed with a haptic falcon and there is no surface below it so it drops off to infinity. I want to reset it to it's original place when it's pushed, and did the following to do so: obj1 = nodes[nodelist.index("RBCollection")].bodies.back() nodes[nodelist.index("RBCollection")].bodies.pop_back() obj1.position.setValue(movObjPos1) obj1.orientation.setValue(movObjOr1) obj1.forces.setValue([]) Mass[0] = getMass(1) obj1.mass.setValue(Mass[0]) nodes[nodelist.index("RBCollection")].bodies.push_back(obj1) basically, I have saved the the original movObjPos1, and movObjOr1 and reset the force and mass. But, when it resets it tend the continue dropping off. It's like there is a velocity/momentum in it. The type of the object is "RigidBody" and I found the features at the buttom related to it. But I dont know how to manipulate them so that it is stable when reset. It keeps coming up with errors or simply doesn't take effect. Would you please help me? :) RigidBody metadata geometry autoDamp angularDampingFactor - a damping torque equal to angularVelocity * -angularDampingFactor is added linearDampingFactor - a damping force equal to linearVelocity * -linearDampingFactor is added autoDisable - dBodySetAutoDisableFlag disableAngularSpeed - dBodySetAutoDisableAngularThreshold disableLinearSpeed - dBodySetAutoDisableLinearThreshold fixed - if fixed, attach the geometry to 0 instead of the rigid body. dGeomSetBody( ( dGeomID )params->shape_id, 0 ); forces - dBodyAddForceAtPos, dBodyAddRelForceAtRelPos torques - dBodyAddTorque orientation - dBodySetRotation/ dBodyGetRotation position - dBodySetPosition/dBodyGetPosition angularVelocity - dBodySetAngularVel/ dBodyGetAngularVel linearVelocity - dBodySetLinearVel/dBodyGetLinearVel mass - dBodySetMass with inertia parameters set from other fields. massDensityModel - Box, Sphere, Cylinder working. dMassSetBoxTotal, dMassSetSphereTotal, dMassSetCylinderTotal. centerOfMass, inertia - |
| Markus | Posted on: 2012/8/20 12:12 |
Webmaster ![]() ![]() Joined: 2006/3/27 From: SenseGraphics Posts: 1900 |
Re: reseting the fallen boxes Some time have passed, did you solve it? Perhaps inertia is the key. Reset to unit matrix if it is not already set to that.
|
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |



