Index: build/vs2005/ode.vcproj
===================================================================
--- build/vs2005/ode.vcproj (revision 1198)
+++ build/vs2005/ode.vcproj (working copy)
@@ -1,7 +1,7 @@
-
-
-
@@ -289,7 +280,7 @@
AdditionalIncludeDirectories="../../include;../../OPCODE;../../GIMPACT/include"
PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE;ODE_LIB"
StringPooling="true"
- RuntimeLibrary="2"
+ RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -315,9 +306,6 @@
Name="VCALinkTool"
/>
-
-
-
@@ -342,674 +324,871 @@
+ RelativePath="..\..\include\ode\collision.h"
+ >
+ RelativePath="..\..\include\ode\collision_space.h"
+ >
+ RelativePath="..\..\include\ode\collision_trimesh.h"
+ >
+ RelativePath="..\..\include\ode\common.h"
+ >
+ RelativePath="..\..\include\ode\compatibility.h"
+ >
+ RelativePath="..\..\include\ode\config.h"
+ >
+ RelativePath="..\..\include\ode\contact.h"
+ >
+ RelativePath="..\..\include\ode\error.h"
+ >
+ RelativePath="..\..\include\ode\export-dif.h"
+ >
+ RelativePath="..\..\include\ode\mass.h"
+ >
+ RelativePath="..\..\include\ode\matrix.h"
+ >
+ RelativePath="..\..\include\ode\memory.h"
+ >
+ RelativePath="..\..\include\ode\misc.h"
+ >
+ RelativePath="..\..\include\ode\objects.h"
+ >
+ RelativePath="..\..\include\ode\ode.h"
+ >
+ RelativePath="..\..\include\ode\odecpp.h"
+ >
+ RelativePath="..\..\include\ode\odecpp_collision.h"
+ >
+ RelativePath="..\..\include\ode\odemath.h"
+ >
+ RelativePath="..\..\include\ode\rotation.h"
+ >
+ RelativePath="..\..\include\ode\timer.h"
+ >
+ RelativePath="..\..\ode\src\array.cpp"
+ >
+ RelativePath="..\..\ode\src\array.h"
+ >
+ RelativePath="..\..\ode\src\box.cpp"
+ >
+ RelativePath="..\..\ode\src\capsule.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_cylinder_box.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_cylinder_plane.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_cylinder_sphere.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_cylinder_trimesh.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_kernel.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_kernel.h"
+ >
+ RelativePath="..\..\ode\src\collision_quadtreespace.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_space.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_space_internal.h"
+ >
+ RelativePath="..\..\ode\src\collision_std.h"
+ >
+ RelativePath="..\..\ode\src\collision_transform.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_transform.h"
+ >
+ RelativePath="..\..\ode\src\collision_trimesh_box.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_trimesh_ccylinder.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_trimesh_distance.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_trimesh_gimpact.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_trimesh_internal.h"
+ >
+ RelativePath="..\..\ode\src\collision_trimesh_opcode.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_trimesh_plane.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_trimesh_ray.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_trimesh_sphere.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_trimesh_trimesh.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_trimesh_trimesh_new.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_util.cpp"
+ >
+ RelativePath="..\..\ode\src\collision_util.h"
+ >
+ RelativePath="..\..\ode\src\convex.cpp"
+ >
+ RelativePath="..\..\ode\src\cylinder.cpp"
+ >
+ RelativePath="..\..\ode\src\error.cpp"
+ >
+ RelativePath="..\..\ode\src\export-dif.cpp"
+ >
+ RelativePath="..\..\ode\src\fastdot.c"
+ >
+ RelativePath="..\..\ode\src\fastldlt.c"
+ >
+ RelativePath="..\..\ode\src\fastlsolve.c"
+ >
+ RelativePath="..\..\ode\src\fastltsolve.c"
+ >
+ RelativePath="..\..\ode\src\heightfield.cpp"
+ >
+ RelativePath="..\..\ode\src\heightfield.h"
+ >
+ RelativePath="..\..\ode\src\joint.cpp"
+ >
+ RelativePath="..\..\ode\src\joint.h"
+ >
+ RelativePath="..\..\ode\src\lcp.cpp"
+ >
+ RelativePath="..\..\ode\src\lcp.h"
+ >
+ RelativePath="..\..\ode\src\mass.cpp"
+ >
+ RelativePath="..\..\ode\src\mat.cpp"
+ >
+ RelativePath="..\..\ode\src\mat.h"
+ >
+ RelativePath="..\..\ode\src\matrix.cpp"
+ >
+ RelativePath="..\..\ode\src\memory.cpp"
+ >
+ RelativePath="..\..\ode\src\misc.cpp"
+ >
+ RelativePath="..\..\ode\src\objects.h"
+ >
+ RelativePath="..\..\ode\src\obstack.cpp"
+ >
+ RelativePath="..\..\ode\src\obstack.h"
+ >
+ RelativePath="..\..\ode\src\ode.cpp"
+ >
+ RelativePath="..\..\ode\src\odemath.cpp"
+ >
+ RelativePath="..\..\ode\src\plane.cpp"
+ >
+ RelativePath="..\..\ode\src\quickstep.cpp"
+ >
+ RelativePath="..\..\ode\src\quickstep.h"
+ >
+ RelativePath="..\..\ode\src\ray.cpp"
+ >
+ RelativePath="..\..\ode\src\rotation.cpp"
+ >
+ RelativePath="..\..\ode\src\sphere.cpp"
+ >
+ RelativePath="..\..\ode\src\stack.h"
+ >
+ RelativePath="..\..\ode\src\step.cpp"
+ >
+ RelativePath="..\..\ode\src\step.h"
+ >
+ RelativePath="..\..\ode\src\stepfast.cpp"
+ >
+ RelativePath="..\..\ode\src\testing.cpp"
+ >
+ RelativePath="..\..\ode\src\testing.h"
+ >
+ RelativePath="..\..\ode\src\timer.cpp"
+ >
+ RelativePath="..\..\ode\src\util.cpp"
+ >
+ RelativePath="..\..\ode\src\util.h"
+ >
+ RelativePath="..\..\GIMPACT\include\GIMPACT\gim_boxpruning.h"
+ >
+ RelativePath="..\..\GIMPACT\include\GIMPACT\gim_contact.h"
+ >
+ RelativePath="..\..\GIMPACT\include\GIMPACT\gim_geometry.h"
+ >
+ RelativePath="..\..\GIMPACT\include\GIMPACT\gim_math.h"
+ >
+ RelativePath="..\..\GIMPACT\include\GIMPACT\gim_memory.h"
+ >
+ RelativePath="..\..\GIMPACT\include\GIMPACT\gim_radixsort.h"
+ >
+ RelativePath="..\..\GIMPACT\include\GIMPACT\gim_tri_capsule_collision.h"
+ >
+ RelativePath="..\..\GIMPACT\include\GIMPACT\gim_tri_collision.h"
+ >
+ RelativePath="..\..\GIMPACT\include\GIMPACT\gim_tri_sphere_collision.h"
+ >
+ RelativePath="..\..\GIMPACT\include\GIMPACT\gim_trimesh.h"
+ >
+ RelativePath="..\..\GIMPACT\include\GIMPACT\gimpact.h"
+ >
+ RelativePath="..\..\GIMPACT\src\gim_boxpruning.cpp"
+ >
+ RelativePath="..\..\GIMPACT\src\gim_contact.cpp"
+ >
+ RelativePath="..\..\GIMPACT\src\gim_math.cpp"
+ >
+ RelativePath="..\..\GIMPACT\src\gim_memory.cpp"
+ >
+ RelativePath="..\..\GIMPACT\src\gim_tri_tri_overlap.cpp"
+ >
+ RelativePath="..\..\GIMPACT\src\gim_trimesh.cpp"
+ >
+ RelativePath="..\..\GIMPACT\src\gim_trimesh_capsule_collision.cpp"
+ >
+ RelativePath="..\..\GIMPACT\src\gim_trimesh_ray_collision.cpp"
+ >
+ RelativePath="..\..\GIMPACT\src\gim_trimesh_sphere_collision.cpp"
+ >
+ RelativePath="..\..\GIMPACT\src\gim_trimesh_trimesh_collision.cpp"
+ >
+ RelativePath="..\..\GIMPACT\src\gimpact.cpp"
+ >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ RelativePath="..\..\OPCODE\OPC_AABBCollider.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_AABBTree.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_AABBTree.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_BaseModel.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_BaseModel.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_BoxBoxOverlap.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_BoxPruning.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_BoxPruning.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_Collider.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_Collider.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_Common.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_Common.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_HybridModel.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_HybridModel.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_IceHook.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_LSSAABBOverlap.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_LSSCollider.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_LSSCollider.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_LSSTriOverlap.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_MeshInterface.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_MeshInterface.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_Model.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_Model.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_OBBCollider.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_OBBCollider.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_OptimizedTree.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_OptimizedTree.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_Picking.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_Picking.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_PlanesAABBOverlap.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_PlanesCollider.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_PlanesCollider.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_PlanesTriOverlap.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_RayAABBOverlap.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_RayCollider.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_RayCollider.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_RayTriOverlap.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_Settings.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_SphereAABBOverlap.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_SphereCollider.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_SphereCollider.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_SphereTriOverlap.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_SweepAndPrune.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_SweepAndPrune.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_TreeBuilders.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_TreeBuilders.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_TreeCollider.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_TreeCollider.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_TriBoxOverlap.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_TriTriOverlap.h"
+ >
+ RelativePath="..\..\OPCODE\OPC_VolumeCollider.cpp"
+ >
+ RelativePath="..\..\OPCODE\OPC_VolumeCollider.h"
+ >
+ RelativePath="..\..\OPCODE\Opcode.cpp"
+ >
+ RelativePath="..\..\OPCODE\Opcode.h"
+ >
+ RelativePath="..\..\OPCODE\StdAfx.cpp"
+ >
+ RelativePath="..\..\OPCODE\Stdafx.h"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: include/ode/collision.h
===================================================================
--- include/ode/collision.h (revision 1198)
+++ include/ode/collision.h (working copy)
@@ -1372,6 +1372,18 @@
/* ************************************************************************ */
+/* ***** Sylphis3D support *****/
+class CODETrace {
+public:
+ float mFrac;
+ dReal mEnd[3];
+ dReal mPlane[4];
+ dGeomID mGeomID;
+};
+
+void dRayTrace (dReal *start, dReal *end, dGeomID skip, dSpaceID space, CODETrace *tr);
+/*******************************/
+
#ifdef __cplusplus
}
#endif
Index: include/ode/objects.h
===================================================================
--- include/ode/objects.h (revision 1198)
+++ include/ode/objects.h (working copy)
@@ -1933,6 +1933,15 @@
*/
ODE_API int dAreConnectedExcluding (dBodyID body1, dBodyID body2, int joint_type);
+/**
+ * Damping functions
+ */
+ODE_API void dBodySetLinearDamping(dBodyID b, dReal d);
+ODE_API void dBodySetAngularDamping(dBodyID b, dReal d);
+ODE_API dReal dBodyGetLinearDamping(dBodyID b);
+ODE_API dReal dBodyGetAngularDamping(dBodyID b);
+ODE_API void dBodySetMaxAngularVel(dBodyID b, dReal v);
+ODE_API dReal dBodyGetMaxAngularVel(dBodyID b);
#ifdef __cplusplus
}
Index: ode/src/collision_kernel.cpp
===================================================================
--- ode/src/collision_kernel.cpp (revision 1198)
+++ ode/src/collision_kernel.cpp (working copy)
@@ -1089,3 +1089,60 @@
opcode_collider_cleanup();
#endif
}
+
+//** Sylhis3D Support ***/
+#define GEOM_ENABLED(g) ((g)->gflags & GEOM_ENABLED)
+void dRayTrace (dReal *start, dReal *end, dGeomID skip, dSpaceID space, CODETrace *tr){
+ dVector3 delta;
+ delta[0] = end[0] - start[0];
+ delta[1] = end[1] - start[1];
+ delta[2] = end[2] - start[2];
+ tr->mEnd[0] = end[0];
+ tr->mEnd[1] = end[1];
+ tr->mEnd[2] = end[2];
+ dReal l = dDOT(delta,delta);
+ l = sqrt(l);
+ tr->mFrac = 1.0;
+ tr->mGeomID = 0;
+
+ if(l == 0.0){
+ return;
+ }
+ delta[0] /= l;
+ delta[1] /= l;
+ delta[2] /= l;
+ dGeomID Ray = dCreateRay(space, l);
+ dGeomRaySet(Ray, start[0], start[1], start[2], delta[0], delta[1], delta[2]);
+ dGeomRaySetParams(Ray, true, true);
+ dGeomRaySetLength(Ray, l);
+ dContact contact;
+ for (dxGeom *g1=space->first; g1; g1=g1->next) {
+ if (GEOM_ENABLED(g1) && g1 != skip){
+ int numc = dCollide (Ray, g1, 1, &contact.geom, sizeof(dContact));
+ if (numc == 0)
+ continue;
+
+ //dReal l = dRecipSqrt(dDOT(contact.fdir1delta,delta));
+ dVector3 temp;
+ temp[0] = contact.geom.pos[0] - start[0];
+ temp[1] = contact.geom.pos[1] - start[1];
+ temp[2] = contact.geom.pos[2] - start[2];
+ float dist = dDOT(temp, temp);
+ dist = sqrt(dist);
+ float frac = dist / l;
+ //if(frac < tr->mFrac){
+ tr->mFrac = frac;
+ tr->mGeomID = g1;
+ tr->mEnd[0] = contact.geom.pos[0];
+ tr->mEnd[1] = contact.geom.pos[1];
+ tr->mEnd[2] = contact.geom.pos[2];
+ tr->mPlane[0] = contact.geom.normal[0];
+ tr->mPlane[1] = contact.geom.normal[1];
+ tr->mPlane[2] = contact.geom.normal[2];
+ dGeomDestroy(Ray);
+ return;
+ //}
+ }
+ }
+ dGeomDestroy(Ray);
+}
Index: ode/src/objects.h
===================================================================
--- ode/src/objects.h (revision 1198)
+++ ode/src/objects.h (working copy)
@@ -109,6 +109,7 @@
dVector3 lvel,avel; // linear and angular velocity of POR
dVector3 facc,tacc; // force and torque accumulators
dVector3 finite_rot_axis; // finite rotation axis, unit length or 0=none
+ dReal linearDamping, angularDamping, maxAngularVel;
// auto-disable information
dxAutoDisable adis; // auto-disable parameters
Index: ode/src/ode.cpp
===================================================================
--- ode/src/ode.cpp (revision 1198)
+++ ode/src/ode.cpp (working copy)
@@ -847,7 +847,42 @@
return ((b->flags & dxBodyNoGravity) == 0);
}
+void dBodySetLinearDamping(dBodyID b, dReal d)
+{
+ dAASSERT(b);
+ b->linearDamping = d;
+}
+void dBodySetAngularDamping(dBodyID b, dReal d)
+{
+ dAASSERT(b);
+ b->angularDamping = d;
+}
+
+dReal dBodyGetLinearDamping(dBodyID b)
+{
+ dAASSERT(b);
+ return b->linearDamping;
+}
+
+dReal dBodyGetAngularDamping(dBodyID b)
+{
+ dAASSERT(b);
+ return b->angularDamping;
+}
+
+void dBodySetMaxAngularVel(dBodyID b, dReal v)
+{
+ dAASSERT(b);
+ b->maxAngularVel = dFabs(v);
+}
+
+dReal dBodyGetMaxAngularVel(dBodyID b)
+{
+ dAASSERT(b);
+ return b->maxAngularVel;
+}
+
// body auto-disable functions
dReal dBodyGetAutoDisableLinearThreshold (dBodyID b)