Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16313
Modified Files:
collider.cpp collider.h
Log Message:
- use FindSpaceID() instead of GetSpaceID() in OnLink()
- use GetParentSpace() in OnUnlink() to deregister from current parent space
- implement GetParentSpace() using dGeomGetSpace()
Index: collider.cpp
===================================================================
RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/collider.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** collider.cpp 15 Mar 2007 07:26:27 -0000 1.3
--- collider.cpp 1 May 2007 13:09:32 -0000 1.4
***************
*** 68,72 ****
// if we have a space add the geom to it
! dSpaceID space = GetSpaceID();
if (
(space) &&
--- 68,72 ----
// if we have a space add the geom to it
! dSpaceID space = FindSpaceID();
if (
(space) &&
***************
*** 99,103 ****
// remove collision geometry from space
! dSpaceID space = GetSpaceID();
if (
--- 99,103 ----
// remove collision geometry from space
! dSpaceID space = GetParentSpaceID();
if (
***************
*** 109,119 ****
}
! if (
! (space) &&
! (dSpaceQuery(space, mODEGeom))
! )
! {
! dSpaceRemove(space, mODEGeom);
! }
}
--- 109,116 ----
}
! if (space)
! {
! dSpaceRemove(space, mODEGeom);
! }
}
***************
*** 225,228 ****
--- 222,235 ----
}
+ dSpaceID Collider::GetParentSpaceID()
+ {
+ if (mODEGeom == 0)
+ {
+ return 0;
+ }
+
+ return dGeomGetSpace(mODEGeom);
+ }
+
bool Collider::Intersects(boost::shared_ptr<Collider> collider)
{
Index: collider.h
===================================================================
RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/collider.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** collider.h 15 Mar 2007 07:26:27 -0000 1.3
--- collider.h 1 May 2007 13:09:32 -0000 1.4
***************
*** 112,115 ****
--- 112,118 ----
bool Intersects(boost::shared_ptr<Collider> collider);
+ /** returns the ODE handle ID of the containing parent space */
+ virtual dSpaceID GetParentSpaceID();
+
protected:
/** registers the managed geom to the Space of the Scene and to
|