From: Yuan Xu <xuy...@gm...> - 2009-12-18 13:00:14
|
Hi Andreas, I think because you enable the double precision in ODE, then dReal is double. I recommend to fix the problem in another way: Vector3f Body::GetLocalAngularVelocity() const { const dReal* vel = dBodyGetAngularVel(mODEBody); dReal w[3]; dBodyVectorFromWorld(mODEBody, vel[0], vel[1], vel[2], w); return Vector3f(w[0],w[1],w[2]); } "(nd Accelerometer" makes problem because I forgot to commit in the change of spark.rb, sorry 2009/12/18 <ah...@un...>: > Hi, > > > I just wanted to remark that one of the two functions added to the body > class together with the Accelerometer does not compile on my computer. I > get the following compiler error: > > /home/andreas/simspark/trunk/spark/lib/oxygen/physicsserver/body.cpp:424: > error: cannot convert ‘float*’ to ‘dReal*’ for argument ‘5’ to ‘void > dBodyVectorFromWorld(dxBody*, dReal, dReal, dReal, dReal*)’ > > It's probably caused by me either having a newer version of ODE (I had to > rename the CCylinders to Capsules to make it compile) or me using Linux or > something. Anyway, it was pretty easy to fix: > > Vector3f ODERigidBody::GetLocalAngularVelocity() const > { > const dReal* vel = dBodyGetAngularVel(mODEBody); > Vector3f w; > dReal* wData = (dReal*) w.GetData(); > dBodyVectorFromWorld(mODEBody, vel[0], vel[1], vel[2], wData); > return w; > } > > That code compiles on my computer and from my experiences from casting > between pointers, shouldn't cause a problem. > > Also, the "(nd Accelerometer" in the RSG file makes the RubySceneImporter > crash. I assume this is already a known issue since it was commented out > in R124. > > Nevertheless, the branch is now up to date with the changes made to the > trunk. > > > Andreas > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Simspark Generic Physical MAS Simulator > simspark-devel mailing list > sim...@li... > https://lists.sourceforge.net/lists/listinfo/simspark-devel > -- King Regards, Xu, Yuan |