|
From: <jas...@us...> - 2006-08-30 17:46:40
|
Revision: 1049
http://svn.sourceforge.net/opende/?rev=1049&view=rev
Author: jason379
Date: 2006-08-30 10:46:32 -0700 (Wed, 30 Aug 2006)
Log Message:
-----------
Add dBodyCopyPosition() to support pointer-less language bindings (like .NET)
Modified Paths:
--------------
trunk/include/ode/objects.h
trunk/ode/src/ode.cpp
Modified: trunk/include/ode/objects.h
===================================================================
--- trunk/include/ode/objects.h 2006-08-28 18:15:40 UTC (rev 1048)
+++ trunk/include/ode/objects.h 2006-08-30 17:46:32 UTC (rev 1049)
@@ -574,10 +574,22 @@
* When getting, the returned values are pointers to internal data structures,
* so the vectors are valid until any changes are made to the rigid body
* system structure.
+ * @sa dBodyCopyPosition
*/
ODE_API const dReal * dBodyGetPosition (dBodyID);
+
/**
+ * @brief Copy the position of a body into a vector.
+ * @ingroup bodies
+ * @param body the body to query
+ * @param position a copy of the body position
+ * @sa dBodyGetPosition
+ */
+ODE_API void dBodyCopyPosition (dBodyID body, dVector3 position);
+
+
+/**
* @brief Get the rotation of a body.
* @ingroup bodies
* @return pointer to a 4x3 rotation matrix.
Modified: trunk/ode/src/ode.cpp
===================================================================
--- trunk/ode/src/ode.cpp 2006-08-28 18:15:40 UTC (rev 1048)
+++ trunk/ode/src/ode.cpp 2006-08-30 17:46:32 UTC (rev 1049)
@@ -374,6 +374,16 @@
}
+void dBodyCopyPosition (dBodyID b, dVector3 position)
+{
+ dAASSERT (b);
+ dReal* pos = b->posr.pos;
+ position[0] = pos[0];
+ position[1] = pos[1];
+ position[2] = pos[2];
+}
+
+
const dReal * dBodyGetRotation (dBodyID b)
{
dAASSERT (b);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|