opal-commits Mailing List for Open Physics Abstraction Layer (Page 21)
Status: Inactive
Brought to you by:
tylerstreeter
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
(162) |
Mar
(134) |
Apr
(113) |
May
(13) |
Jun
(60) |
Jul
(18) |
Aug
(25) |
Sep
|
Oct
(2) |
Nov
(35) |
Dec
(76) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(3) |
Apr
(8) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
(1) |
Mar
(12) |
Apr
(16) |
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
|
Nov
|
Dec
(3) |
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(15) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Andres R. <ar...@us...> - 2005-03-10 21:13:03
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3815/src/ODE Modified Files: ODESimulator.cpp ODESimulator.h Log Message: added a raycast that takes ray length separately for optimization Index: ODESimulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.h,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** ODESimulator.h 9 Mar 2005 02:09:50 -0000 1.60 --- ODESimulator.h 10 Mar 2005 21:12:53 -0000 1.61 *************** *** 97,102 **** void OPAL_CALL internal_addCollidedSolid(Solid* solid); ! virtual const RaycastResult& OPAL_CALL internal_fireRay( ! const Rayr& r); /// Helper function used for ray casting. --- 97,103 ---- void OPAL_CALL internal_addCollidedSolid(Solid* solid); ! virtual const RaycastResult& OPAL_CALL internal_fireRay( const Rayr& r); ! ! virtual const RaycastResult& OPAL_CALL internal_fireRay( const Rayr& r, real length ); /// Helper function used for ray casting. Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** ODESimulator.cpp 9 Mar 2005 02:09:50 -0000 1.87 --- ODESimulator.cpp 10 Mar 2005 21:12:53 -0000 1.88 *************** *** 854,861 **** const RaycastResult& ODESimulator::internal_fireRay(const Rayr& r) { - Point3r origin = r.getOrigin(); real length = r.getLength(); Vec3r dir = r.getDir(); // Normalized the vector if possible. if (0 != length) --- 854,868 ---- const RaycastResult& ODESimulator::internal_fireRay(const Rayr& r) { real length = r.getLength(); + mRaycastResult = internal_fireRay( r, length ); + return mRaycastResult; + } + + const RaycastResult& ODESimulator::internal_fireRay( const Rayr& r, real length ) + { + Point3r origin = r.getOrigin(); Vec3r dir = r.getDir(); + /* I don't think ODE requires this since ray length is separate from the direction -- Andres // Normalized the vector if possible. if (0 != length) *************** *** 863,866 **** --- 870,874 ---- dir.normalize(); } + */ mRaycastResult.solid = NULL; *************** *** 880,884 **** // Finished with ODE ray, so destroy it. dGeomDestroy(rayGeomID); - return mRaycastResult; } --- 888,891 ---- |
|
From: Andres R. <ar...@us...> - 2005-03-10 21:11:19
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3414/src/ODE Modified Files: ODESolid.cpp ODESolid.h Log Message: added clearShapes function to solid Index: ODESolid.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.h,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** ODESolid.h 4 Mar 2005 23:26:54 -0000 1.64 --- ODESolid.h 10 Mar 2005 21:11:05 -0000 1.65 *************** *** 85,88 **** --- 85,90 ---- virtual void OPAL_CALL setStatic(bool s); + virtual void OPAL_CALL clearShapes(); + virtual void OPAL_CALL addShape(const ShapeData& data); Index: ODESolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.cpp,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** ODESolid.cpp 5 Mar 2005 21:26:24 -0000 1.75 --- ODESolid.cpp 10 Mar 2005 21:11:05 -0000 1.76 *************** *** 68,102 **** } void ODESolid::destroyGeoms() { ! while (!mGeomDataList.empty()) { ! // Note: do not delete the Solid pointer. It will get deleted ! // elsewhere. ! ! if (0 != mGeomDataList.back()->transformID) { ! // This geom uses a transform geom. Destroy it. ! dGeomDestroy(mGeomDataList.back()->transformID); } ! #ifdef OPAL_USE_MESH ! if (0 != mGeomDataList.back()->trimeshDataID) { // This geom uses a trimesh. Destroy it. (This does NOT // touch the user's mesh data, just internal ODE trimesh // data.) ! dGeomTriMeshDataDestroy(mGeomDataList.back()->trimeshDataID); } #endif - // Destroy the ODE geom. ! dGeomDestroy(mGeomDataList.back()->geomID); // Delete the geom data object. ! delete mGeomDataList.back(); mGeomDataList.pop_back(); } } --- 68,103 ---- } + void ODESolid::clearShapes() + { + destroyGeoms(); + } + void ODESolid::destroyGeoms() { ! for( size_t i = 0; i<mGeomDataList.size(); ++i ) { ! if( 0 != mGeomDataList[i]->transformID ) { ! dGeomDestroy(mGeomDataList[i]->transformID); } ! #ifdef OPAL_USE_MESH ! if (0 != mGeomDataList[i]->trimeshDataID) { // This geom uses a trimesh. Destroy it. (This does NOT // touch the user's mesh data, just internal ODE trimesh // data.) ! dGeomTriMeshDataDestroy(mGeomDataList[i]->trimeshDataID); } #endif // Destroy the ODE geom. ! dGeomDestroy(mGeomDataList[i]->geomID); // Delete the geom data object. ! delete mGeomDataList[i]; mGeomDataList.pop_back(); } + mGeomDataList.clear(); } |
|
From: Andres R. <ar...@us...> - 2005-03-10 21:11:02
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3302/src Modified Files: Solid.h Log Message: added clearShapes function to solid Index: Solid.h =================================================================== RCS file: /cvsroot/opal/opal/src/Solid.h,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** Solid.h 8 Mar 2005 16:10:23 -0000 1.81 --- Solid.h 10 Mar 2005 21:10:36 -0000 1.82 *************** *** 140,143 **** --- 140,146 ---- virtual Quaternion OPAL_CALL getQuaternion()const; + /// Removes all shapes from this Solid. + virtual void OPAL_CALL clearShapes() = 0; + /// Adds a Shape to this Solid. virtual void OPAL_CALL addShape(const ShapeData& data) = 0; |
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11688/src Modified Files: AttractorMotor.cpp AttractorMotor.h GearedMotor.cpp GearedMotor.h Motor.cpp Motor.h SConscript Sensor.cpp Sensor.h SensorData.h ServoMotor.cpp ServoMotor.h Simulator.cpp Simulator.h SpringMotor.cpp SpringMotor.h ThrusterMotor.cpp ThrusterMotor.h opal.h Added Files: RaycastSensor.cpp RaycastSensor.h RaycastSensorData.h Log Message: added a RaycastSensor, which replaces the old Simulator ray casting functions Index: Sensor.h =================================================================== RCS file: /cvsroot/opal/opal/src/Sensor.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Sensor.h 25 Feb 2005 06:40:26 -0000 1.7 --- Sensor.h 9 Mar 2005 02:09:49 -0000 1.8 *************** *** 30,40 **** #include "Defines.h" namespace opal { ! /// A device that records data from a simulation. Some Sensors must be /// attached to Solids, some can simply be positioned somewhere within /// an environment, and some can work either way. All Sensors start out ! /// disabled and must be initialized via init) before they can be /// enabled. class Sensor --- 30,41 ---- #include "Defines.h" + #include "SensorData.h" namespace opal { ! /// A device that records data from a simulation. Some Sensors can be /// attached to Solids, some can simply be positioned somewhere within /// an environment, and some can work either way. All Sensors start out ! /// disabled and must be initialized via init) before they can be /// enabled. class Sensor *************** *** 60,63 **** --- 61,73 ---- virtual void* OPAL_CALL getUserData(); + /// Returns the Sensor type. + virtual SensorType OPAL_CALL getType()const = 0; + + /// Sets the Sensor's transform. + virtual void OPAL_CALL setTransform(const Matrix44r& name) = 0; + + /// Returns the Sensor's transform. + virtual const Matrix44r& OPAL_CALL getTransform()const = 0; + /// Sets the Sensor's name. virtual void OPAL_CALL setName(const std::string& name) = 0; *************** *** 74,79 **** protected: ! /// True if the Sensor is enabled. ! //bool mEnabled; /// Pointer to user data. This is totally user-managed (i.e. OPAL --- 84,89 ---- protected: ! /// Called by subclasses when they are initialized. ! void init(); /// Pointer to user data. This is totally user-managed (i.e. OPAL Index: opal.h =================================================================== RCS file: /cvsroot/opal/opal/src/opal.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** opal.h 8 Mar 2005 16:10:23 -0000 1.20 --- opal.h 9 Mar 2005 02:09:50 -0000 1.21 *************** *** 54,57 **** --- 54,59 ---- #include "Sensor.h" #include "SensorData.h" + #include "RaycastSensor.h" + #include "RaycastSensorData.h" #include "EventHandler.h" #include "JointBreakEventHandler.h" Index: SConscript =================================================================== RCS file: /cvsroot/opal/opal/src/SConscript,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SConscript 8 Mar 2005 16:10:23 -0000 1.12 --- SConscript 9 Mar 2005 02:09:49 -0000 1.13 *************** *** 30,33 **** --- 30,35 ---- Portability.h Quaternion.h + RaycastSensor.h + RaycastSensorData.h Rayr.h RayShapeData.h *************** *** 61,64 **** --- 63,67 ---- Logger.cpp Motor.cpp + RaycastSensor.cpp Sensor.cpp ServoMotor.cpp Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Simulator.cpp 8 Mar 2005 16:10:23 -0000 1.43 --- Simulator.cpp 9 Mar 2005 02:09:49 -0000 1.44 *************** *** 32,35 **** --- 32,41 ---- #include "CapsuleShapeData.h" #include "PlaneShapeData.h" + #include "ThrusterMotor.h" + #include "GearedMotor.h" + #include "ServoMotor.h" + #include "AttractorMotor.h" + #include "SpringMotor.h" + #include "RaycastSensor.h" namespace opal *************** *** 107,111 **** while (mTimeBuffer >= mStepSize) { ! // TODO: Call some user-defined function here... // Update Sensors. --- 113,118 ---- while (mTimeBuffer >= mStepSize) { ! // TODO: Call some user-defined function here; maybe have ! // a BeginStepEventHandler // Update Sensors. *************** *** 606,609 **** --- 613,626 ---- } + void Simulator::setupContactGroup(unsigned int group, + bool makeContacts) + { + int i=0; + for (i=0; i<32; ++i) + { + setupContactGroups(group, i, makeContacts); + } + } + unsigned long int Simulator::internal_getContactGroupFlags( unsigned int groupNum)const *************** *** 709,720 **** } ! Solid* Simulator::createSensor() { ! //Sensor* newSensor = new Sensor(); ! //addSensor(newSensor); ! //return newSensor; ! ! // Temporary... ! return NULL; } --- 726,734 ---- } ! RaycastSensor* Simulator::createRaycastSensor() { ! RaycastSensor* newSensor = new RaycastSensor(this); ! addSensor(newSensor); ! return newSensor; } Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** Simulator.h 8 Mar 2005 22:05:03 -0000 1.81 --- Simulator.h 9 Mar 2005 02:09:50 -0000 1.82 *************** *** 34,42 **** #include "Solid.h" #include "Space.h" - #include "ThrusterMotor.h" - #include "GearedMotor.h" - #include "ServoMotor.h" - #include "AttractorMotor.h" - #include "SpringMotor.h" #include "Blueprint.h" #include "Sensor.h" --- 34,37 ---- *************** *** 44,74 **** namespace opal { class BlueprintInstance; ! ! /// A data structure containing information about a specific ! /// intersection from a ray cast. ! struct RaycastResult ! { ! RaycastResult() ! { ! solid = NULL; ! // "intersection" is initialized in its own constructor. ! // "normal" is initialized in its own constructor. ! distance = 0; ! } ! ! /// The first Solid hit by the ray. ! Solid* solid; ! ! /// The point of intersection. ! Point3r intersection; ! ! /// The normal vector at the point of intersection. ! Vec3r normal; ! ! /// The distance from the base of the ray to the intersection ! /// point. ! real distance; ! }; /// A Simulator is an environment that contains simulated objects. --- 39,50 ---- namespace opal { + class AttractorMotor; + class GearedMotor; + class ServoMotor; + class SpringMotor; + class ThrusterMotor; + class RaycastSensor; class BlueprintInstance; ! struct RaycastResult; /// A Simulator is an environment that contains simulated objects. *************** *** 113,121 **** // std::vector<Solid*>* solids) = 0; - /// A convenient ray casting function. TODO: replace with a - /// Sensor. - virtual RaycastResult OPAL_CALL shootRay(const Point3r& origin, - const Vec3r& dir, real length) = 0; - /// Sets the gravity used in the simulation. virtual void OPAL_CALL setGravity(const Vec3r& gravity) = 0; --- 89,92 ---- *************** *** 169,172 **** --- 140,151 ---- unsigned int group1, bool makeContacts); + /// Similar to setupContactGroups. Determines how a single contact + /// group interacts with all other groups. This is useful when + /// you want to e.g. disable collisions between a group and + /// everything else for a "trigger volume." (See setupContactGroups + /// for more details). + virtual void OPAL_CALL setupContactGroup(unsigned int group, + bool makeContacts); + // SOLIDS *************** *** 226,231 **** // SENSORS ! /// Creates and returns a pointer to a Sensor. ! virtual Solid* OPAL_CALL createSensor(); /// Immediately destroys the given Sensor. --- 205,210 ---- // SENSORS ! /// Creates and returns a pointer to a RaycastSensor. ! virtual RaycastSensor* OPAL_CALL createRaycastSensor(); /// Immediately destroys the given Sensor. *************** *** 246,249 **** --- 225,235 ---- virtual void OPAL_CALL internal_stepPhysics() = 0; + /// Helper function used for ray casting. Immediately fires a ray + /// into the scene and returns intersections results. Takes an + /// unnormalized ray, which is important because the ray's length + /// is used when casting the ray into the scene. + virtual const RaycastResult& OPAL_CALL internal_fireRay( + const Rayr& r) = 0; + /// Returns the Simulator's contact group flags. virtual unsigned long int OPAL_CALL Index: Sensor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Sensor.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Sensor.cpp 25 Feb 2005 06:40:26 -0000 1.4 --- Sensor.cpp 9 Mar 2005 02:09:49 -0000 1.5 *************** *** 32,37 **** Sensor::Sensor() { - // "mData" is initialized in its own constructor. - //mEnabled = false; mInitCalled = false; setUserData(NULL); --- 32,35 ---- *************** *** 42,45 **** --- 40,48 ---- } + void Sensor::init() + { + mInitCalled = true; + } + void Sensor::setUserData(void* data) { --- NEW FILE: RaycastSensor.h --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #ifndef OPAL_RAYCAST_SENSOR_H #define OPAL_RAYCAST_SENSOR_H #include "Defines.h" #include "Sensor.h" #include "RaycastSensorData.h" namespace opal { class Simulator; /// A data structure containing information about a specific /// intersection from a ray cast. struct RaycastResult { RaycastResult() { solid = NULL; // "intersection" is initialized in its own constructor. // "normal" is initialized in its own constructor. distance = 0; } /// The first Solid hit by the ray. This will remain NULL if no /// Solid is hit. Solid* solid; /// The point of intersection. Point3r intersection; /// The normal vector at the point of intersection. Vec3r normal; /// The distance from the base of the ray to the intersection /// point. real distance; }; /// A Sensor that fires a ray into a scene and returns data describing /// the intersection, if any. This Sensor does not fire a ray on /// every time step because that would be a waste of time in most /// cases; it must be "fired" manually. class RaycastSensor : public Sensor { public: RaycastSensor(Simulator* s); virtual ~RaycastSensor(); /// Initializes the Sensor with the given data structure. Solid /// pointer in the data must be valid. virtual void OPAL_CALL init(const RaycastSensorData& data); /// Returns all data describing the Sensor. virtual const RaycastSensorData& OPAL_CALL getData()const; /// Fires a ray into the Sensor's environment, returning /// information about the first intersection encountered. virtual const RaycastResult& OPAL_CALL fireRay(); virtual void OPAL_CALL setEnabled(bool e); virtual bool OPAL_CALL isEnabled()const; /// Sets the Sensor's ray. virtual void OPAL_CALL setRay(Rayr r); /// Returns the Sensor's ray. virtual const Rayr& OPAL_CALL getRay()const; virtual void OPAL_CALL setTransform(const Matrix44r& t); virtual const Matrix44r& OPAL_CALL getTransform()const; virtual SensorType OPAL_CALL getType()const; virtual void OPAL_CALL setName(const std::string& name); virtual const std::string& OPAL_CALL getName()const; virtual void OPAL_CALL internal_update(); virtual bool OPAL_CALL internal_dependsOn(Solid* solid); protected: /// Stores data describing the Sensor. RaycastSensorData mData; /// Pointer to the Simulator containing this Sensor; used to fire /// rays into the Simulator. Simulator* mSim; private: }; } #endif Index: GearedMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/GearedMotor.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GearedMotor.h 1 Mar 2005 05:04:22 -0000 1.9 --- GearedMotor.h 9 Mar 2005 02:09:49 -0000 1.10 *************** *** 65,68 **** --- 65,70 ---- virtual const GearedMotorData& OPAL_CALL getData()const; + virtual MotorType OPAL_CALL getType()const; + virtual void OPAL_CALL setName(const std::string& name); *************** *** 100,121 **** GearedMotorData mData; - ///// Pointer to the Joint affected by this Motor. - //Joint* mJoint; - - ///// The index of the specific Joint axis affected by this Motor. - //int mJointAxisNum; - - ///// The maximum amount of torque that can be applied to the Joint - ///// axis. - //real mMaxTorque; - - ///// The inverse of the maximum velocity that can be achieved by - ///// the Motor. The inverse is cached for faster computations. - //real mMaxVelInverse; - - ///// The throttle (i.e. the "gas") affects how much of the available - ///// torque is applied to the Joint axis. - //real mThrottle; - private: --- 102,105 ---- Index: SpringMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/SpringMotor.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SpringMotor.h 8 Mar 2005 16:10:23 -0000 1.10 --- SpringMotor.h 9 Mar 2005 02:09:50 -0000 1.11 *************** *** 59,62 **** --- 59,64 ---- virtual const SpringMotorData& OPAL_CALL getData()const; + virtual MotorType OPAL_CALL getType()const; + virtual void OPAL_CALL setName(const std::string& name); Index: SensorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SensorData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SensorData.h 25 Feb 2005 06:40:26 -0000 1.3 --- SensorData.h 9 Mar 2005 02:09:49 -0000 1.4 *************** *** 37,41 **** { VELOCITY_SENSOR, ! ACCELERATION_SENSOR }; --- 37,42 ---- { VELOCITY_SENSOR, ! ACCELERATION_SENSOR, ! RAYCAST_SENSOR }; *************** *** 51,54 **** --- 52,57 ---- enabled = defaults::sensor::enabled; name = ""; + solid = NULL; + // "transform" is initialized in its own constructor. } *************** *** 69,72 **** --- 72,85 ---- std::string name; + /// Pointer to the Solid to which this Sensor is attached. This + /// will be NULL if the Sensor is not attached to a Solid (i.e. + /// it is positioned somewhere within the environment). + Solid* solid; + + /// If the Sensor is attached to a Solid, this matrix is the global + /// offset from that Solid's transform. Otherwise, it is just the + /// Sensor's global transform. + Matrix44r transform; + protected: /// The Sensor type. Index: ThrusterMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/ThrusterMotor.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ThrusterMotor.h 8 Mar 2005 16:10:23 -0000 1.11 --- ThrusterMotor.h 9 Mar 2005 02:09:50 -0000 1.12 *************** *** 59,62 **** --- 59,64 ---- virtual const ThrusterMotorData& OPAL_CALL getData()const; + virtual MotorType OPAL_CALL getType()const; + virtual void OPAL_CALL setName(const std::string& name); Index: Motor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Motor.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Motor.cpp 5 Mar 2005 21:26:24 -0000 1.15 --- Motor.cpp 9 Mar 2005 02:09:49 -0000 1.16 *************** *** 32,36 **** Motor::Motor() { - // "mData" is initialized in its own constructor. //mIsCustom = false; mInitCalled = false; --- 32,35 ---- *************** *** 45,49 **** { mInitCalled = true; - //mEnabled = true; } --- 44,47 ---- Index: GearedMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/GearedMotor.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GearedMotor.cpp 1 Mar 2005 05:04:22 -0000 1.9 --- GearedMotor.cpp 9 Mar 2005 02:09:49 -0000 1.10 *************** *** 62,65 **** --- 62,70 ---- } + MotorType GearedMotor::getType()const + { + return mData.getType(); + } + void GearedMotor::setName(const std::string& name) { Index: ServoMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/ServoMotor.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ServoMotor.h 1 Mar 2005 05:04:22 -0000 1.23 --- ServoMotor.h 9 Mar 2005 02:09:49 -0000 1.24 *************** *** 61,64 **** --- 61,66 ---- virtual const ServoMotorData& OPAL_CALL getData()const; + virtual MotorType OPAL_CALL getType()const; + virtual void OPAL_CALL setName(const std::string& name); *************** *** 109,137 **** ServoMotorData mData; - ///// Pointer to the Joint affected by this Motor. - //Joint* mJoint; - - ///// The Motor's mode of operation. - //Mode mMode; - - ///// The index of the Joint axes affected by this Motor. - //int mJointAxis; - - ///// The Motor's desired position. This is only used if the - ///// appropriate mode is set. - //real mDesiredPos; - // - ///// The Motor's desired position. This is only used if the - ///// appropriate mode is set. - //real mDesiredVel; - - ///// The maximum amount of force that can be used to help the - ///// Joint axis achieve its desired position or velocity. - //real mMaxForce; - - ///// A constant used in desired position mode that scaled how fast - ///// the Joint axis will achieve its desired position. - //real mRestoreSpeed; - private: --- 111,114 ---- Index: AttractorMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/AttractorMotor.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** AttractorMotor.h 8 Mar 2005 16:10:23 -0000 1.26 --- AttractorMotor.h 9 Mar 2005 02:09:49 -0000 1.27 *************** *** 60,63 **** --- 60,65 ---- virtual const AttractorMotorData& OPAL_CALL getData()const; + virtual MotorType OPAL_CALL getType()const; + virtual void OPAL_CALL setName(const std::string& name); Index: ThrusterMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ThrusterMotor.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ThrusterMotor.cpp 4 Mar 2005 05:09:24 -0000 1.9 --- ThrusterMotor.cpp 9 Mar 2005 02:09:50 -0000 1.10 *************** *** 61,64 **** --- 61,69 ---- } + MotorType ThrusterMotor::getType()const + { + return mData.getType(); + } + void ThrusterMotor::setName(const std::string& name) { --- NEW FILE: RaycastSensorData.h --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #ifndef OPAL_RAYCAST_SENSOR_DATA_H #define OPAL_RAYCAST_SENSOR_DATA_H #include "Defines.h" #include "SensorData.h" namespace opal { /// A data structure describing a RaycastSensor. class RaycastSensorData : public SensorData { public: RaycastSensorData() : SensorData() { mType = RAYCAST_SENSOR; // "ray" is initialized in its own constructor. } /// Copy constructor. RaycastSensorData(const RaycastSensorData& data) { (*this) = data; } virtual ~RaycastSensorData() { } /// Makes a deep copy. virtual void OPAL_CALL operator=(const RaycastSensorData& data) { mType = data.mType; enabled = data.enabled; name = data.name; solid = data.solid; transform = data.transform; ray = data.ray; } /// The ray used by this Sensor for ray casting. The length of the /// ray is important; objects beyond the length of the ray will not /// be intersected. Keep in mind that the Sensor's transform may /// affect the ray's final origin and direction. Rayr ray; protected: private: }; } #endif --- NEW FILE: RaycastSensor.cpp --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #include "RaycastSensor.h" #include "Simulator.h" namespace opal { RaycastSensor::RaycastSensor(Simulator* s) { // "mData" is initialized in its own constructor. mSim = s; } RaycastSensor::~RaycastSensor() { } void RaycastSensor::init(const RaycastSensorData& data) { assert(data.solid); Sensor::init(); mData = data; } const RaycastSensorData& RaycastSensor::getData()const { return mData; } const RaycastResult& RaycastSensor::fireRay() { return mSim->internal_fireRay(mData.ray); } void RaycastSensor::setEnabled(bool e) { if (!mInitCalled) { return; } mData.enabled = e; } bool RaycastSensor::isEnabled()const { return mData.enabled; } void RaycastSensor::setRay(Rayr r) { mData.ray = r; } const Rayr& RaycastSensor::getRay()const { return mData.ray; } SensorType RaycastSensor::getType()const { return mData.getType(); } void RaycastSensor::setTransform(const Matrix44r& t) { mData.transform = t; } const Matrix44r& RaycastSensor::getTransform()const { return mData.transform; } void RaycastSensor::setName(const std::string& name) { mData.name = name; } const std::string& RaycastSensor::getName()const { return mData.name; } void RaycastSensor::internal_update() { if (mData.enabled) { // TODO: if mData.solid is valid, update this Sensor's ray // relative to the Solid } } bool RaycastSensor::internal_dependsOn(Solid* solid) { if (solid == mData.solid) { return true; } else { return false; } } } Index: ServoMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ServoMotor.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ServoMotor.cpp 1 Mar 2005 05:04:22 -0000 1.13 --- ServoMotor.cpp 9 Mar 2005 02:09:49 -0000 1.14 *************** *** 90,93 **** --- 90,98 ---- } + MotorType ServoMotor::getType()const + { + return mData.getType(); + } + void ServoMotor::setName(const std::string& name) { Index: SpringMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/SpringMotor.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SpringMotor.cpp 1 Mar 2005 05:04:22 -0000 1.8 --- SpringMotor.cpp 9 Mar 2005 02:09:50 -0000 1.9 *************** *** 60,63 **** --- 60,68 ---- } + MotorType SpringMotor::getType()const + { + return mData.getType(); + } + void SpringMotor::setName(const std::string& name) { Index: AttractorMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/AttractorMotor.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AttractorMotor.cpp 4 Mar 2005 23:26:53 -0000 1.19 --- AttractorMotor.cpp 9 Mar 2005 02:09:49 -0000 1.20 *************** *** 73,76 **** --- 73,81 ---- } + MotorType AttractorMotor::getType()const + { + return mData.getType(); + } + void AttractorMotor::setName(const std::string& name) { Index: Motor.h =================================================================== RCS file: /cvsroot/opal/opal/src/Motor.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Motor.h 5 Mar 2005 21:26:24 -0000 1.36 --- Motor.h 9 Mar 2005 02:09:49 -0000 1.37 *************** *** 30,33 **** --- 30,34 ---- #include "Defines.h" + #include "MotorData.h" namespace opal *************** *** 67,70 **** --- 68,74 ---- virtual void* OPAL_CALL getUserData(); + /// Returns the Motor type. + virtual MotorType OPAL_CALL getType()const = 0; + /// Sets the Motor's name. virtual void OPAL_CALL setName(const std::string& name) = 0; *************** *** 94,100 **** void init(); - /// True if the Motor is enabled. - //bool mEnabled; - /// Pointer to user data. This is totally user-managed (i.e. OPAL /// will never delete it). --- 98,101 ---- |
|
From: tylerstreeter <tyl...@us...> - 2005-03-09 02:10:01
|
Update of /cvsroot/opal/opal/vc7 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11688/vc7 Modified Files: opal-ode.vcproj Log Message: added a RaycastSensor, which replaces the old Simulator ray casting functions Index: opal-ode.vcproj =================================================================== RCS file: /cvsroot/opal/opal/vc7/opal-ode.vcproj,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** opal-ode.vcproj 8 Mar 2005 16:10:25 -0000 1.16 --- opal-ode.vcproj 9 Mar 2005 02:09:51 -0000 1.17 *************** *** 143,146 **** --- 143,149 ---- </File> <File + RelativePath="..\src\RaycastSensor.cpp"> + </File> + <File RelativePath="..\src\Sensor.cpp"> </File> *************** *** 234,237 **** --- 237,246 ---- </File> <File + RelativePath="..\src\RaycastSensor.h"> + </File> + <File + RelativePath="..\src\RaycastSensorData.h"> + </File> + <File RelativePath="..\src\Sensor.h"> </File> |
|
From: tylerstreeter <tyl...@us...> - 2005-03-09 02:10:01
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11688/src/ODE Modified Files: ODESimulator.cpp ODESimulator.h Log Message: added a RaycastSensor, which replaces the old Simulator ray casting functions Index: ODESimulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.h,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** ODESimulator.h 8 Mar 2005 22:05:05 -0000 1.59 --- ODESimulator.h 9 Mar 2005 02:09:50 -0000 1.60 *************** *** 32,35 **** --- 32,36 ---- #include "../Defines.h" #include "../Simulator.h" + #include "../RaycastSensor.h" #include "ODESolid.h" #include "ODEJoint.h" *************** *** 56,59 **** --- 57,62 ---- ODESimulator(); + virtual ~ODESimulator(); + virtual void OPAL_CALL destroy(); *************** *** 77,83 **** // std::vector<Solid*>* solids); - virtual RaycastResult OPAL_CALL shootRay(const Point3r& origin, - const Vec3r& dir, real length); - virtual void OPAL_CALL setGravity(const Vec3r& gravity); --- 80,83 ---- *************** *** 88,106 **** virtual void OPAL_CALL internal_stepPhysics(); ! dWorldID OPAL_CALL internal_getWorldID()const; ! dSpaceID OPAL_CALL internal_getSpaceID()const; ! dJointGroupID OPAL_CALL internal_getJointGroupID()const; /// Helper function for volume collision checking. void OPAL_CALL internal_addCollidedSolid(Solid* solid); ! /// Helper function for ray casting. ! void OPAL_CALL internal_setRaycastResult(Solid* solid, const Point3r& intersection, const Vec3r& normal, real distance); protected: - virtual ~ODESimulator(); /// The ODE world ID used by this Simulator. --- 88,108 ---- virtual void OPAL_CALL internal_stepPhysics(); ! virtual dWorldID OPAL_CALL internal_getWorldID()const; ! virtual dSpaceID OPAL_CALL internal_getSpaceID()const; ! virtual dJointGroupID OPAL_CALL internal_getJointGroupID()const; /// Helper function for volume collision checking. void OPAL_CALL internal_addCollidedSolid(Solid* solid); ! virtual const RaycastResult& OPAL_CALL internal_fireRay( ! const Rayr& r); ! ! /// Helper function used for ray casting. ! virtual void OPAL_CALL internal_setRaycastResult(Solid* solid, const Point3r& intersection, const Vec3r& normal, real distance); protected: /// The ODE world ID used by this Simulator. Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** ODESimulator.cpp 8 Mar 2005 22:05:04 -0000 1.86 --- ODESimulator.cpp 9 Mar 2005 02:09:50 -0000 1.87 *************** *** 812,816 **** //helper function for collision callback ! //void createOneSidedContact)dJointID contactJoint, dBodyID movingObject, // dBodyID staticObject, dVector3 pos) //{ --- 812,816 ---- //helper function for collision callback ! //void createOneSidedContact(dJointID contactJoint, dBodyID movingObject, // dBodyID staticObject, dVector3 pos) //{ *************** *** 846,850 **** Joint* ODESimulator::createJoint() ! { Joint* newJoint = new ODEJoint(mWorldID); addJoint(newJoint); --- 846,850 ---- Joint* ODESimulator::createJoint() ! { Joint* newJoint = new ODEJoint(mWorldID); addJoint(newJoint); *************** *** 852,855 **** --- 852,887 ---- } + const RaycastResult& ODESimulator::internal_fireRay(const Rayr& r) + { + Point3r origin = r.getOrigin(); + real length = r.getLength(); + Vec3r dir = r.getDir(); + + // Normalized the vector if possible. + if (0 != length) + { + dir.normalize(); + } + + mRaycastResult.solid = NULL; + mRaycastResult.intersection.set(0,0,0); + mRaycastResult.normal.set(1,0,0); + mRaycastResult.distance = 0; + + dGeomID rayGeomID = dCreateRay(mRootSpaceID, length); + dGeomRaySet(rayGeomID, origin[0], origin[1], origin[2], dir[0], + dir[1], dir[2]); + + // Check for collisions. This will fill mRaycastResult with valid + // data. Its Solid pointer will remain NULL if nothing was hit. + dSpaceCollide2(rayGeomID, (dGeomID)mRootSpaceID, this, + &ode_hidden::internal_raycastCollisionCallback); + + // Finished with ODE ray, so destroy it. + dGeomDestroy(rayGeomID); + + return mRaycastResult; + } + //void ODESimulator::collide(const Solid* solid, std::vector<Solid*>* solids) //{ *************** *** 879,910 **** //} - RaycastResult ODESimulator::shootRay(const Point3r& origin, - const Vec3r& dir, real length) - { - mRaycastResult.solid = NULL; - mRaycastResult.intersection.set(0,0,0); - mRaycastResult.normal.set(1,0,0); - mRaycastResult.distance = 0; - - dGeomID rayGeomID = dCreateRay(mRootSpaceID, length); - dGeomRaySet(rayGeomID, origin[0], origin[1], origin[2], dir[0], - dir[1], dir[2]); - - //check for collisions; this will fill mRaycastResult (if a collision occurs) - dSpaceCollide2(rayGeomID, (dGeomID)mRootSpaceID, this, - &ode_hidden::internal_raycastCollisionCallback); - - RaycastResult result; - result.solid = mRaycastResult.solid; //note that this may remain NULL - result.intersection = mRaycastResult.intersection; - result.normal = mRaycastResult.normal; - result.distance = mRaycastResult.distance; - - // Finished with ODE ray, so destroy it. - dGeomDestroy(rayGeomID); - - return result; - } - void ODESimulator::setGravity(const Vec3r& gravity) { --- 911,914 ---- |
|
From: tylerstreeter <tyl...@us...> - 2005-03-09 02:10:00
|
Update of /cvsroot/opal/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11688 Modified Files: todo.txt Log Message: added a RaycastSensor, which replaces the old Simulator ray casting functions Index: todo.txt =================================================================== RCS file: /cvsroot/opal/opal/todo.txt,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** todo.txt 8 Mar 2005 16:10:25 -0000 1.51 --- todo.txt 9 Mar 2005 02:09:51 -0000 1.52 *************** *** 2,27 **** ================= ! * look at scons dylib-building problem on os x * fix memory allocation across dll boundary - volume collision check results -> put results in a specific class - * certain function calls during collision events crash the system - - definitely bad: - - setStatic, setPosition, setTransform, setVelocity, setSpace, addShape, setSleeping, simulator::destroySolid/Joint, etc. - - maybe bad: - - setEnabled, translateMass - - solution: create an event queue and call the functions at a safe time - - don't use events when it's already "safe" (i.e. not in collision detection mode), just apply them instantly; i.e. have a "safe" boolean that's set to false only when in collision detection - - per step, or per frame? - - replace 'garbage' system with delayed destroy events - - alternative solution: just make collision callback calls happen at the end of the step; but this could be a problem because sometimes you might want to ignore contacts... but maybe it wouldn't matter if we don't return the boolean from the collision events and used some other contact-generation flag system (i.e. the "category/collide" bits); how should we handle this? - - * Add a boolean to Solid that determines if it generates contacts at all (the docking volume shouldn't collide with anything but should generate collision events still). - - maybe look at a more powerful solution with collide flags - - * reenable collision detection for static-static, static-sleeping cases (or have an option) - - solution: probably use collision groups for this - * make trimeshes work --- 2,14 ---- ================= ! * sensors ! - parse from xml ! - add to xml example ! - add to instantiateBlueprint ! - add to Blueprint finalize function * fix memory allocation across dll boundary - volume collision check results -> put results in a specific class * make trimeshes work *************** *** 33,36 **** --- 20,30 ---- - non-fatal errors just print a warning + * joint motion damping? + - useful for ragdolls + - one solution: just use a servo in desired vel mode, set desired vel to 0 + + * BeginStepEventHandler + - called at the start of a time step + * implement sensors - RaycastSensor (i.e. "PSD (position sensitive detector)" or "rangefinder"): measures distance from sensor to first intersection (attach to a solid [be sure to ignore collisions with the attached solid] or nothing) *************** *** 39,50 **** - not updated regularly; must be updated manually by user - should this be combined with trigger solids? probably not: ProximitySensors are one-time, triggers are always updated (triggers are actually just solids with a ContactSensor and don't generate contact joints) - - CollisionSensor - - hold a queue of collision events (attach to a solid, to a single shape, or to nothing?) - - use callback functions - - user-derived class - - vital part of "trigger volumes" - - not available in XML because they're derived; ignore these when saving and loading - - JointBreakSensor - - not available in XML because they're derived; ignore these when saving and loading - VelocitySensor: linear vel (i.e. "velocimeter") and/or angular vel ("gyroscope") sensor - AccelerationSensor (i.e. "accelerometer"): linear and/or angular acceleration sensor --- 33,36 ---- |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 22:37:49
|
Update of /cvsroot/opal/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23133 Modified Files: documentation.html downloads.html todo.txt Added Files: overview.html Removed Files: manual.html Log Message: renamed "manual" to "overview", because that's really what it is Index: documentation.html =================================================================== RCS file: /cvsroot/opal/web/documentation.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** documentation.html 8 Mar 2005 16:20:50 -0000 1.7 --- documentation.html 8 Mar 2005 22:37:37 -0000 1.8 *************** *** 25,39 **** <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> ! <o:Revision>94</o:Revision> ! <o:TotalTime>104</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> ! <o:LastSaved>2005-03-05T19:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> ! <o:Words>316</o:Words> ! <o:Characters>1805</o:Characters> <o:Company>none</o:Company> <o:Lines>15</o:Lines> <o:Paragraphs>4</o:Paragraphs> ! <o:CharactersWithSpaces>2117</o:CharactersWithSpaces> <o:Version>10.6714</o:Version> </o:DocumentProperties> --- 25,39 ---- <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> ! <o:Revision>97</o:Revision> ! <o:TotalTime>107</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> ! <o:LastSaved>2005-03-08T22:36:00Z</o:LastSaved> <o:Pages>1</o:Pages> ! <o:Words>317</o:Words> ! <o:Characters>1807</o:Characters> <o:Company>none</o:Company> <o:Lines>15</o:Lines> <o:Paragraphs>4</o:Paragraphs> ! <o:CharactersWithSpaces>2120</o:CharactersWithSpaces> <o:Version>10.6714</o:Version> </o:DocumentProperties> *************** *** 98,102 **** </style> <![endif]--><!--[if gte mso 9]><xml> ! <o:shapedefaults v:ext="edit" spidmax="52226"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> --- 98,102 ---- </style> <![endif]--><!--[if gte mso 9]><xml> ! <o:shapedefaults v:ext="edit" spidmax="54274"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> *************** *** 179,192 **** <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>If you are using OPAL for the first time, it is recommended that you read ! through the documentation in the following order: 1) manual, 2) tutorials, 3) ! API reference.<span style='mso-spacerun:yes'> </span>The manual and ! tutorials do not cover everything; they exist to help you learn to use OPAL ! quickly.<span style='mso-spacerun:yes'> </span>Consult the API reference for ! more details.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; ! color:black'><a href="manual.html">OPAL Manual</a></span><span ! style='font-family:"Book Antiqua";color:black'>: a short, high-level overview ! of the major components and how they work together.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; --- 179,191 ---- <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>If you are using OPAL for the first time, it is recommended that you read ! through the documentation in the following order: 1) overview, 2) tutorials, ! 3) API reference.<span style='mso-spacerun:yes'> </span>The overview and ! tutorials do not cover everything; they exist to help you learn to use OPAL quickly.<span ! style='mso-spacerun:yes'> </span>Consult the API reference for more details.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; ! color:black'><a href="overview.html">OPAL Overview</a></span><span ! style='font-family:"Book Antiqua";color:black'>: a short, high-level intro to ! the major components and how they work together.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; *************** *** 217,225 **** <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; color:black'><a href="tutorial7.html">Tutorial 7</a></span><span ! style='font-family:"Book Antiqua";color:black'>: OPAL XML Saving and Loading<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; ! color:black'><a href="tutorial7.html">Tutorial 8</a></span><span ! style='font-family:"Book Antiqua";color:black'>: Event Handlers<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; --- 216,224 ---- <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; color:black'><a href="tutorial7.html">Tutorial 7</a></span><span ! style='font-family:"Book Antiqua";color:black'>: Event Handlers<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; ! color:black'><a href="tutorial8.html">Tutorial 8</a></span><span ! style='font-family:"Book Antiqua";color:black'>: OPAL XML Saving and Loading<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; *************** *** 237,241 **** style='font-family:"Book Antiqua";color:black'>: a detailed description of everything in OPAL.<span style='mso-spacerun:yes'> </span>If a particular ! concept isnt discussed in the manual or tutorials, check here.</span><span style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:black'><o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";mso-bidi-font-family: --- 236,240 ---- style='font-family:"Book Antiqua";color:black'>: a detailed description of everything in OPAL.<span style='mso-spacerun:yes'> </span>If a particular ! concept isnt discussed in the overview or tutorials, check here.</span><span style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:black'><o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";mso-bidi-font-family: Index: todo.txt =================================================================== RCS file: /cvsroot/opal/web/todo.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** todo.txt 8 Mar 2005 16:20:51 -0000 1.4 --- todo.txt 8 Mar 2005 22:37:37 -0000 1.5 *************** *** 1,5 **** For Version 0.3.0 ================= ! * manual - add diagrams --- 1,5 ---- For Version 0.3.0 ================= ! * overview - add diagrams *************** *** 7,10 **** --- 7,11 ---- - move XML samples into xml tutorial; or maybe have a Blueprints page on the OPAL site; maybe remove example.xml and just describe every xml element/attribute somewhere) - describe trigger volumes somewhere + - add diagrams * post api notes *************** *** 12,16 **** For Version 0.4.0 ================= ! * add a faq to docs page/manual - Q: which physics engines will be supported in the future? - A: The focus is on cross-platform, Open Source physics engines. Currently there are not a lot of options available besides ODE, but if other fully-featured engines of this type come along, OPAL will be ready to integrate them. --- 13,17 ---- For Version 0.4.0 ================= ! * add a faq to docs page/overview - Q: which physics engines will be supported in the future? - A: The focus is on cross-platform, Open Source physics engines. Currently there are not a lot of options available besides ODE, but if other fully-featured engines of this type come along, OPAL will be ready to integrate them. *************** *** 18,22 **** ! Preliminary Manual Notes ======================== --- 19,23 ---- ! Preliminary Overview Notes ======================== --- NEW FILE: overview.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 10"> <meta name=Originator content="Microsoft Word 10"> <link rel=File-List href="overview_files/filelist.xml"> <link rel=Edit-Time-Data href="overview_files/editdata.mso"> <!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--> <title>OPAL: Open Physics Abstraction Layer</title> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> <o:Revision>99</o:Revision> <o:TotalTime>165</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> <o:LastSaved>2005-03-08T22:33:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>416</o:Words> <o:Characters>2372</o:Characters> <o:Company>none</o:Company> <o:Lines>19</o:Lines> <o:Paragraphs>5</o:Paragraphs> <o:CharactersWithSpaces>2783</o:CharactersWithSpaces> <o:Version>10.6714</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:SpellingState>Clean</w:SpellingState> <w:GrammarState>Clean</w:GrammarState> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> <style> <!-- /* Font Definitions */ @font-face {font-family:"Book Antiqua"; panose-1:2 4 6 2 5 3 5 3 3 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:647 0 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; color:white;} a:link, span.MsoHyperlink {color:#3366FF; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:#000066; text-decoration:underline; text-underline:single;} span.SpellE {mso-style-name:""; mso-spl-e:yes;} span.GramE {mso-style-name:""; mso-gram-e:yes;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:250621957; mso-list-template-ids:-759426884;} @list l0:level1 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} @list l1 {mso-list-id:331566560; mso-list-template-ids:-1562768502;} @list l1:level1 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} @list l2 {mso-list-id:478962415; mso-list-template-ids:1417844744;} @list l2:level1 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} @list l3 {mso-list-id:482813319; mso-list-type:hybrid; mso-list-template-ids:-413384936 67698691 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l3:level1 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; font-family:"Courier New";} @list l3:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} @list l4 {mso-list-id:935554082; mso-list-template-ids:1353771306;} @list l4:level1 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} @list l5 {mso-list-id:977732788; mso-list-template-ids:1142328856;} @list l5:level1 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} @list l6 {mso-list-id:1377509408; mso-list-type:hybrid; mso-list-template-ids:986361314 67698691 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l6:level1 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; font-family:"Courier New";} @list l6:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} @list l6:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} @list l6:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} @list l6:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} @list l6:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} @list l6:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} @list l6:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} @list l6:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} @list l7 {mso-list-id:1543900918; mso-list-template-ids:1052961724;} @list l7:level1 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} @list l8 {mso-list-id:1660957522; mso-list-template-ids:524451748;} @list l8:level1 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} @list l9 {mso-list-id:2121534931; mso-list-template-ids:-289104414;} @list l9:level1 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} ol {margin-bottom:0in;} ul {margin-bottom:0in;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="48130"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--> </head> <body bgcolor=white lang=EN-US link="#3366FF" vlink="#000066" style='tab-interval: .5in' alink="#ffcc33"> <div class=Section1> <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="95%" style='width:95.58%;mso-cellspacing:0in;mso-padding-alt:7.5pt 7.5pt 7.5pt 7.5pt'> <tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes'> <td width=1295 valign=top style='width:777.0pt;padding:7.5pt 7.5pt 7.5pt 7.5pt'> <p class=MsoNormal align=center style='text-align:center'><span style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:black'><o:p> </o:p></span></p> <p class=MsoNormal align=center style='text-align:center'><span style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:black'><o:p> </o:p></span></p> <p class=MsoNormal align=center style='text-align:center'><span style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:#333333'><img width=534 height=129 id="_x0000_i1025" src="files/opal_logo.jpg" border=0><o:p></o:p></span></p> <p class=MsoNormal align=center style='text-align:center'><span style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:black'><o:p> </o:p></span></p> <p class=MsoNormal align=center style='text-align:center'><span style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:black'><o:p> </o:p></span></p> <p class=MsoNormal align=center style='text-align:center'><span style='font-size:22.0pt;font-family:"Book Antiqua";mso-bidi-font-family:Arial; color:black'>OPAL Overview<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:20.0pt;font-family:"Book Antiqua";color:black'>Introduction<o:p></o:p></span></b></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>This is a short, simple overview of <span class=SpellE>OPALs</span> components.<span style='mso-spacerun:yes'> </span>It is meant to give you a general understanding of how the different objects work together.<span style='mso-spacerun:yes'> </span>It will first cover the most important OPAL objects, <span class=GramE>then</span> describe a few others that arent as critical to understanding how the system works.<span style='mso-spacerun:yes'> </span>More specific instructions for creating and managing these objects can be found in the tutorials.<span style='mso-spacerun:yes'> </span>Additionally, the API reference contains more details about every OPAL class, <span class=SpellE>struct</span>, function, variable, etc.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:20.0pt;font-family:"Book Antiqua";color:black'>Main Objects<o:p></o:p></span></b></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <ul style='margin-top:0in' type=circle> <li class=MsoNormal style='color:black;mso-list:l6 level1 lfo3;tab-stops: list .5in'><b style='mso-bidi-font-weight:normal'><span style='font-size:14.0pt;font-family:"Book Antiqua"'>Simulators</span></b><span style='font-family:"Book Antiqua"'>: Simulators are factories that create, maintain, and destroy most other objects.<span style='mso-spacerun:yes'> </span>They encapsulate all collision detection and physics simulation.<o:p></o:p></span></li> </ul> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <ul style='margin-top:0in' type=circle> <li class=MsoNormal style='color:black;mso-list:l6 level1 lfo3;tab-stops: list .5in'><b style='mso-bidi-font-weight:normal'><span style='font-size:14.0pt;font-family:"Book Antiqua"'>Solids</span></b><span style='font-family:"Book Antiqua"'>: A Solid is analogous to a physical object in the real world.<span style='mso-spacerun:yes'> </span>It can be static (just a shape, not physically simulated) or dynamic (has a shape, mass, and is physically simulated).<span style='mso-spacerun:yes'> </span>It contains no moving parts.<span style='mso-spacerun:yes'> </span>Complex objects with moving parts can be built from multiple Solids with Joints.<o:p></o:p></span></li> </ul> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <ul style='margin-top:0in' type=circle> <li class=MsoNormal style='color:black;mso-list:l6 level1 lfo3;tab-stops: list .5in'><b style='mso-bidi-font-weight:normal'><span style='font-size:14.0pt;font-family:"Book Antiqua"'>Joints</span></b><span style='font-family:"Book Antiqua"'>: Joints connect two Solids, constraining their relative motion.<span style='mso-spacerun:yes'> </span>There are several types of Joints, each constraining motion in different ways.<o:p></o:p></span></li> </ul> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <ul style='margin-top:0in' type=circle> <li class=MsoNormal style='color:black;mso-list:l6 level1 lfo3;tab-stops: list .5in'><b style='mso-bidi-font-weight:normal'><span style='font-size:14.0pt;font-family:"Book Antiqua"'>Motors</span></b><span style='font-family:"Book Antiqua"'>: A Motor applies forces/torques to Solids or Joints to achieve some desired effect.<span style='mso-spacerun:yes'> </span>There are several types of Motors.<span style='mso-spacerun:yes'> </span><o:p></o:p></span></li> </ul> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <ul style='margin-top:0in' type=circle> <li class=MsoNormal style='color:black;mso-list:l6 level1 lfo3;tab-stops: list .5in'><b style='mso-bidi-font-weight:normal'><span style='font-size:14.0pt;font-family:"Book Antiqua"'>Sensors</span></b><span style='font-family:"Book Antiqua"'>: Sensors acquire data from a simulation.<span style='mso-spacerun:yes'> </span>There are several types of Sensors.<span style='mso-spacerun:yes'> </span>Some can be attached to Solids, some can be set to a static position in the environment, and some can work either way.<o:p></o:p></span></li> </ul> <p class=MsoNormal><span style='font-family:"Book Antiqua";mso-bidi-font-family: Arial;color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";mso-bidi-font-family: Arial;color:black'><o:p> </o:p></span></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:20.0pt;font-family:"Book Antiqua";color:black'>Other Objects<o:p></o:p></span></b></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <ul style='margin-top:0in' type=circle> <li class=MsoNormal style='color:black;mso-list:l3 level1 lfo10;tab-stops: list .5in'><b style='mso-bidi-font-weight:normal'><span style='font-size:14.0pt;font-family:"Book Antiqua"'>Shapes</span></b><span style='font-family:"Book Antiqua"'>: Shapes are used for collision detection.<span style='mso-spacerun:yes'> </span>They are added to Solids; if a Solid doesnt contain any Shapes, it cannot collide with anything.<span style='mso-spacerun:yes'> </span>There are several types of Shapes.<span style='mso-spacerun:yes'> </span>Each Shape can use a different Material<o:p></o:p></span></li> </ul> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <ul style='margin-top:0in' type=circle> <li class=MsoNormal style='color:black;mso-list:l3 level1 lfo10;tab-stops: list .5in'><b style='mso-bidi-font-weight:normal'><span style='font-size:14.0pt;font-family:"Book Antiqua";mso-bidi-font-family: Arial'>Materials</span></b><span style='font-family:"Book Antiqua"; mso-bidi-font-family:Arial'>: Materials define what happens when two Solids (or, more specifically, two Shapes) collide.<span style='mso-spacerun:yes'> </span>Materials consist of several properties, including friction, bounciness, density, etc.</span><span style='font-family:"Book Antiqua"'><o:p></o:p></span></li> </ul> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <ul style='margin-top:0in' type=circle> <li class=MsoNormal style='color:black;mso-list:l3 level1 lfo10;tab-stops: list .5in'><b style='mso-bidi-font-weight:normal'><span style='font-size:14.0pt;font-family:"Book Antiqua"'>Data objects and Blueprints</span></b><span style='font-family:"Book Antiqua"'>: Each of the main OPAL objects stores an internal data structure describing the object in detail.<span style='mso-spacerun:yes'> </span>These data structures can be built from scratch and used to generate several identical objects.<span style='mso-spacerun:yes'> </span>They can be retrieved from an existing object and used to make clones.<span style='mso-spacerun:yes'> </span>They can also be used to construct OPAL Blueprints.<span style='mso-spacerun:yes'> </span>Blueprints are collections of complex systems involving Solids, Joints, Motors, and/or Sensors.<span style='mso-spacerun:yes'> </span>They can be constructed from a set of manually-designed data structures or from data structures pulled out of a set of existing objects.<span style='mso-spacerun:yes'> </span>They can be saved to and loaded from <span class=SpellE>OPALs</span> XML-based file format.<o:p></o:p></span></li> </ul> </td> </tr> </table> <p class=MsoNormal align=center style='margin-bottom:12.0pt;text-align:center'><span style='font-size:10.0pt;font-family:"Book Antiqua";mso-bidi-font-family:Arial; color:#333333'><o:p> </o:p></span></p> <p class=MsoNormal align=center style='margin-bottom:12.0pt;text-align:center'><span style='font-size:8.0pt;font-family:"Book Antiqua";mso-bidi-font-family:Arial; color:black'>OPAL is Copyright © 2004-2005 Alan Fischer, Andres Reinot, and Tyler Streeter<o:p></o:p></span></p> </div> </body> </html> --- manual.html DELETED --- Index: downloads.html =================================================================== RCS file: /cvsroot/opal/web/downloads.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** downloads.html 25 Feb 2005 19:56:17 -0000 1.1 --- downloads.html 8 Mar 2005 22:37:37 -0000 1.2 *************** *** 25,44 **** <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> ! <o:Revision>76</o:Revision> ! <o:TotalTime>74</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> ! <o:LastSaved>2005-02-25T19:45:00Z</o:LastSaved> <o:Pages>1</o:Pages> ! <o:Words>147</o:Words> ! <o:Characters>844</o:Characters> <o:Company>none</o:Company> <o:Lines>7</o:Lines> <o:Paragraphs>1</o:Paragraphs> ! <o:CharactersWithSpaces>990</o:CharactersWithSpaces> <o:Version>10.6714</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> - <w:Zoom>BestFit</w:Zoom> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> --- 25,43 ---- <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> ! <o:Revision>77</o:Revision> ! <o:TotalTime>75</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> ! <o:LastSaved>2005-03-08T14:22:00Z</o:LastSaved> <o:Pages>1</o:Pages> ! <o:Words>148</o:Words> ! <o:Characters>846</o:Characters> <o:Company>none</o:Company> <o:Lines>7</o:Lines> <o:Paragraphs>1</o:Paragraphs> ! <o:CharactersWithSpaces>993</o:CharactersWithSpaces> <o:Version>10.6714</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> *************** *** 99,103 **** </style> <![endif]--><!--[if gte mso 9]><xml> ! <o:shapedefaults v:ext="edit" spidmax="41986"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> --- 98,102 ---- </style> <![endif]--><!--[if gte mso 9]><xml> ! <o:shapedefaults v:ext="edit" spidmax="43010"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> *************** *** 152,156 **** Arial;color:#333333'><a href="http://sourceforge.net/projects/opal"><span style='color:#333333;text-decoration:none;text-underline:none'><img border=0 ! width=88 height=31 id="_x0000_i1027" src="files/sf_logo.png"></span></a><o:p></o:p></span></p> <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; mso-bidi-font-family:Arial;color:#333333'><o:p> </o:p></span></p> --- 151,155 ---- Arial;color:#333333'><a href="http://sourceforge.net/projects/opal"><span style='color:#333333;text-decoration:none;text-underline:none'><img border=0 ! width=88 height=31 id="_x0000_i1025" src="files/sf_logo.png"></span></a><o:p></o:p></span></p> <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; mso-bidi-font-family:Arial;color:#333333'><o:p> </o:p></span></p> *************** *** 158,162 **** Arial;color:#333333'><a href="http://www.opensource.org/"><span style='color:#333333;text-decoration:none;text-underline:none'><img border=0 ! width=75 height=65 id="_x0000_i1025" src="files/opensource_logo.png"></span></a><o:p></o:p></span></p> </td> <td width=1145 valign=top style='width:687.0pt;padding:7.5pt 7.5pt 7.5pt 7.5pt'> --- 157,161 ---- Arial;color:#333333'><a href="http://www.opensource.org/"><span style='color:#333333;text-decoration:none;text-underline:none'><img border=0 ! width=75 height=65 id="_x0000_i1026" src="files/opensource_logo.png"></span></a><o:p></o:p></span></p> </td> <td width=1145 valign=top style='width:687.0pt;padding:7.5pt 7.5pt 7.5pt 7.5pt'> *************** *** 167,171 **** <p class=MsoNormal align=center style='text-align:center'><span style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:#333333'><img ! border=0 width=534 height=129 id="_x0000_i1026" src="files/opal_logo.jpg"><o:p></o:p></span></p> <p class=MsoNormal align=center style='text-align:center'><span style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:black'><o:p> </o:p></span></p> --- 166,170 ---- <p class=MsoNormal align=center style='text-align:center'><span style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:#333333'><img ! border=0 width=534 height=129 id="_x0000_i1027" src="files/opal_logo.jpg"><o:p></o:p></span></p> <p class=MsoNormal align=center style='text-align:center'><span style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:black'><o:p> </o:p></span></p> *************** *** 178,187 **** color:black'>Downloads<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> ! <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>All ! downloads are hosted on SourceForge.<span style='mso-spacerun:yes'> ! </span>Visit the <a href="http://sourceforge.net/projects/opal">OPAL ! SourceForge project page</a> to download source code, compiled binary files, ! and documentation.</span><span style='font-family:"Book Antiqua";mso-bidi-font-family: ! Arial;color:black'><o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";mso-bidi-font-family: Arial;color:black'><o:p> </o:p></span></p> --- 177,185 ---- color:black'>Downloads<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> ! <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>All downloads ! are hosted on SourceForge.<span style='mso-spacerun:yes'> </span>Visit the <a ! href="http://sourceforge.net/projects/opal">OPAL SourceForge project page</a> ! to download source code and compiled binary files.</span><span ! style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:black'><o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";mso-bidi-font-family: Arial;color:black'><o:p> </o:p></span></p> |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 22:37:48
|
Update of /cvsroot/opal/web/files In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23133/files Modified Files: example.xml Log Message: renamed "manual" to "overview", because that's really what it is Index: example.xml =================================================================== RCS file: /cvsroot/opal/web/files/example.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** example.xml 8 Mar 2005 16:20:51 -0000 1.5 --- example.xml 8 Mar 2005 22:37:37 -0000 1.6 *************** *** 53,56 **** --- 53,57 ---- <AccumThresh value="0.0"/> <AccumDamage value="0.0"/> + <ContactsEnabled value="false"/> <Axis> <AxisNum value="0"/> |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 22:05:23
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13926/src/ODE Modified Files: ODEJoint.cpp ODEJoint.h ODESimulator.cpp ODESimulator.h Log Message: added a "contacts enabled" feature to Joints Index: ODESimulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.h,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** ODESimulator.h 3 Mar 2005 04:39:57 -0000 1.58 --- ODESimulator.h 8 Mar 2005 22:05:05 -0000 1.59 *************** *** 132,136 **** { // These function don't use the OPAL_CALL calling convention ! // because they are functors passed to ODE which expects a different // calling convention. --- 132,136 ---- { // These function don't use the OPAL_CALL calling convention ! // because they are functors passed to ODE, which expects a different // calling convention. *************** *** 138,141 **** --- 138,146 ---- void internal_collisionCallback(void* data, dGeomID o0, dGeomID o1); + /// Assuming the two ODE bodies are connected by an ODE joint, this + /// function returns the OPAL Joint connecting the two bodies' + /// Solids. + Joint* internal_getCommonJoint(dBodyID body0, dBodyID body1); + /// Special collision callback functor for volume collision /// checking. Index: ODEJoint.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODEJoint.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ODEJoint.h 4 Mar 2005 23:26:54 -0000 1.31 --- ODEJoint.h 8 Mar 2005 22:05:04 -0000 1.32 *************** *** 74,77 **** --- 74,80 ---- real value); + /// Returns the ODE joint ID of this ODEJoint. + dJointID OPAL_CALL internal_getJointID()const; + protected: virtual void setAxis(int axisNum, const JointAxis& axis); Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** ODESimulator.cpp 8 Mar 2005 16:10:24 -0000 1.85 --- ODESimulator.cpp 8 Mar 2005 22:05:04 -0000 1.86 *************** *** 291,302 **** // 5. Two Solids connected by a Joint (besides ODE // contact joints, which never generate ! // contacts) (note: both must have ! // bodies to check this): this is enforced for now; it ! // might be nice to have a Joint option that says whether ! // the Joint's two ! // Solids generate contacts with each other... I'll ! // mark that as a TODO; if this is implemented, be sure ! // to update the comments for ! // Simulator::setupContactGroups. // 6. Solid0 is static and Solid1 is sleeping: not enforced // because sometimes you might want to wake up a sleeping --- 291,296 ---- // 5. Two Solids connected by a Joint (besides ODE // contact joints, which never generate ! // contacts) with contacts disabled; (note: both must have ! // bodies to check this): this is enforced. // 6. Solid0 is static and Solid1 is sleeping: not enforced // because sometimes you might want to wake up a sleeping *************** *** 314,321 **** } ! // TODO: find a way to get access to the Joint* for #5... ! // check if ODE has user data* for joints. If this ! // doesn't work, just have a boolean in the Simulator that ! // affects all Joints. if (//(0 == o0BodyID && 0 == o1BodyID) //case 1 --- 308,319 ---- } ! Joint* commonJoint = NULL; ! if (bothHaveBodies && dAreConnectedExcluding(o0BodyID, ! o1BodyID, dJointTypeContact)) ! { ! // This will become non-NULL only if there exists an ODE ! // joint connecting the two bodies. ! commonJoint = internal_getCommonJoint(o0BodyID, o1BodyID); ! } if (//(0 == o0BodyID && 0 == o1BodyID) //case 1 *************** *** 323,330 **** (bothHaveBodies && !dBodyIsEnabled(o0BodyID) && !dBodyIsEnabled(o1BodyID)) //case 3 ! //|| (connected by a fixed joint) // case 4 TODO ! || (bothHaveBodies && dAreConnectedExcluding( ! o0BodyID, o1BodyID, dJointTypeContact)) //&& TODO ! //jointContactsEnabled) //case 5 //|| (0 == o0BodyID && !dBodyIsEnabled(o1BodyID)) //case 6 //|| (0 == o1BodyID && !dBodyIsEnabled(o0BodyID)) //case 7 --- 321,328 ---- (bothHaveBodies && !dBodyIsEnabled(o0BodyID) && !dBodyIsEnabled(o1BodyID)) //case 3 ! || (commonJoint && ! commonJoint->getType() == FIXED_JOINT) // case 4 ! || (commonJoint && ! !commonJoint->areContactsEnabled()) // case 5 //|| (0 == o0BodyID && !dBodyIsEnabled(o1BodyID)) //case 6 //|| (0 == o1BodyID && !dBodyIsEnabled(o0BodyID)) //case 7 *************** *** 650,653 **** --- 648,687 ---- } + Joint* internal_getCommonJoint(dBodyID body0, dBodyID body1) + { + // First we need to find the ODE joint connecting the bodies + // (it would be ideal if ODE included this functionality...). + // We only need to check one of the bodies' ODE joints + // because it is assumed here that the two bodies are + // connected, thus they should have a common ODE joint. + int numJoints0 = dBodyGetNumJoints(body0); + dJointID theJoint = 0; + + // Loop through body0's ODE joints. + int i=0; + for (i=0; i<numJoints0; ++i) + { + dJointID currentJoint = dBodyGetJoint(body0, i); + dBodyID jointBody0 = dJointGetBody(currentJoint, 0); + dBodyID jointBody1 = dJointGetBody(currentJoint, 1); + + if ((jointBody0 == body0 && jointBody1 == body1) || + (jointBody0 == body1 && jointBody1 == body0)) + { + // This is the ODE joint connecting the two bodies. + // Note that if the two bodies are connected by multiple + // Joints, the behavior is undefined. + theJoint = currentJoint; + } + } + + // Make sure the ODE joint was actually found. This should + // be guaranteed. + assert(theJoint); + + // Now return the associated OPAL Joint. + return (Joint*)dJointGetData(theJoint); + } + // Note: o0 should always be the main object (the geom to check against // everything else). Index: ODEJoint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODEJoint.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ODEJoint.cpp 8 Mar 2005 16:10:24 -0000 1.28 --- ODEJoint.cpp 8 Mar 2005 22:05:03 -0000 1.29 *************** *** 208,211 **** --- 208,221 ---- setAxis(1, data.axis[1]); setAxis(2, data.axis[2]); + + // Set the ODE joint's userdata pointer. + if (BALL_JOINT == mData.getType()) + { + dJointSetData(mAMotorID, this); + } + else + { + dJointSetData(mJointID, this); + } } *************** *** 865,868 **** --- 875,890 ---- } + dJointID ODEJoint::internal_getJointID()const + { + if (BALL_JOINT == mData.getType()) + { + return mAMotorID; + } + else + { + return mJointID; + } + } + void ODEJoint::attachODEBodies(Solid* s0, Solid* s1) { |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 22:05:23
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13926/src Modified Files: BlueprintManager.cpp Defines.h Joint.cpp Joint.h JointData.h Simulator.h Log Message: added a "contacts enabled" feature to Joints Index: Defines.h =================================================================== RCS file: /cvsroot/opal/opal/src/Defines.h,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** Defines.h 8 Mar 2005 16:10:23 -0000 1.67 --- Defines.h 8 Mar 2005 22:05:02 -0000 1.68 *************** *** 328,332 **** const real breakThresh = (real)100.0; const real accumThresh = (real)1000.0; ! const bool enableContacts = false; } --- 328,332 ---- const real breakThresh = (real)100.0; const real accumThresh = (real)1000.0; ! const bool contactsEnabled = false; } Index: BlueprintManager.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/BlueprintManager.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** BlueprintManager.cpp 5 Mar 2005 21:26:23 -0000 1.30 --- BlueprintManager.cpp 8 Mar 2005 22:05:02 -0000 1.31 *************** *** 486,489 **** --- 486,512 ---- } + // Load ContactsEnabled element if it exists. + paramNodePtr = + const_cast<TiXmlNode*>(nodePtr)->FirstChild("ContactsEnabled"); + if (NULL != paramNodePtr) + { + std::string value = getAttributeString(paramNodePtr, "value"); + if ("true" == value) + { + data->contactsEnabled = true; + } + else if ("false" == value) + { + data->contactsEnabled = false; + } + else + { + OPAL_LOGGER("warning") << + "opal::BlueprintManager::loadJoint: Invalid value " + << value << " for Joint ContactsEnabled parameter in " + << filename << " will be ignored." << std::endl; + } + } + // Loop over Axis elements if they exist. TiXmlNode* axisNodePtr = NULL; Index: Joint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Joint.cpp 8 Mar 2005 16:10:23 -0000 1.25 --- Joint.cpp 8 Mar 2005 22:05:03 -0000 1.26 *************** *** 67,70 **** --- 67,80 ---- } + void Joint::setContactsEnabled(bool e) + { + mData.contactsEnabled; + } + + bool Joint::areContactsEnabled()const + { + return mData.contactsEnabled; + } + JointType Joint::getType()const { Index: Joint.h =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.h,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Joint.h 8 Mar 2005 16:10:23 -0000 1.63 --- Joint.h 8 Mar 2005 22:05:03 -0000 1.64 *************** *** 74,77 **** --- 74,85 ---- virtual const std::string& OPAL_CALL getName()const; + /// Sets whether the Joint's two Solids are constrained by + /// physical contacts. + virtual void OPAL_CALL setContactsEnabled(bool e); + + /// Returns whether the Joint's two Solids are constrained by + /// physical contacts. + virtual bool OPAL_CALL areContactsEnabled()const; + /// Returns the Joint type. virtual JointType OPAL_CALL getType()const; Index: JointData.h =================================================================== RCS file: /cvsroot/opal/opal/src/JointData.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JointData.h 8 Mar 2005 16:10:23 -0000 1.4 --- JointData.h 8 Mar 2005 22:05:03 -0000 1.5 *************** *** 103,107 **** accumThresh = defaults::joint::accumThresh; accumDamage = 0; ! enableContacts = defaults::joint::enableContacts; } --- 103,107 ---- accumThresh = defaults::joint::accumThresh; accumDamage = 0; ! contactsEnabled = defaults::joint::contactsEnabled; } *************** *** 139,143 **** accumThresh = data.accumThresh; accumDamage = data.accumDamage; ! enableContacts = data.enableContacts; } --- 139,143 ---- accumThresh = data.accumThresh; accumDamage = data.accumDamage; ! contactsEnabled = data.contactsEnabled; } *************** *** 199,204 **** /// Determines whether Solids connected by this Joint should make ! /// contacts when they collide. ! bool enableContacts; protected: --- 199,206 ---- /// Determines whether Solids connected by this Joint should make ! /// contacts when they collide. If multiple Joints connect the same ! /// two Solids, each with different contactsEnabled settings, ! /// the behavior is undefined. ! bool contactsEnabled; protected: Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** Simulator.h 8 Mar 2005 16:10:23 -0000 1.80 --- Simulator.h 8 Mar 2005 22:05:03 -0000 1.81 *************** *** 160,164 **** /// each other. Keep in mind that the following cases are already /// ignored when performing collision detection: two sleeping ! /// Solids don't collide, two Solids connected by a fixed Joint /// don't collide; two Solids connected by a Joint with its /// contacts enabled property set to false don't collide. --- 160,164 ---- /// each other. Keep in mind that the following cases are already /// ignored when performing collision detection: two sleeping ! /// Solids don't collide; two Solids connected by a fixed Joint /// don't collide; two Solids connected by a Joint with its /// contacts enabled property set to false don't collide. |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 16:21:05
|
Update of /cvsroot/opal/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14739 Modified Files: documentation.html index.html todo.txt Log Message: minor changes Index: documentation.html =================================================================== RCS file: /cvsroot/opal/web/documentation.html,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** documentation.html 3 Mar 2005 02:22:48 -0000 1.6 --- documentation.html 8 Mar 2005 16:20:50 -0000 1.7 *************** *** 25,45 **** <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> ! <o:Revision>93</o:Revision> ! <o:TotalTime>103</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> ! <o:LastSaved>2005-03-03T02:21:00Z</o:LastSaved> <o:Pages>1</o:Pages> ! <o:Words>307</o:Words> ! <o:Characters>1754</o:Characters> <o:Company>none</o:Company> ! <o:Lines>14</o:Lines> <o:Paragraphs>4</o:Paragraphs> ! <o:CharactersWithSpaces>2057</o:CharactersWithSpaces> <o:Version>10.6714</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> - <w:Zoom>90</w:Zoom> - <w:GrammarState>Clean</w:GrammarState> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> --- 25,43 ---- <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> ! <o:Revision>94</o:Revision> ! <o:TotalTime>104</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> ! <o:LastSaved>2005-03-05T19:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> ! <o:Words>316</o:Words> ! <o:Characters>1805</o:Characters> <o:Company>none</o:Company> ! <o:Lines>15</o:Lines> <o:Paragraphs>4</o:Paragraphs> ! <o:CharactersWithSpaces>2117</o:CharactersWithSpaces> <o:Version>10.6714</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> *************** *** 73,79 **** text-decoration:underline; text-underline:single;} - span.GramE - {mso-style-name:""; - mso-gram-e:yes;} @page Section1 {size:8.5in 11.0in; --- 71,74 ---- *************** *** 103,107 **** </style> <![endif]--><!--[if gte mso 9]><xml> ! <o:shapedefaults v:ext="edit" spidmax="51202"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> --- 98,102 ---- </style> <![endif]--><!--[if gte mso 9]><xml> ! <o:shapedefaults v:ext="edit" spidmax="52226"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> *************** *** 225,228 **** --- 220,227 ---- <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; + color:black'><a href="tutorial7.html">Tutorial 8</a></span><span + style='font-family:"Book Antiqua";color:black'>: Event Handlers<o:p></o:p></span></p> + <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> + <p class=MsoNormal><span style='font-size:14.0pt;font-family:"Book Antiqua"; color:black'><a href="files/example.xml">Sample OPAL XML</a></span><span style='font-family:"Book Antiqua";color:black'>: file containing examples of *************** *** 238,244 **** style='font-family:"Book Antiqua";color:black'>: a detailed description of everything in OPAL.<span style='mso-spacerun:yes'> </span>If a particular ! concept isnt discussed in the manual or <span class=GramE>tutorials,</span> ! check here.</span><span style='font-family:"Book Antiqua";mso-bidi-font-family: ! Arial;color:black'><o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";mso-bidi-font-family: Arial;color:black'><o:p> </o:p></span></p> --- 237,242 ---- style='font-family:"Book Antiqua";color:black'>: a detailed description of everything in OPAL.<span style='mso-spacerun:yes'> </span>If a particular ! concept isnt discussed in the manual or tutorials, check here.</span><span ! style='font-family:"Book Antiqua";mso-bidi-font-family:Arial;color:black'><o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";mso-bidi-font-family: Arial;color:black'><o:p> </o:p></span></p> Index: todo.txt =================================================================== RCS file: /cvsroot/opal/web/todo.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** todo.txt 2 Mar 2005 19:25:53 -0000 1.3 --- todo.txt 8 Mar 2005 16:20:51 -0000 1.4 *************** *** 4,8 **** - add diagrams ! * tutorials (move XML samples into xml tutorial; maybe remove example.xml and just describe every xml element/attribute somewhere) * post api notes --- 4,10 ---- - add diagrams ! * tutorials ! - move XML samples into xml tutorial; or maybe have a Blueprints page on the OPAL site; maybe remove example.xml and just describe every xml element/attribute somewhere) ! - describe trigger volumes somewhere * post api notes *************** *** 68,71 **** --- 70,79 ---- * all objects are created with default parameters + * describe the different between contacts and collision events + - contacts are physical constraints that keep objects from passing through each other + - collision events are messages sent to CollisionEventHandlers when two objects collide + + * explain "internal_" + * OPAL contains several math classes Index: index.html =================================================================== RCS file: /cvsroot/opal/web/index.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.html 1 Mar 2005 05:06:34 -0000 1.4 --- index.html 8 Mar 2005 16:20:50 -0000 1.5 *************** *** 25,44 **** <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> ! <o:Revision>93</o:Revision> <o:TotalTime>185</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> ! <o:LastSaved>2005-02-28T20:10:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>353</o:Words> ! <o:Characters>2013</o:Characters> <o:Company>none</o:Company> <o:Lines>16</o:Lines> <o:Paragraphs>4</o:Paragraphs> ! <o:CharactersWithSpaces>2362</o:CharactersWithSpaces> <o:Version>10.6714</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> - <w:Zoom>90</w:Zoom> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> --- 25,43 ---- <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> ! <o:Revision>94</o:Revision> <o:TotalTime>185</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> ! <o:LastSaved>2005-03-05T21:23:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>353</o:Words> ! <o:Characters>2014</o:Characters> <o:Company>none</o:Company> <o:Lines>16</o:Lines> <o:Paragraphs>4</o:Paragraphs> ! <o:CharactersWithSpaces>2363</o:CharactersWithSpaces> <o:Version>10.6714</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> *************** *** 82,87 **** /* List Definitions */ @list l0 ! {mso-list-id:165675122; ! mso-list-template-ids:1648548578;} @list l0:level1 {mso-level-number-format:bullet; --- 81,86 ---- /* List Definitions */ @list l0 ! {mso-list-id:115409783; ! mso-list-template-ids:551446078;} @list l0:level1 {mso-level-number-format:bullet; *************** *** 93,98 **** font-family:Symbol;} @list l1 ! {mso-list-id:197016475; ! mso-list-template-ids:-1377924264;} @list l1:level1 {mso-level-number-format:bullet; --- 92,97 ---- font-family:Symbol;} @list l1 ! {mso-list-id:291595687; ! mso-list-template-ids:152726192;} @list l1:level1 {mso-level-number-format:bullet; *************** *** 197,202 **** text-indent:-.25in;} @list l4 ! {mso-list-id:1537161361; ! mso-list-template-ids:-1892780142;} @list l4:level1 {mso-level-number-format:bullet; --- 196,201 ---- text-indent:-.25in;} @list l4 ! {mso-list-id:1435324032; ! mso-list-template-ids:2048665346;} @list l4:level1 {mso-level-number-format:bullet; *************** *** 355,360 **** text-indent:-.25in;} @list l8 ! {mso-list-id:1852790110; ! mso-list-template-ids:1589906662;} @list l8:level1 {mso-level-number-format:bullet; --- 354,359 ---- text-indent:-.25in;} @list l8 ! {mso-list-id:1782603386; ! mso-list-template-ids:-2078486872;} @list l8:level1 {mso-level-number-format:bullet; *************** *** 366,371 **** font-family:Symbol;} @list l9 ! {mso-list-id:2066367664; ! mso-list-template-ids:-1841290904;} @list l9:level1 {mso-level-number-format:bullet; --- 365,370 ---- font-family:Symbol;} @list l9 ! {mso-list-id:1798143110; ! mso-list-template-ids:-325428240;} @list l9:level1 {mso-level-number-format:bullet; *************** *** 399,403 **** </style> <![endif]--><!--[if gte mso 9]><xml> ! <o:shapedefaults v:ext="edit" spidmax="44034"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> --- 398,402 ---- </style> <![endif]--><!--[if gte mso 9]><xml> ! <o:shapedefaults v:ext="edit" spidmax="45058"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> *************** *** 522,526 **** <li class=MsoNormal style='color:black;mso-list:l7 level1 lfo6;tab-stops: list .5in'><span style='font-family:"Book Antiqua";mso-bidi-font-family: ! Arial'>Collision detection primitives<o:p></o:p></span></li> </ul> <p class=MsoNormal style='margin-left:68.3pt;text-indent:-.25in;mso-list: --- 521,525 ---- <li class=MsoNormal style='color:black;mso-list:l7 level1 lfo6;tab-stops: list .5in'><span style='font-family:"Book Antiqua";mso-bidi-font-family: ! Arial'>Collision detection primitive shapes<o:p></o:p></span></li> </ul> <p class=MsoNormal style='margin-left:68.3pt;text-indent:-.25in;mso-list: *************** *** 548,557 **** </span></span></span><![endif]><span style='font-family:"Book Antiqua"; mso-bidi-font-family:Arial;color:black'>Planes<o:p></o:p></span></p> - <p class=MsoNormal style='margin-left:68.3pt;text-indent:-.25in;mso-list: - l6 level3 lfo8;tab-stops:list 68.3pt 1.5in'><![if !supportLists]><span - style='font-family:"Courier New";mso-fareast-font-family:"Courier New"; - color:black'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'> - </span></span></span><![endif]><span style='font-family:"Book Antiqua"; - mso-bidi-font-family:Arial;color:black'>Rays<o:p></o:p></span></p> <ul style='margin-top:0in' type=disc> <li class=MsoNormal style='color:black;mso-list:l7 level1 lfo6;tab-stops: --- 547,550 ---- *************** *** 571,576 **** color:black'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span style='font-family:"Book Antiqua"; ! mso-bidi-font-family:Arial;color:black'>Universal joints (two rotational degrees ! of freedom)<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:68.3pt;text-indent:-.25in;mso-list: l5 level3 lfo11;tab-stops:list 68.3pt 1.5in'><![if !supportLists]><span --- 564,569 ---- color:black'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span style='font-family:"Book Antiqua"; ! mso-bidi-font-family:Arial;color:black'>Universal joints (two rotational ! degrees of freedom)<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:68.3pt;text-indent:-.25in;mso-list: l5 level3 lfo11;tab-stops:list 68.3pt 1.5in'><![if !supportLists]><span |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 16:21:01
|
Update of /cvsroot/opal/web/files In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14739/files Modified Files: example.xml Log Message: minor changes Index: example.xml =================================================================== RCS file: /cvsroot/opal/web/files/example.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** example.xml 26 Feb 2005 10:23:34 -0000 1.4 --- example.xml 8 Mar 2005 16:20:51 -0000 1.5 *************** *** 43,53 **** </Shape> </Solid> - <Solid> - <Name value="ray1"/> - <Static value="true"/> - <Shape type="ray"> - <Dimensions originx="2.0" originy="5.0" originz="9.0" dirx="1.0" diry="0.0" dirz="0.0"/> - </Shape> - </Solid> <Joint> <Name value="myJoint1"/> --- 43,46 ---- |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 16:11:02
|
Update of /cvsroot/opal/opal/samples/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11795/samples/src Modified Files: BoxObject.h CapsuleObject.h SphereObject.h Log Message: added contact groups; added separate event handlers for collisions and joint break events; commented out mass ratio stuff Index: CapsuleObject.h =================================================================== RCS file: /cvsroot/opal/opal/samples/src/CapsuleObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CapsuleObject.h 4 Mar 2005 05:09:23 -0000 1.2 --- CapsuleObject.h 8 Mar 2005 16:10:22 -0000 1.3 *************** *** 8,12 **** public: CapsuleObject(opal::Simulator* sim, opal::Solid* s, opal::real radius, ! opal::real length, const opal::Matrix44r& offset); ~CapsuleObject(); --- 8,12 ---- public: CapsuleObject(opal::Simulator* sim, opal::Solid* s, opal::real radius, ! opal::real length, const opal::Matrix44r& offset=opal::Matrix44r()); ~CapsuleObject(); Index: SphereObject.h =================================================================== RCS file: /cvsroot/opal/opal/samples/src/SphereObject.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SphereObject.h 4 Mar 2005 05:09:23 -0000 1.5 --- SphereObject.h 8 Mar 2005 16:10:22 -0000 1.6 *************** *** 8,12 **** public: SphereObject(opal::Simulator* sim, opal::Solid* s, opal::real radius, ! const opal::Matrix44r& offset); ~SphereObject(); --- 8,12 ---- public: SphereObject(opal::Simulator* sim, opal::Solid* s, opal::real radius, ! const opal::Matrix44r& offset=opal::Matrix44r()); ~SphereObject(); Index: BoxObject.h =================================================================== RCS file: /cvsroot/opal/opal/samples/src/BoxObject.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BoxObject.h 4 Mar 2005 05:09:23 -0000 1.5 --- BoxObject.h 8 Mar 2005 16:10:22 -0000 1.6 *************** *** 8,12 **** public: BoxObject(opal::Simulator* sim, opal::Solid* s, opal::Vec3r size, ! const opal::Matrix44r& offset); ~BoxObject(); --- 8,12 ---- public: BoxObject(opal::Simulator* sim, opal::Solid* s, opal::Vec3r size, ! const opal::Matrix44r& offset=opal::Matrix44r()); ~BoxObject(); |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 16:11:01
|
Update of /cvsroot/opal/opal/samples/simple_objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11795/samples/simple_objects Modified Files: main.cpp Log Message: added contact groups; added separate event handlers for collisions and joint break events; commented out mass ratio stuff Index: main.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/simple_objects/main.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** main.cpp 4 Mar 2005 05:09:23 -0000 1.23 --- main.cpp 8 Mar 2005 16:10:21 -0000 1.24 *************** *** 213,221 **** break; } - case opal::RAY_SHAPE: - { - // Not implemented. - break; - } case opal::MESH_SHAPE: { --- 213,216 ---- |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 16:11:00
|
Update of /cvsroot/opal/opal/samples/car In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11795/samples/car Modified Files: car.vcproj Log Message: added contact groups; added separate event handlers for collisions and joint break events; commented out mass ratio stuff Index: car.vcproj =================================================================== RCS file: /cvsroot/opal/opal/samples/car/car.vcproj,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** car.vcproj 9 Feb 2005 07:12:45 -0000 1.11 --- car.vcproj 8 Mar 2005 16:10:20 -0000 1.12 *************** *** 126,129 **** --- 126,132 ---- </File> <File + RelativePath="..\src\CapsuleObject.cpp"> + </File> + <File RelativePath="..\src\CarObject.cpp"> </File> *************** *** 149,152 **** --- 152,158 ---- </File> <File + RelativePath="..\src\CapsuleObject.h"> + </File> + <File RelativePath="..\src\CarObject.h"> </File> |
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11795/src Modified Files: AttractorMotor.h BoxShapeData.h CapsuleShapeData.h Defines.h EventHandler.h Joint.cpp Joint.h JointData.h Logger.cpp Logger.h MeshShapeData.h PlaneShapeData.h SConscript ShapeData.h Simulator.cpp Simulator.h Singleton.h Solid.cpp Solid.h SphereShapeData.h SpringMotor.h ThrusterMotor.h opal.h Added Files: CollisionEventHandler.cpp CollisionEventHandler.h JointBreakEventHandler.h Log Message: added contact groups; added separate event handlers for collisions and joint break events; commented out mass ratio stuff Index: opal.h =================================================================== RCS file: /cvsroot/opal/opal/src/opal.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** opal.h 5 Mar 2005 21:26:24 -0000 1.19 --- opal.h 8 Mar 2005 16:10:23 -0000 1.20 *************** *** 55,58 **** --- 55,60 ---- #include "SensorData.h" #include "EventHandler.h" + #include "JointBreakEventHandler.h" + #include "CollisionEventHandler.h" #include "Blueprint.h" #include "BlueprintInstance.h" Index: SConscript =================================================================== RCS file: /cvsroot/opal/opal/src/SConscript,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SConscript 26 Feb 2005 10:22:23 -0000 1.11 --- SConscript 8 Mar 2005 16:10:23 -0000 1.12 *************** *** 11,14 **** --- 11,15 ---- BoxShapeData.h CapsuleShapeData.h + CollisionEventHandler.h Defines.h EventHandler.h *************** *** 16,19 **** --- 17,21 ---- GearedMotorData.h Joint.h + JointBreakEventHandler.h JointData.h Logger.h *************** *** 54,57 **** --- 56,60 ---- BlueprintInstance.cpp BlueprintManager.cpp + CollisionEventHandler.cpp GearedMotor.cpp Joint.cpp Index: ShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/ShapeData.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ShapeData.h 5 Mar 2005 21:26:24 -0000 1.5 --- ShapeData.h 8 Mar 2005 16:10:23 -0000 1.6 *************** *** 56,59 **** --- 56,60 ---- // Leave the offset as an identity matrix. material = defaults::shape::material; + contactGroup = defaults::shape::contactGroup; } *************** *** 74,77 **** --- 75,82 ---- Material material; + /// The Shape's contact group. If this exceeds 31, bad things + /// might happen since there are only 32 groups. + unsigned long int contactGroup; + protected: /// The Shape type. Index: Logger.h =================================================================== RCS file: /cvsroot/opal/opal/src/Logger.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Logger.h 28 Feb 2005 03:27:56 -0000 1.3 --- Logger.h 8 Mar 2005 16:10:23 -0000 1.4 *************** *** 74,77 **** --- 74,78 ---- //static void unsilenceStream(const std::string& name); + /// Returns the named stream. std::ostream& OPAL_CALL stream(const std::string& name); Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** Simulator.h 5 Mar 2005 21:26:24 -0000 1.79 --- Simulator.h 8 Mar 2005 16:10:23 -0000 1.80 *************** *** 50,53 **** --- 50,61 ---- struct RaycastResult { + RaycastResult() + { + solid = NULL; + // "intersection" is initialized in its own constructor. + // "normal" is initialized in its own constructor. + distance = 0; + } + /// The first Solid hit by the ray. Solid* solid; *************** *** 150,156 **** /// last argument is true, the two groups will generate physical /// points when they collide. Otherwise, they will pass through ! /// each other. This does not affect collision events; two ! /// colliding objects might not generate contacts but still ! /// generate collision events. virtual void OPAL_CALL setupContactGroups(unsigned int group0, unsigned int group1, bool makeContacts); --- 158,169 ---- /// last argument is true, the two groups will generate physical /// points when they collide. Otherwise, they will pass through ! /// each other. Keep in mind that the following cases are already ! /// ignored when performing collision detection: two sleeping ! /// Solids don't collide, two Solids connected by a fixed Joint ! /// don't collide; two Solids connected by a Joint with its ! /// contacts enabled property set to false don't collide. ! /// Note that contact groups do not affect collision events; two ! /// colliding objects might not generate contacts and still ! /// generate collision events sent to their CollisionEventHandlers. virtual void OPAL_CALL setupContactGroups(unsigned int group0, unsigned int group1, bool makeContacts); *************** *** 161,168 **** virtual Solid* OPAL_CALL createSolid() = 0; ! /// Marks the given Solid as garbage. virtual void OPAL_CALL destroySolid(Solid* s); ! /// Marks all Solids in the Simulator as garbage. virtual void OPAL_CALL destroyAllSolids(); --- 174,183 ---- virtual Solid* OPAL_CALL createSolid() = 0; ! /// Immediately destroys the given Solid. All Joints, Motors, and ! /// Sensors that depend on this Solid will be automatically ! /// disabled. virtual void OPAL_CALL destroySolid(Solid* s); ! /// Immediately destroys all Solids in the Simulator. virtual void OPAL_CALL destroyAllSolids(); *************** *** 175,182 **** virtual Joint* OPAL_CALL createJoint() = 0; ! /// Marks the given Joint as garbage. virtual void OPAL_CALL destroyJoint(Joint* j); ! /// Marks all Joints in the Simulator as garbage. virtual void OPAL_CALL destroyAllJoints(); --- 190,198 ---- virtual Joint* OPAL_CALL createJoint() = 0; ! /// Immediately destroys the given Joint. All Motors that depend ! /// on this Solid will be automatically disabled. virtual void OPAL_CALL destroyJoint(Joint* j); ! /// Immediately destroys all Joints in the Simulator. virtual void OPAL_CALL destroyAllJoints(); *************** *** 202,209 **** //virtual void OPAL_CALL registerCustomMotor(Motor* m); ! /// Marks the given Motor as garbage. virtual void OPAL_CALL destroyMotor(Motor* m); ! /// Marks all Motors in the Simulator as garbage. virtual void OPAL_CALL destroyAllMotors(); --- 218,225 ---- //virtual void OPAL_CALL registerCustomMotor(Motor* m); ! /// Immediately destroys the given Motor. virtual void OPAL_CALL destroyMotor(Motor* m); ! /// Immediately destroys all Motors in the Simulator. virtual void OPAL_CALL destroyAllMotors(); *************** *** 213,220 **** virtual Solid* OPAL_CALL createSensor(); ! /// Marks the given Sensor as garbage. virtual void OPAL_CALL destroySensor(Sensor* s); ! /// Marks all Sensors in the Simulator as garbage. virtual void OPAL_CALL destroyAllSensors(); --- 229,236 ---- virtual Solid* OPAL_CALL createSensor(); ! /// Immediately destroys the given Sensor. virtual void OPAL_CALL destroySensor(Sensor* s); ! /// Immediately destroys all Sensors in the Simulator. virtual void OPAL_CALL destroyAllSensors(); *************** *** 230,238 **** virtual void OPAL_CALL internal_stepPhysics() = 0; protected: virtual ~Simulator(); ! /// Destroys all objects in the Simulator marked as garbage. ! void collectGarbage(); /// Adds a Solid to the internal list of Solids. --- 246,257 ---- virtual void OPAL_CALL internal_stepPhysics() = 0; + /// Returns the Simulator's contact group flags. + virtual unsigned long int OPAL_CALL + internal_getContactGroupFlags(unsigned int groupNum)const; protected: virtual ~Simulator(); ! ///// Destroys all objects in the Simulator marked as garbage. ! //void collectGarbage(); /// Adds a Solid to the internal list of Solids. *************** *** 300,314 **** std::vector<Sensor*> mSensorList; ! /// An internal list of all Solids marked as garbage. ! std::vector<Solid*> mSolidGarbageList; ! /// An internal list of all Joints. ! std::vector<Joint*> mJointGarbageList; ! /// An internal list of all Motors marked as garbage. ! std::vector<Motor*> mMotorGarbageList; ! /// An internal list of all Sensors marked as garbage. ! std::vector<Sensor*> mSensorGarbageList; /// Spaces are stored here so the user doesn't have to destroy them; --- 319,333 ---- std::vector<Sensor*> mSensorList; ! ///// An internal list of all Solids marked as garbage. ! //std::vector<Solid*> mSolidGarbageList; ! ///// An internal list of all Joints. ! //std::vector<Joint*> mJointGarbageList; ! ///// An internal list of all Motors marked as garbage. ! //std::vector<Motor*> mMotorGarbageList; ! ///// An internal list of all Sensors marked as garbage. ! //std::vector<Sensor*> mSensorGarbageList; /// Spaces are stored here so the user doesn't have to destroy them; Index: PlaneShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/PlaneShapeData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PlaneShapeData.h 3 Mar 2005 02:32:28 -0000 1.3 --- PlaneShapeData.h 8 Mar 2005 16:10:23 -0000 1.4 *************** *** 65,68 **** --- 65,69 ---- offset = data.offset; material = data.material; + contactGroup = data.contactGroup; for (int i=0; i<4; ++i) --- NEW FILE: CollisionEventHandler.h --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #ifndef OPAL_COLLISION_EVENT_HANDLER_H #define OPAL_COLLISION_EVENT_HANDLER_H #include "Defines.h" #include "EventHandler.h" namespace opal { class Solid; /// A data structure containing info about a specific collision event /// involving two Solids. struct CollisionEvent { CollisionEvent() { thisSolid = NULL; otherSolid = NULL; // "pos" is initialized in its own constructor. // "normal" is initialized in its own constructor. depth = 0; } /// The colliding Solid whose CollisionEventHandler gets called. Solid* thisSolid; /// The Solid that collided with the one owning the /// CollisionEventHandler. Solid* otherSolid; /// The point of collision. Point3r pos; /// The normal vector at the point of collision. Vec3r normal; /// The depth of interpenetration. This may not be very helpful /// if the two Solids are allowed to pass through each other (i.e. /// their contact groups do not generate contacts). real depth; }; /// A listener that gets notified when two Solids touch. class CollisionEventHandler : public EventHandler { public: CollisionEventHandler(); virtual ~CollisionEventHandler(); /// Called once for each pending CollisionEvent. This is always /// called at the end of a time step, so CollisionEvents always /// get handled right away. virtual void OPAL_CALL handleCollisionEvent( const CollisionEvent& e) = 0; /// Adds a CollisionEvent to this handler's internal list. These /// will get handled at the end of the current time step. virtual void OPAL_CALL internal_pushCollisionEvent( const CollisionEvent& e); /// Loops through the pending CollisionEvents, calling the event /// handling function (which is always user-defined) for each. virtual void OPAL_CALL internal_handlePendingCollisionEvents(); protected: /// This list holds pending CollisionEvents. It allows events to /// be queued during collision detection and handled at a safe time. std::vector<CollisionEvent> mPendingCollisionEvents; private: }; } #endif Index: SpringMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/SpringMotor.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SpringMotor.h 1 Mar 2005 05:04:22 -0000 1.9 --- SpringMotor.h 8 Mar 2005 16:10:23 -0000 1.10 *************** *** 109,146 **** SpringMotorData mData; - ///// Pointer to the Solid affected by this Motor. - //Solid* mSolid; - - ///// The Motor's mode of operation. - //Mode mMode; - - ///// The Motor's desired position. This is only used if the - ///// appropriate mode is set. - //Point3r mDesiredPos; - - ///// The Motor's desired forward direction, part of the desired - ///// orientation. This is only used if the appropriate mode is set. - //Vec3r mDesiredForward; - - ///// The Motor's desired up direction, part of the desired - ///// orientation. This is only used if the appropriate mode is set. - //Vec3r mDesiredUp; - - ///// The Motor's desired right direction, part of the desired - ///// orientation. This is only used if the appropriate mode is set. - //Vec3r mDesiredRight; - - ///// The damping constant for linear mode. - //real mLinearKd; - - ///// The spring constant for linear mode. - //real mLinearKs; - - ///// The damping constant for angular mode. - //real mAngularKd; - - ///// The spring constant for angular mode. - //real mAngularKs; - private: }; --- 109,112 ---- Index: ThrusterMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/ThrusterMotor.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ThrusterMotor.h 4 Mar 2005 05:09:24 -0000 1.10 --- ThrusterMotor.h 8 Mar 2005 16:10:23 -0000 1.11 *************** *** 83,92 **** ThrusterMotorData mData; - /// Pointer to the Solid affected by this Motor. - //Solid* mSolid; - - /// The Force that gets applied to the Solid every time step. - //Force mForce; - private: }; --- 83,86 ---- Index: Solid.h =================================================================== RCS file: /cvsroot/opal/opal/src/Solid.h,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** Solid.h 4 Mar 2005 23:26:54 -0000 1.80 --- Solid.h 8 Mar 2005 16:10:23 -0000 1.81 *************** *** 30,34 **** #include "Defines.h" ! #include "EventHandler.h" #include "SolidData.h" --- 30,34 ---- #include "Defines.h" ! #include "CollisionEventHandler.h" #include "SolidData.h" *************** *** 177,184 **** /// Sets the Solid's event handler. ! virtual void OPAL_CALL setEventHandler(EventHandler* eventHandler); /// Returns the Solid's event handler. ! virtual EventHandler* OPAL_CALL getEventHandler()const; //// Quickly spinning solids should be set as fast rotating solids to --- 177,185 ---- /// Sets the Solid's event handler. ! virtual void OPAL_CALL setEventHandler( ! CollisionEventHandler* eventHandler); /// Returns the Solid's event handler. ! virtual CollisionEventHandler* OPAL_CALL getEventHandler()const; //// Quickly spinning solids should be set as fast rotating solids to *************** *** 220,224 **** /// Pointer to this Solid's event handler. ! EventHandler* mEventHandler; /// Pointer to user data. This is totally user-managed (i.e. OPAL --- 221,225 ---- /// Pointer to this Solid's event handler. ! CollisionEventHandler* mCollisionEventHandler; /// Pointer to user data. This is totally user-managed (i.e. OPAL Index: CapsuleShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/CapsuleShapeData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CapsuleShapeData.h 3 Mar 2005 02:32:28 -0000 1.3 --- CapsuleShapeData.h 8 Mar 2005 16:10:23 -0000 1.4 *************** *** 62,65 **** --- 62,66 ---- offset = data.offset; material = data.material; + contactGroup = data.contactGroup; radius = data.radius; length = data.length; Index: SphereShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SphereShapeData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SphereShapeData.h 3 Mar 2005 02:32:28 -0000 1.3 --- SphereShapeData.h 8 Mar 2005 16:10:23 -0000 1.4 *************** *** 61,64 **** --- 61,65 ---- offset = data.offset; material = data.material; + contactGroup = data.contactGroup; radius = data.radius; } Index: AttractorMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/AttractorMotor.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** AttractorMotor.h 1 Mar 2005 05:04:22 -0000 1.25 --- AttractorMotor.h 8 Mar 2005 16:10:23 -0000 1.26 *************** *** 88,97 **** AttractorMotorData mData; - /// Pointer to Solid 0. - //Solid* mSolid0; - - /// Pointer to Solid 1. - //Solid* mSolid1; - /// Cached copy of Solid 0's mass. real mSolid0Mass; --- 88,91 ---- *************** *** 100,112 **** real mSolid1Mass; - /// Constant used to scale attraction (repulsion if strength < 0). - //real mStrength; - /// Cached copy of strength * m0 * m1. real mMassConstant; - /// Determines exponential relationship of attraction/repulsion. - //real mExponent; - private: --- 94,100 ---- Index: BoxShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/BoxShapeData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BoxShapeData.h 3 Mar 2005 02:32:28 -0000 1.3 --- BoxShapeData.h 8 Mar 2005 16:10:23 -0000 1.4 *************** *** 61,64 **** --- 61,65 ---- offset = data.offset; material = data.material; + contactGroup = data.contactGroup; dimensions = data.dimensions; } Index: Defines.h =================================================================== RCS file: /cvsroot/opal/opal/src/Defines.h,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Defines.h 5 Mar 2005 21:26:24 -0000 1.66 --- Defines.h 8 Mar 2005 16:10:23 -0000 1.67 *************** *** 283,286 **** --- 283,289 ---- const real maxAngularVel = (real)1000.0; + /// All groups make contacts with all other groups by default. + const unsigned long int contactGroupFlags = 0xFFFFFFFF; + /// Default parameters used in Solid creation. namespace solid *************** *** 325,328 **** --- 328,332 ---- const real breakThresh = (real)100.0; const real accumThresh = (real)1000.0; + const bool enableContacts = false; } Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Simulator.cpp 5 Mar 2005 21:26:24 -0000 1.42 --- Simulator.cpp 8 Mar 2005 16:10:23 -0000 1.43 *************** *** 39,76 **** mTimeBuffer = 0; setStepSize(defaults::stepSize); - //setDefaultLinearDamping(defaults::linearDamping); - //setDefaultAngularDamping(defaults::angularDamping); - //mAllowPartialFrames = defaults::allowPartialFrames; setMaxLinearVel(defaults::maxLinearVel); setMaxAngularVel(defaults::maxAngularVel); setUserData(NULL); } Simulator::~Simulator() { ! // Mark everything as garbage, then collect the garbage. ! size_t i; ! for (i=0; i<mSolidList.size(); ++i) ! { ! mSolidGarbageList.push_back(mSolidList[i]); ! } ! for (i=0; i<mJointList.size(); ++i) ! { ! mJointGarbageList.push_back(mJointList[i]); ! } ! for (i=0; i<mMotorList.size(); ++i) ! { ! mMotorGarbageList.push_back(mMotorList[i]); ! } ! for (i=0; i<mSensorList.size(); ++i) ! { ! mSensorGarbageList.push_back(mSensorList[i]); ! } ! collectGarbage(); while (!mSpaceList.empty()) --- 39,84 ---- mTimeBuffer = 0; setStepSize(defaults::stepSize); setMaxLinearVel(defaults::maxLinearVel); setMaxAngularVel(defaults::maxAngularVel); setUserData(NULL); + + int i=0; + for (i=0; i<32; ++i) + { + mContactGroupFlags[i] = defaults::contactGroupFlags; + } } Simulator::~Simulator() { ! //// Mark everything as garbage, then collect the garbage. ! //size_t i; ! //for (i=0; i<mSolidList.size(); ++i) ! //{ ! // mSolidGarbageList.push_back(mSolidList[i]); ! //} ! //for (i=0; i<mJointList.size(); ++i) ! //{ ! // mJointGarbageList.push_back(mJointList[i]); ! //} ! //for (i=0; i<mMotorList.size(); ++i) ! //{ ! // mMotorGarbageList.push_back(mMotorList[i]); ! //} ! //for (i=0; i<mSensorList.size(); ++i) ! //{ ! // mSensorGarbageList.push_back(mSensorList[i]); ! //} ! //collectGarbage(); ! ! destroyAllSolids(); ! destroyAllJoints(); ! destroyAllMotors(); ! destroyAllSensors(); while (!mSpaceList.empty()) *************** *** 130,135 **** jointIter != mJointList.end(); ++jointIter) { ! // If the Joint gets broken here, it will automatically ! // send a Joint break event. (*jointIter)->internal_update(); } --- 138,144 ---- jointIter != mJointList.end(); ++jointIter) { ! // If a Joint gets broken here, it will automatically ! // send a Joint break event to the Joint's ! // JointBreakEventHandler (assuming one exists). (*jointIter)->internal_update(); } *************** *** 139,143 **** internal_stepPhysics(); ! // Loop over Solids again. for (solidIter = mSolidList.begin(); solidIter != mSolidList.end(); ++solidIter) --- 148,152 ---- internal_stepPhysics(); ! // Loop over Solids again to handle a few more things... for (solidIter = mSolidList.begin(); solidIter != mSolidList.end(); ++solidIter) *************** *** 194,202 **** // Update the sleeping value from the physics engine. This ! // needs to be updated to keep the Solid's SolidDate valid. solid->internal_updateSleeping(); ! //// Update accelerations ! //solid->internal_updateAcceleration(dt); } --- 203,215 ---- // Update the sleeping value from the physics engine. This ! // needs to be updated to keep the Solid's SolidData valid. solid->internal_updateSleeping(); ! // Update the Solid's CollisionEventHandler if applicable. ! if (solid->getEventHandler()) ! { ! solid->getEventHandler()-> ! internal_handlePendingCollisionEvents(); ! } } *************** *** 205,210 **** } ! // Deallocate memory here now that it's safe. ! collectGarbage(); return stepOccurred; --- 218,223 ---- } ! //// Deallocate memory here now that it's safe. ! //collectGarbage(); return stepOccurred; *************** *** 549,554 **** --- 562,584 ---- unsigned int group1, bool makeContacts) { + if (group0 > 31) + { + OPAL_LOGGER("warning") << "opal::Simulator::setupContactGroups: " + << "Invalid contact group " << group0 + << ". Request will be ignored." << std::endl; + return; + } + + if (group1 > 31) + { + OPAL_LOGGER("warning") << "opal::Simulator::setupContactGroups: " + << "Invalid contact group " << group1 + << ". Request will be ignored." << std::endl; + return; + } + // The interaction always goes both ways, so we need to set the bit // flags both ways. + unsigned long int group0Bit = 1 << group0; unsigned long int group1Bit = 1 << group1; *************** *** 556,580 **** if (makeContacts) { ! //m } else { } } void Simulator::destroySolid(Solid* s) { ! mSolidGarbageList.push_back(s); } void Simulator::destroyAllSolids() { - // Just mark everything as garbage; it'll get destroyed at the end of - // the current step. - for (size_t i=0; i<mSolidList.size(); ++i) { ! mSolidGarbageList.push_back(mSolidList[i]); } } --- 586,627 ---- if (makeContacts) { ! // Raise the group1 bit in group0's array. ! mContactGroupFlags[group0] |= group1Bit; ! ! // Raise the group0 bit in group1's array. ! mContactGroupFlags[group1] |= group0Bit; } else { + unsigned long int tempMask = 0xFFFFFFFF; + unsigned long int notGroup0Bit = group0 ^ tempMask; + unsigned long int notGroup1Bit = group1 ^ tempMask; + + // Lower the group1 bit in group0's array. + mContactGroupFlags[group0] &= notGroup1Bit; + // Lower the group0 bit in group1's array. + mContactGroupFlags[group1] &= notGroup0Bit; } } + unsigned long int Simulator::internal_getContactGroupFlags( + unsigned int groupNum)const + { + return mContactGroupFlags[groupNum]; + } + void Simulator::destroySolid(Solid* s) { ! //mSolidGarbageList.push_back(s); ! removeSolid(s); } void Simulator::destroyAllSolids() { for (size_t i=0; i<mSolidList.size(); ++i) { ! //mSolidGarbageList.push_back(mSolidList[i]); ! removeSolid(mSolidList[i]); } } *************** *** 587,591 **** void Simulator::destroyJoint(Joint* j) { ! mJointGarbageList.push_back(j); } --- 634,639 ---- void Simulator::destroyJoint(Joint* j) { ! //mJointGarbageList.push_back(j); ! removeJoint(j); } *************** *** 597,601 **** for (size_t i=0; i<mJointList.size(); ++i) { ! mJointGarbageList.push_back(mJointList[i]); } } --- 645,650 ---- for (size_t i=0; i<mJointList.size(); ++i) { ! //mJointGarbageList.push_back(mJointList[i]); ! removeJoint(mJointList[i]); } } *************** *** 644,648 **** void Simulator::destroyMotor(Motor* m) { ! mMotorGarbageList.push_back(m); } --- 693,698 ---- void Simulator::destroyMotor(Motor* m) { ! //mMotorGarbageList.push_back(m); ! removeMotor(m); } *************** *** 654,658 **** for (size_t i=0; i<mMotorList.size(); ++i) { ! mMotorGarbageList.push_back(mMotorList[i]); } } --- 704,709 ---- for (size_t i=0; i<mMotorList.size(); ++i) { ! //mMotorGarbageList.push_back(mMotorList[i]); ! removeMotor(mMotorList[i]); } } *************** *** 670,674 **** void Simulator::destroySensor(Sensor* s) { ! mSensorGarbageList.push_back(s); } --- 721,726 ---- void Simulator::destroySensor(Sensor* s) { ! //mSensorGarbageList.push_back(s); ! removeSensor(s); } *************** *** 680,684 **** for (size_t i=0; i<mSensorList.size(); ++i) { ! mSensorGarbageList.push_back(mSensorList[i]); } } --- 732,737 ---- for (size_t i=0; i<mSensorList.size(); ++i) { ! //mSensorGarbageList.push_back(mSensorList[i]); ! removeSensor(mSensorList[i]); } } *************** *** 712,718 **** void Simulator::removeSolid(Solid* s) { ! // TODO: make this more efficient by not iterating through all Motors ! // and Joints; maybe have the Solid maintain pointers to things that ! // depend on it. // Disable Motors that depend on the given Solid. --- 765,771 ---- void Simulator::removeSolid(Solid* s) { ! // TODO: make this more efficient by not iterating through all Motors, ! // Sensors, and Joints; maybe have the Solid maintain pointers to ! // things that depend on it. // Disable Motors that depend on the given Solid. *************** *** 767,772 **** void Simulator::removeJoint(Joint* j) { ! // TODO: make this more efficient by not iterating through all Motors ! // and Joints; maybe have the Solid maintain pointers to things that // depend on it. --- 820,825 ---- void Simulator::removeJoint(Joint* j) { ! // TODO: make this more efficient by not iterating through all Motors; ! // maybe have the Solid maintain pointers to things that // depend on it. *************** *** 844,871 **** } ! void Simulator::collectGarbage() ! { ! size_t i; ! for (i=0; i<mSolidGarbageList.size(); ++i) ! { ! removeSolid(mSolidGarbageList[i]); ! } ! mSolidGarbageList.clear(); ! for (i=0; i<mJointGarbageList.size(); ++i) ! { ! removeJoint(mJointGarbageList[i]); ! } ! mJointGarbageList.clear(); ! for (i=0; i<mMotorGarbageList.size(); ++i) ! { ! removeMotor(mMotorGarbageList[i]); ! } ! mMotorGarbageList.clear(); ! } } --- 897,931 ---- } ! //void Simulator::collectGarbage() ! //{ ! // size_t i; ! // for (i=0; i<mSolidGarbageList.size(); ++i) ! // { ! // removeSolid(mSolidGarbageList[i]); ! // } ! // mSolidGarbageList.clear(); ! // for (i=0; i<mJointGarbageList.size(); ++i) ! // { ! // removeJoint(mJointGarbageList[i]); ! // } ! // mJointGarbageList.clear(); ! // for (i=0; i<mMotorGarbageList.size(); ++i) ! // { ! // removeMotor(mMotorGarbageList[i]); ! // } ! // mMotorGarbageList.clear(); ! ! // for (i=0; i<mSensorGarbageList.size(); ++i) ! // { ! // removeSensor(mSensorGarbageList[i]); ! // } ! ! // mSensorGarbageList.clear(); ! //} } Index: Singleton.h =================================================================== RCS file: /cvsroot/opal/opal/src/Singleton.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Singleton.h 18 Feb 2005 23:59:37 -0000 1.7 --- Singleton.h 8 Mar 2005 16:10:23 -0000 1.8 *************** *** 42,47 **** static TYPE& OPAL_CALL instance() { - //static TYPE* mSelf)new TYPE); - //return *mSelf; static TYPE mSelf; return mSelf; --- 42,45 ---- Index: Solid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Solid.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Solid.cpp 1 Mar 2005 05:04:22 -0000 1.25 --- Solid.cpp 8 Mar 2005 16:10:23 -0000 1.26 *************** *** 333,340 **** // Delete this force. ! //swap the element to be deleted with the last element std::swap((*forceIter), mForceList.back()); ! //delete the last element mForceList.pop_back(); } --- 333,340 ---- // Delete this force. ! // Swap the element to be deleted with the last element. std::swap((*forceIter), mForceList.back()); ! // Delete the last element. mForceList.pop_back(); } *************** *** 346,357 **** } ! void Solid::setEventHandler(EventHandler* eventHandler) { ! mEventHandler = eventHandler; } ! EventHandler* Solid::getEventHandler()const { ! return mEventHandler; } --- 346,357 ---- } ! void Solid::setEventHandler(CollisionEventHandler* eventHandler) { ! mCollisionEventHandler = eventHandler; } ! CollisionEventHandler* Solid::getEventHandler()const { ! return mCollisionEventHandler; } --- NEW FILE: JointBreakEventHandler.h --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #ifndef OPAL_JOINT_BREAK_EVENT_HANDLER_H #define OPAL_JOINT_BREAK_EVENT_HANDLER_H #include "Defines.h" #include "EventHandler.h" namespace opal { class Joint; /// A listener that gets notified when a particular Joint breaks. class JointBreakEventHandler : public EventHandler { public: JointBreakEventHandler() {} virtual ~JointBreakEventHandler() {} /// Called when a Joint breaks from being damaged. The Joint will /// automatically become disabled before this is called. virtual void OPAL_CALL handleJointBreakEvent(Joint* joint) = 0; protected: private: }; } #endif Index: Joint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Joint.cpp 5 Mar 2005 21:26:24 -0000 1.24 --- Joint.cpp 8 Mar 2005 16:10:23 -0000 1.25 *************** *** 34,38 **** { // "mData" is initialized in its own constructor. ! mEventHandler = NULL; setUserData(NULL); mInitCalled = false; --- 34,38 ---- { // "mData" is initialized in its own constructor. ! mJointBreakEventHandler = NULL; setUserData(NULL); mInitCalled = false; *************** *** 91,97 **** //} ! void Joint::setEventHandler(EventHandler* eventHandler) { ! mEventHandler = eventHandler; } --- 91,97 ---- //} ! void Joint::setEventHandler(JointBreakEventHandler* eventHandler) { ! mJointBreakEventHandler = eventHandler; } *************** *** 351,357 **** { setEnabled(false); ! if (mEventHandler) { ! mEventHandler->handleJointBreakEvent(this); } } --- 351,357 ---- { setEnabled(false); ! if (mJointBreakEventHandler) { ! mJointBreakEventHandler->handleJointBreakEvent(this); } } --- NEW FILE: CollisionEventHandler.cpp --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #include "CollisionEventHandler.h" namespace opal { CollisionEventHandler::CollisionEventHandler() { } CollisionEventHandler::~CollisionEventHandler() { mPendingCollisionEvents.clear(); } void CollisionEventHandler::internal_pushCollisionEvent( const CollisionEvent& e) { mPendingCollisionEvents.push_back(e); } void CollisionEventHandler::internal_handlePendingCollisionEvents() { std::vector<CollisionEvent>::iterator iter; for (iter = mPendingCollisionEvents.begin(); iter != mPendingCollisionEvents.end(); ++iter) { handleCollisionEvent(*iter); } } } Index: EventHandler.h =================================================================== RCS file: /cvsroot/opal/opal/src/EventHandler.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** EventHandler.h 5 Mar 2005 21:26:24 -0000 1.20 --- EventHandler.h 8 Mar 2005 16:10:23 -0000 1.21 *************** *** 33,61 **** namespace opal { ! class Joint; ! class Solid; ! ! /// A data structure containing info about a specific point collision ! /// between two Solids. ! struct CollisionEvent ! { ! /// One of the Solids that collided. ! Solid* solid0; ! ! /// One of the Solids that collided. ! Solid* solid1; ! ! /// The point of collision. ! Point3r pos; ! ! /// The normal vector at the point of collision. ! Vec3r normal; ! ! /// The depth of interpenetration. ! real depth; ! }; ! ! /// The EventHandler should be subclassed by users to catch collision ! /// events and Joint break events. class EventHandler { --- 33,38 ---- namespace opal { ! /// Base class for various other event handling classes. EventHandlers ! /// are listeners that respond to particular events. class EventHandler { *************** *** 64,77 **** {} ! /// Called when two Solids collide. The first Solid in the ! /// CollisionEvent is the one whose event handler got called. ! virtual bool OPAL_CALL handleCollisionEvent( ! const CollisionEvent& event) ! { ! return true; ! } ! ! /// Called when a Joint breaks from being damaged. ! virtual void OPAL_CALL handleJointBreakEvent(Joint* joint) {} --- 41,45 ---- {} ! virtual ~EventHandler() {} Index: Joint.h =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.h,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Joint.h 5 Mar 2005 21:26:24 -0000 1.62 --- Joint.h 8 Mar 2005 16:10:23 -0000 1.63 *************** *** 30,34 **** #include "Defines.h" ! #include "EventHandler.h" #include "JointData.h" --- 30,34 ---- #include "Defines.h" ! #include "JointBreakEventHandler.h" #include "JointData.h" *************** *** 87,91 **** /// Sets the Joint's event handler. ! virtual void OPAL_CALL setEventHandler(EventHandler* eventHandler); /// Enables or disables the given Joint axis' limits. --- 87,92 ---- /// Sets the Joint's event handler. ! virtual void OPAL_CALL setEventHandler( ! JointBreakEventHandler* eventHandler); /// Enables or disables the given Joint axis' limits. *************** *** 235,239 **** /// A pointer to the Joint's event handler. ! EventHandler* mEventHandler; /// Pointer to user data. This is totally user-managed (i.e. OPAL --- 236,240 ---- /// A pointer to the Joint's event handler. ! JointBreakEventHandler* mJointBreakEventHandler; /// Pointer to user data. This is totally user-managed (i.e. OPAL Index: MeshShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/MeshShapeData.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MeshShapeData.h 22 Feb 2005 19:46:29 -0000 1.2 --- MeshShapeData.h 8 Mar 2005 16:10:23 -0000 1.3 *************** *** 68,71 **** --- 68,72 ---- offset = data.offset; material = data.material; + contactGroup = data.contactGroup; vertexArray[0] = data.vertexArray[0]; numVertices = data.numVertices; Index: JointData.h =================================================================== RCS file: /cvsroot/opal/opal/src/JointData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JointData.h 26 Feb 2005 10:22:23 -0000 1.3 --- JointData.h 8 Mar 2005 16:10:23 -0000 1.4 *************** *** 103,106 **** --- 103,107 ---- accumThresh = defaults::joint::accumThresh; accumDamage = 0; + enableContacts = defaults::joint::enableContacts; } *************** *** 138,141 **** --- 139,143 ---- accumThresh = data.accumThresh; accumDamage = data.accumDamage; + enableContacts = data.enableContacts; } *************** *** 196,199 **** --- 198,205 ---- real accumDamage; + /// Determines whether Solids connected by this Joint should make + /// contacts when they collide. + bool enableContacts; + protected: /// The Joint type. Index: Logger.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Logger.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Logger.cpp 26 Feb 2005 10:22:23 -0000 1.2 --- Logger.cpp 8 Mar 2005 16:10:23 -0000 1.3 *************** *** 6,14 **** namespace logger { - //std::map<std::string, Logger::Stream> Logger::mStreams; - Logger::Logger() { ! init(); } --- 6,24 ---- namespace logger { Logger::Logger() { ! //static std::ofstream debugOut, warningOut, errorOut; ! //debugOut.open("opal_debug.log"); ! //warningOut.open("opal_warning.log"); ! //errorOut.open("opal_error.log"); ! ! //setStream("debug", &debugOut, "[OPAL debug] "); ! //setStream("warning", &warningOut, "[OPAL warning] "); ! //setStream("error", &errorOut, "[OPAL error] "); ! //setStream("performance", &std::cout); ! ! setStream("debug", &std::cout, "[OPAL debug] "); ! setStream("warning", &std::cout, "[OPAL warning] "); ! setStream("error", &std::cout, "[OPAL error] "); } *************** *** 66,86 **** return *(s.stream); } - - void Logger::init() - { - //static std::ofstream debugOut, warningOut, errorOut; - //debugOut.open("opal_debug.log"); - //warningOut.open("opal_warning.log"); - //errorOut.open("opal_error.log"); - - //setStream("debug", &debugOut, "[OPAL debug] "); - //setStream("warning", &warningOut, "[OPAL warning] "); - //setStream("error", &errorOut, "[OPAL error] "); - //setStream("performance", &std::cout); - - setStream("debug", &std::cout, "[OPAL debug] "); - setStream("warning", &std::cout, "[OPAL warning] "); - setStream("error", &std::cout, "[OPAL error] "); - } } } --- 76,79 ---- |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 16:10:36
|
Update of /cvsroot/opal/opal/vc7 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11795/vc7 Modified Files: opal-ode.vcproj Log Message: added contact groups; added separate event handlers for collisions and joint break events; commented out mass ratio stuff Index: opal-ode.vcproj =================================================================== RCS file: /cvsroot/opal/opal/vc7/opal-ode.vcproj,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** opal-ode.vcproj 5 Mar 2005 21:26:24 -0000 1.15 --- opal-ode.vcproj 8 Mar 2005 16:10:25 -0000 1.16 *************** *** 128,131 **** --- 128,134 ---- </File> <File + RelativePath="..\src\CollisionEventHandler.cpp"> + </File> + <File RelativePath="..\src\GearedMotor.cpp"> </File> *************** *** 186,189 **** --- 189,195 ---- </File> <File + RelativePath="..\src\CollisionEventHandler.h"> + </File> + <File RelativePath="..\src\Defines.h"> </File> *************** *** 201,204 **** --- 207,213 ---- </File> <File + RelativePath="..\src\JointBreakEventHandler.h"> + </File> + <File RelativePath="..\src\JointData.h"> </File> |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 16:10:35
|
Update of /cvsroot/opal/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11795 Modified Files: todo.txt Log Message: added contact groups; added separate event handlers for collisions and joint break events; commented out mass ratio stuff Index: todo.txt =================================================================== RCS file: /cvsroot/opal/opal/todo.txt,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** todo.txt 5 Mar 2005 21:26:23 -0000 1.50 --- todo.txt 8 Mar 2005 16:10:25 -0000 1.51 *************** *** 2,9 **** ================= - * remove ray and plane from the usual set of shapes? - - Simulator::createPlane; this might cause problems since the plane needs Material, collision group, etc. - - ray is just used for raycasting anyway, it'll be used in the raycast sensor - * look at scons dylib-building problem on os x --- 2,5 ---- *************** *** 66,69 **** --- 62,66 ---- * look at (and maybe remove) mass ratio stuff - there may be a problem when you have a tiny object between two massive objects; one massive object should affect the other but can't + - removing this also may fix the problem where a huge object dropped on a tiny object traps the smaller one underneath; the small one constantly wriggles around, but the large one doesn't move. * should all modes with multiple options (e.g. spring motor, accel sensor) take bit flags? |
|
From: tylerstreeter <tyl...@us...> - 2005-03-08 16:10:34
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11795/src/ODE Modified Files: ODEJoint.cpp ODESimulator.cpp Log Message: added contact groups; added separate event handlers for collisions and joint break events; commented out mass ratio stuff Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** ODESimulator.cpp 5 Mar 2005 21:26:24 -0000 1.84 --- ODESimulator.cpp 8 Mar 2005 16:10:24 -0000 1.85 *************** *** 76,80 **** setSolverAccuracy(defaults::solverAccuracy); - //setDefaultSleepiness(defaults::sleepiness); mCollisionCount = 0; } --- 76,79 ---- *************** *** 258,264 **** dSpaceCollide2(o0, o1, data, &internal_collisionCallback); - // Colliding all geoms internal to the space. if (dGeomIsSpace(o0)) { dSpaceCollide((dSpaceID)o0, data, &internal_collisionCallback); --- 257,263 ---- dSpaceCollide2(o0, o1, data, &internal_collisionCallback); if (dGeomIsSpace(o0)) { + // Colliding all geoms internal to the space. dSpaceCollide((dSpaceID)o0, data, &internal_collisionCallback); *************** *** 267,270 **** --- 266,270 ---- if (dGeomIsSpace(o1)) { + // Colliding all geoms internal to the space. dSpaceCollide((dSpaceID)o1, data, &internal_collisionCallback); *************** *** 275,279 **** // Colliding two geoms. ! // Use category/collide bitfields here? dBodyID o0BodyID = dGeomGetBody(o0); --- 275,308 ---- // Colliding two geoms. ! // The following is a set of special cases where we might ! // not want to do collision detection (but not all are ! // enforced here for various reasons): ! // 1. Two static Solids (neither geom has a body): this is ! // not enforced because sometimes you might want two ! // static Solids to generate collision events. ! // 2. Two Shapes that are part of the same Solid (they ! // share a body): this is not enforced because ODE ! // already takes care of it. ! // 3. Two sleeping Solids (note: both must have bodies to ! // check this): this is enforced. ODE should handle ! // this, but it doesn't. ! // 4. Two Solids connected by a fixed Joint: this is ! // enforced. ! // 5. Two Solids connected by a Joint (besides ODE ! // contact joints, which never generate ! // contacts) (note: both must have ! // bodies to check this): this is enforced for now; it ! // might be nice to have a Joint option that says whether ! // the Joint's two ! // Solids generate contacts with each other... I'll ! // mark that as a TODO; if this is implemented, be sure ! // to update the comments for ! // Simulator::setupContactGroups. ! // 6. Solid0 is static and Solid1 is sleeping: not enforced ! // because sometimes you might want to wake up a sleeping ! // Solid with a static Solid. ! // 7. Solid1 is static and Solid0 is sleeping: not enforced ! // because sometimes you might want to wake up a sleeping ! // Solid with a static Solid. dBodyID o0BodyID = dGeomGetBody(o0); *************** *** 285,309 **** } ! // Don't do collision detection for the following cases: ! // 1. two static solids (neither geom has a body) ! // 2. two shapes that are part of the same solid (they share a ! // body) ! // 3. two sleeping solids - note: both must have bodies to ! // check this ! // 4. two joined solids (but not contact joints); note: both ! // must have bodies to check this ! // 5. solid0 is static and solid1 is sleeping ! // 6. solid1 is static and solid0 is sleeping ! // Note: cases 5 and 6 will keep static solids from waking up ! // sleeping solids ! if ((0 == o0BodyID && 0 == o1BodyID) //case 1 ! //|| (o0BodyID == o1BodyID) //case 2 -> handled by ODE ! || (bothHaveBodies && !dBodyIsEnabled(o0BodyID) && !dBodyIsEnabled(o1BodyID)) //case 3 ! || (bothHaveBodies && dAreConnectedExcluding(o0BodyID, ! o1BodyID, dJointTypeContact)) //case 4 ! || (0 == o0BodyID && !dBodyIsEnabled(o1BodyID)) //case 5 ! || (0 == o1BodyID && !dBodyIsEnabled(o0BodyID)) //case 6 ) { --- 314,332 ---- } ! // TODO: find a way to get access to the Joint* for #5... ! // check if ODE has user data* for joints. If this ! // doesn't work, just have a boolean in the Simulator that ! // affects all Joints. ! if (//(0 == o0BodyID && 0 == o1BodyID) //case 1 ! //|| (o0BodyID == o1BodyID) //case 2 ! (bothHaveBodies && !dBodyIsEnabled(o0BodyID) && !dBodyIsEnabled(o1BodyID)) //case 3 ! //|| (connected by a fixed joint) // case 4 TODO ! || (bothHaveBodies && dAreConnectedExcluding( ! o0BodyID, o1BodyID, dJointTypeContact)) //&& TODO ! //jointContactsEnabled) //case 5 ! //|| (0 == o0BodyID && !dBodyIsEnabled(o1BodyID)) //case 6 ! //|| (0 == o1BodyID && !dBodyIsEnabled(o0BodyID)) //case 7 ) { *************** *** 321,324 **** --- 344,349 ---- sizeof(dContactGeom)); + // If the two objects didn't make any contacts, they weren't + // touching, so just return. if (0 == numContacts) { *************** *** 327,342 **** dContact tempContact; ! bool generateContacts0 = true; // Default to true. ! bool generateContacts1 = true; // Default to true. ! GeomData* geomData0 = ((GeomData*)dGeomGetData(o0)); GeomData* geomData1 = ((GeomData*)dGeomGetData(o1)); Solid* solid0 = geomData0->solid; Solid* solid1 = geomData1->solid; ! // Early check to save some time. ! if (solid0->getEventHandler() || solid1->getEventHandler()) { ! // Call the event handlers. Note: we only use one ! // contact point per collision; just use the first one // in the contact array. The order of the Solids // passed to the event handlers is important: the first --- 352,385 ---- dContact tempContact; ! //bool generateContacts0 = true; // Default to true. ! //bool generateContacts1 = true; // Default to true. ! GeomData* geomData0 = (GeomData*)dGeomGetData(o0); GeomData* geomData1 = ((GeomData*)dGeomGetData(o1)); + const ShapeData* shape0 = geomData0->shape; + const ShapeData* shape1 = geomData1->shape; Solid* solid0 = geomData0->solid; Solid* solid1 = geomData1->solid; ! // We only need to check for "one side" of the contact group ! // here because the groups are always setup both ways (i.e. ! // the interaction between object 0's contact group and ! // object 1's contact group is always symmetric). ! bool makeContacts = false; ! unsigned long int group1Bit = 1 << shape1->contactGroup; ! if (sim->internal_getContactGroupFlags(shape0->contactGroup) ! & group1Bit) { ! makeContacts = true; ! } ! ! // If at least one of the Solids has a CollisionEventHandler, ! // send it a CollisionEvent. ! CollisionEventHandler* handler0 = solid0->getEventHandler(); ! CollisionEventHandler* handler1 = solid1->getEventHandler(); ! ! if (handler0 || handler1) ! { ! // Call the CollisionEventHandlers. Note that we only ! // use one contact point per collision: just the first one // in the contact array. The order of the Solids // passed to the event handlers is important: the first *************** *** 345,350 **** CollisionEvent e; ! e.solid0 = solid0; ! e.solid1 = solid1; e.pos[0] = contactArray[0].pos[0]; e.pos[1] = contactArray[0].pos[1]; --- 388,393 ---- CollisionEvent e; ! e.thisSolid = solid0; ! e.otherSolid = solid1; e.pos[0] = contactArray[0].pos[0]; e.pos[1] = contactArray[0].pos[1]; *************** *** 355,392 **** e.depth = contactArray[0].depth; ! EventHandler* eventHandler = solid0->getEventHandler(); ! if (eventHandler) { ! generateContacts0 = ! eventHandler->handleCollisionEvent(e); } ! e.normal *= -1; // Invert normal. ! e.solid0 = solid1; // Swap solid pointers. ! e.solid1 = solid0; ! ! eventHandler = solid1->getEventHandler(); ! if (eventHandler) { ! generateContacts1 = ! eventHandler->handleCollisionEvent(e); } } ! // Handle one-sided contacts for two cases: 1) only one of ! // the above event handlers actually wants contacts generated, ! // 2) if the mass ratio is above some threshold, treat it as ! // a one-sided collision solution: treat the more massive ! // object as static, calculate the collision like normal ! // (with the massive one being static), then also add the ! // massive object's velocity to the smaller one (velocity ! // calculated at the point of collision). ! if (true == generateContacts0 || true == generateContacts1) { for(int i=0; i<numContacts; ++i) { ! const Material* m0 = &(geomData0->shape->material); ! const Material* m1 = &(geomData1->shape->material); tempContact.surface.mode = dContactBounce | --- 398,464 ---- e.depth = contactArray[0].depth; ! if (handler0) { ! handler0->handleCollisionEvent(e); } ! if (handler1) { ! // For the other Solid's CollisionEventHandler, we need ! // to invert the normal and swap the Solid pointers. ! e.normal *= -1; ! e.thisSolid = solid1; ! e.otherSolid = solid0; ! handler1->handleCollisionEvent(e); } } ! // Old version... ! //// Early check to save some time. ! //if (solid0->getEventHandler() || solid1->getEventHandler()) ! //{ ! // // Call the event handlers. Note: we only use one ! // // contact point per collision; just use the first one ! // // in the contact array. The order of the Solids ! // // passed to the event handlers is important: the first ! // // one should be the one whose event handler is ! // // getting called. ! // CollisionEvent e; ! // e.solid0 = solid0; ! // e.solid1 = solid1; ! // e.pos[0] = contactArray[0].pos[0]; ! // e.pos[1] = contactArray[0].pos[1]; ! // e.pos[2] = contactArray[0].pos[2]; ! // e.normal[0] = contactArray[0].normal[0]; ! // e.normal[1] = contactArray[0].normal[1]; ! // e.normal[2] = contactArray[0].normal[2]; ! // e.depth = contactArray[0].depth; ! ! // EventHandler* eventHandler = solid0->getEventHandler(); ! // if (eventHandler) ! // { ! // generateContacts0 = ! // eventHandler->handleCollisionEvent(e); ! // } ! ! // e.normal *= -1; // Invert normal. ! // e.solid0 = solid1; // Swap solid pointers. ! // e.solid1 = solid0; ! ! // eventHandler = solid1->getEventHandler(); ! // if (eventHandler) ! // { ! // generateContacts1 = ! // eventHandler->handleCollisionEvent(e); ! // } ! //} ! ! if (makeContacts) { for(int i=0; i<numContacts; ++i) { ! const Material* m0 = &(shape0->material); ! const Material* m1 = &(shape1->material); tempContact.surface.mode = dContactBounce | *************** *** 448,545 **** theWorldID, theJointGroupID, &tempContact); ! if (!bothHaveBodies) ! { ! // at least one object is static, so just handle ! // things like normal ! dJointAttach(contactJoint, o0BodyID, o1BodyID); ! } ! else ! { ! // calculate mass ratio (use mass1 / mass2); if ! // the ratio is too high, mass1 is too large; if ! // the ratio is too low, mass2 is too large ! real massRatio = 0; ! dMass mass0, mass1; ! dBodyGetMass(o0BodyID, &mass0); ! dBodyGetMass(o1BodyID, &mass1); ! massRatio = mass0.mass / mass1.mass; ! // here we handle all the different collision ! // cases: one solid or the other or both may want ! // contacts generated; also, the mass ratio may ! // be outside the acceptable range ! if (true == generateContacts0 && true == ! generateContacts1) ! { ! // both want contacts, neither wants to be ! // static ! if (massRatio > defaults::ode::maxMassRatio) ! { ! // ratio is too high - mass0 is too large, ! // treat solid0 as static ! dBodyEnable(o1BodyID); ! dJointAttach(contactJoint, 0, o1BodyID); ! } ! else if (massRatio < ! defaults::ode::minMassRatio) ! { ! // ratio is too low - mass1 is too large, ! // treat solid1 as static ! dBodyEnable(o0BodyID); ! dJointAttach(contactJoint, o0BodyID, 0); ! } ! else ! { ! //ratio is good - no static objects ! dJointAttach(contactJoint, o0BodyID, ! o1BodyID); ! } ! } ! else if (true == generateContacts0) ! { ! // solid0 wants contacts, solid1 wants to be ! // static ! if (massRatio > defaults::ode::maxMassRatio) ! { ! // ratio is too high - mass0 is too large, ! // treat solid0 and solid1 as static ! // i.e. don't generate a contact joint ! } ! else ! { ! // this block handles two cases which have ! // the same result: ! // 1. ratio is too low - mass1 is too ! // large, treat solid1 as static ! // 2. ratio is good - treat solid1 as ! // static ! dBodyEnable(o0BodyID); ! dJointAttach(contactJoint, o0BodyID, 0); ! } ! } ! else //generateContacts1 must be true ! { ! // solid1 wants contacts, solid0 wants to be ! // static ! if (massRatio < defaults::ode::minMassRatio) ! { ! // ratio is too low - mass1 is too large, ! // treat solid0 and solid1 as static ! // i.e. don't generate a contact joint ! } ! else ! { ! // this block handles two cases which have ! // the same result: ! // 1. ratio is too high - mass0 is too ! // large, treat solid0 as static ! // 2. ratio is good - treat solid0 as ! // static ! dBodyEnable(o1BodyID); ! dJointAttach(contactJoint, 0, o1BodyID); ! } ! } ! } } } --- 520,648 ---- theWorldID, theJointGroupID, &tempContact); ! // Note: the following line of code replaces the ! // rest of this function which is commented out. ! // TODO: test this and make sure the mass ratio ! // issues are unimportant and that we never need ! // "one-sided" contacts between two Solids. ! dJointAttach(contactJoint, o0BodyID, o1BodyID); ! //if (!bothHaveBodies) ! //{ ! // // at least one object is static, so just handle ! // // things like normal ! // dJointAttach(contactJoint, o0BodyID, o1BodyID); ! //} ! //else ! //{ ! // // TODO: We probably need to remove the following chunk of ! // // code. The first case is obsolete since now both sides ! // // always get contacts, if at all. (There isn't really a ! // // good reason to have one side use contacts but not the ! // // other; the side not wanting contacts would appear to be ! // // static, so just make it static in the first place. On ! // // the other hand, this may end up being desirable if ! // // an object should be moved by some objects but not ! // // others, and the "others" *do* collid with the first ! // // object... but this situation may never come up. The ! // // second case, using mass ratios to determine whether two ! // // objects should collide, might not be an issue. Mass ! // // ratios might only be a problem when the two objects are ! // // constantly connected with a Joint. ! // // Handle one-sided contacts for two cases: 1) only one of ! // // the above event handlers actually wants contacts generated, ! // // 2) if the mass ratio is above some threshold, treat it as ! // // a one-sided collision solution: treat the more massive ! // // object as static, calculate the collision like normal ! // // (with the massive one being static), then also add the ! // // massive object's velocity to the smaller one (velocity ! // // calculated at the point of collision). ! ! // // calculate mass ratio (use mass1 / mass2); if ! // // the ratio is too high, mass1 is too large; if ! // // the ratio is too low, mass2 is too large ! // real massRatio = 0; ! // dMass mass0, mass1; ! // dBodyGetMass(o0BodyID, &mass0); ! // dBodyGetMass(o1BodyID, &mass1); ! // massRatio = mass0.mass / mass1.mass; ! ! // // here we handle all the different collision ! // // cases: one solid or the other or both may want ! // // contacts generated; also, the mass ratio may ! // // be outside the acceptable range ! ! // if (true == generateContacts0 && true == ! // generateContacts1) ! // { ! // // both want contacts, neither wants to be ! // // static ! // if (massRatio > defaults::ode::maxMassRatio) ! // { ! // // ratio is too high - mass0 is too large, ! // // treat solid0 as static ! // dBodyEnable(o1BodyID); ! // dJointAttach(contactJoint, 0, o1BodyID); ! // } ! // else if (massRatio < ! // defaults::ode::minMassRatio) ! // { ! // // ratio is too low - mass1 is too large, ! // // treat solid1 as static ! // dBodyEnable(o0BodyID); ! // dJointAttach(contactJoint, o0BodyID, 0); ! // } ! // else ! // { ! // //ratio is good - no static objects ! // dJointAttach(contactJoint, o0BodyID, ! // o1BodyID); ! // } ! // } ! // else if (true == generateContacts0) ! // { ! // // solid0 wants contacts, solid1 wants to be ! // // static ! // if (massRatio > defaults::ode::maxMassRatio) ! // { ! // // ratio is too high - mass0 is too large, ! // // treat solid0 and solid1 as static ! // // i.e. don't generate a contact joint ! // } ! // else ! // { ! // // this block handles two cases which have ! // // the same result: ! // // 1. ratio is too low - mass1 is too ! // // large, treat solid1 as static ! // // 2. ratio is good - treat solid1 as ! // // static ! // dBodyEnable(o0BodyID); ! // dJointAttach(contactJoint, o0BodyID, 0); ! // } ! // } ! // else //generateContacts1 must be true ! // { ! // // solid1 wants contacts, solid0 wants to be ! // // static ! // if (massRatio < defaults::ode::minMassRatio) ! // { ! // // ratio is too low - mass1 is too large, ! // // treat solid0 and solid1 as static ! // // i.e. don't generate a contact joint ! // } ! // else ! // { ! // // this block handles two cases which have ! // // the same result: ! // // 1. ratio is too high - mass0 is too ! // // large, treat solid0 as static ! // // 2. ratio is good - treat solid0 as ! // // static ! // dBodyEnable(o1BodyID); ! // dJointAttach(contactJoint, 0, o1BodyID); ! // } ! // } ! //} } } Index: ODEJoint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODEJoint.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ODEJoint.cpp 1 Mar 2005 05:04:23 -0000 1.27 --- ODEJoint.cpp 8 Mar 2005 16:10:24 -0000 1.28 *************** *** 59,63 **** // Reset event handler. ! mEventHandler = NULL; } --- 59,63 ---- // Reset event handler. ! mJointBreakEventHandler = NULL; } |
|
From: tylerstreeter <tyl...@us...> - 2005-03-05 21:26:35
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5467/src Modified Files: BlueprintManager.cpp Defines.h EventHandler.h Joint.cpp Joint.h Motor.cpp Motor.h ShapeData.h Simulator.cpp Simulator.h SolidData.cpp opal.h Removed Files: RayShapeData.h Log Message: removed the Ray Shape; it should only be used for raycasting, not as an actual Shape attached to Solids Index: opal.h =================================================================== RCS file: /cvsroot/opal/opal/src/opal.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** opal.h 26 Feb 2005 10:22:23 -0000 1.18 --- opal.h 5 Mar 2005 21:26:24 -0000 1.19 *************** *** 37,41 **** #include "CapsuleShapeData.h" #include "PlaneShapeData.h" - #include "RayShapeData.h" #include "MeshShapeData.h" #include "Motor.h" --- 37,40 ---- Index: Defines.h =================================================================== RCS file: /cvsroot/opal/opal/src/Defines.h,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Defines.h 4 Mar 2005 23:26:53 -0000 1.65 --- Defines.h 5 Mar 2005 21:26:24 -0000 1.66 *************** *** 297,300 **** --- 297,301 ---- { const Material material = opal::globals::woodMaterial; + const unsigned int contactGroup = 0; const Vec3r boxDimensions = Vec3r(1, 1, 1); const real sphereRadius = 1; *************** *** 302,307 **** const real capsuleLength = 1; const real planeABCD[4] = {0, 1, 0, 0}; ! const Point3r rayOrigin = Point3r(0, 0, 0); ! const Vec3r rayDir = Vec3r(0, 0, -1); } --- 303,308 ---- const real capsuleLength = 1; const real planeABCD[4] = {0, 1, 0, 0}; ! //const Point3r rayOrigin = Point3r(0, 0, 0); ! //const Vec3r rayDir = Vec3r(0, 0, -1); } Index: Motor.h =================================================================== RCS file: /cvsroot/opal/opal/src/Motor.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Motor.h 25 Feb 2005 06:40:26 -0000 1.35 --- Motor.h 5 Mar 2005 21:26:24 -0000 1.36 *************** *** 42,49 **** /// attain a desired state, users should use a Motor that takes a /// desired position or velocity, automatically applying forces every ! /// time step to attain that state. Custom Motors can be created by ! /// subclassing the base Motor class, implementing a few virtual ! /// functions, and adding Motor instances to the simulation via the ! /// Simulator class (see Simulator for details). All Motors start out /// disabled and must be initialized via init before they can be /// enabled. --- 42,46 ---- /// attain a desired state, users should use a Motor that takes a /// desired position or velocity, automatically applying forces every ! /// time step to attain that state. All Motors start out /// disabled and must be initialized via init before they can be /// enabled. *************** *** 88,95 **** /// Sets whether this is a custom Motor. Used internally to /// track custom Motors which must not be destroyed by OPAL. ! virtual void OPAL_CALL internal_setCustom(bool c); /// Returns true if this is a custom Motor. ! virtual bool OPAL_CALL internal_isCustom(); protected: --- 85,92 ---- /// Sets whether this is a custom Motor. Used internally to /// track custom Motors which must not be destroyed by OPAL. ! //virtual void OPAL_CALL internal_setCustom(bool c); /// Returns true if this is a custom Motor. ! //virtual bool OPAL_CALL internal_isCustom(); protected: *************** *** 106,110 **** /// True if this is a custom Motor. This is used to ensure that /// custom Motors are not destroyed by OPAL. ! bool mIsCustom; /// True if the Motor has been initialized. Some Motors use --- 103,107 ---- /// True if this is a custom Motor. This is used to ensure that /// custom Motors are not destroyed by OPAL. ! //bool mIsCustom; /// True if the Motor has been initialized. Some Motors use Index: ShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/ShapeData.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ShapeData.h 1 Mar 2005 05:04:22 -0000 1.4 --- ShapeData.h 5 Mar 2005 21:26:24 -0000 1.5 *************** *** 40,44 **** CAPSULE_SHAPE, PLANE_SHAPE, ! RAY_SHAPE, MESH_SHAPE }; --- 40,44 ---- CAPSULE_SHAPE, PLANE_SHAPE, ! //RAY_SHAPE, MESH_SHAPE }; Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** Simulator.h 4 Mar 2005 23:26:53 -0000 1.78 --- Simulator.h 5 Mar 2005 21:26:24 -0000 1.79 *************** *** 147,150 **** --- 147,159 ---- virtual void* OPAL_CALL getUserData(); + /// Defines the interaction between two contact groups. If the + /// last argument is true, the two groups will generate physical + /// points when they collide. Otherwise, they will pass through + /// each other. This does not affect collision events; two + /// colliding objects might not generate contacts but still + /// generate collision events. + virtual void OPAL_CALL setupContactGroups(unsigned int group0, + unsigned int group1, bool makeContacts); + // SOLIDS *************** *** 191,195 **** /// Inform the Simulator of a custom Motor. Custom Motors are /// allocated and deallocated by the user ! virtual void OPAL_CALL registerCustomMotor(Motor* m); /// Marks the given Motor as garbage. --- 200,204 ---- /// Inform the Simulator of a custom Motor. Custom Motors are /// allocated and deallocated by the user ! //virtual void OPAL_CALL registerCustomMotor(Motor* m); /// Marks the given Motor as garbage. *************** *** 307,310 **** --- 316,323 ---- std::vector<Space*> mSpaceList; + /// A set of bitfields used to describe how different contact groups + /// interact. + unsigned long int mContactGroupFlags[32]; + private: }; --- RayShapeData.h DELETED --- Index: Joint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Joint.cpp 1 Mar 2005 05:04:22 -0000 1.23 --- Joint.cpp 5 Mar 2005 21:26:24 -0000 1.24 *************** *** 80,84 **** } ! void Joint::restoreAccumDamage() { mData.accumDamage = 0; --- 80,84 ---- } ! void Joint::repairAccumDamage() { mData.accumDamage = 0; Index: EventHandler.h =================================================================== RCS file: /cvsroot/opal/opal/src/EventHandler.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** EventHandler.h 18 Feb 2005 23:59:36 -0000 1.19 --- EventHandler.h 5 Mar 2005 21:26:24 -0000 1.20 *************** *** 64,69 **** {} ! /// Called when two Solids collide. Returns true if collision ! /// contacts should be generated between the two Solids. virtual bool OPAL_CALL handleCollisionEvent( const CollisionEvent& event) --- 64,69 ---- {} ! /// Called when two Solids collide. The first Solid in the ! /// CollisionEvent is the one whose event handler got called. virtual bool OPAL_CALL handleCollisionEvent( const CollisionEvent& event) Index: Joint.h =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.h,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Joint.h 4 Mar 2005 23:26:53 -0000 1.61 --- Joint.h 5 Mar 2005 21:26:24 -0000 1.62 *************** *** 82,88 **** real breakThresh, real accumThresh=0); ! /// Restores accumulated damage to breakable Joints in accumulated /// damage mode. This does not reenable the Joint. ! virtual void OPAL_CALL restoreAccumDamage(); /// Sets the Joint's event handler. --- 82,88 ---- real breakThresh, real accumThresh=0); ! /// Repairs accumulated damage to breakable Joints in accumulated /// damage mode. This does not reenable the Joint. ! virtual void OPAL_CALL repairAccumDamage(); /// Sets the Joint's event handler. Index: BlueprintManager.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/BlueprintManager.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** BlueprintManager.cpp 4 Mar 2005 23:26:53 -0000 1.29 --- BlueprintManager.cpp 5 Mar 2005 21:26:23 -0000 1.30 *************** *** 31,35 **** #include "CapsuleShapeData.h" #include "PlaneShapeData.h" - #include "RayShapeData.h" #include "MotorData.h" #include "AttractorMotorData.h" --- 31,34 ---- *************** *** 1278,1296 **** planeData->abcd[3] = getAttributeReal(dimensionsNodePtr, "d"); } ! else if ("ray" == type) ! { ! RayShapeData* rayData = new RayShapeData(); ! data = rayData; ! Point3r origin; ! origin[0] = getAttributeReal(dimensionsNodePtr, "originx"); ! origin[1] = getAttributeReal(dimensionsNodePtr, "originy"); ! origin[2] = getAttributeReal(dimensionsNodePtr, "originz"); ! rayData->ray.setOrigin(origin); ! Vec3r dir; ! dir[0] = getAttributeReal(dimensionsNodePtr, "dirx"); ! dir[1] = getAttributeReal(dimensionsNodePtr, "diry"); ! dir[2] = getAttributeReal(dimensionsNodePtr, "dirz"); ! rayData->ray.setDir(dir); ! } // MESH_SHAPE type not supported in OPAL XML. else --- 1277,1295 ---- planeData->abcd[3] = getAttributeReal(dimensionsNodePtr, "d"); } ! //else if ("ray" == type) ! //{ ! // RayShapeData* rayData = new RayShapeData(); ! // data = rayData; ! // Point3r origin; ! // origin[0] = getAttributeReal(dimensionsNodePtr, "originx"); ! // origin[1] = getAttributeReal(dimensionsNodePtr, "originy"); ! // origin[2] = getAttributeReal(dimensionsNodePtr, "originz"); ! // rayData->ray.setOrigin(origin); ! // Vec3r dir; ! // dir[0] = getAttributeReal(dimensionsNodePtr, "dirx"); ! // dir[1] = getAttributeReal(dimensionsNodePtr, "diry"); ! // dir[2] = getAttributeReal(dimensionsNodePtr, "dirz"); ! // rayData->ray.setDir(dir); ! //} // MESH_SHAPE type not supported in OPAL XML. else Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Simulator.cpp 3 Mar 2005 04:39:55 -0000 1.41 --- Simulator.cpp 5 Mar 2005 21:26:24 -0000 1.42 *************** *** 32,36 **** #include "CapsuleShapeData.h" #include "PlaneShapeData.h" - #include "RayShapeData.h" namespace opal --- 32,35 ---- *************** *** 102,106 **** // TODO: Call some user-defined function here... ! // Update sensors. std::vector<Sensor*>::iterator sensorIter; for (sensorIter = mSensorList.begin(); --- 101,105 ---- // TODO: Call some user-defined function here... ! // Update Sensors. std::vector<Sensor*>::iterator sensorIter; for (sensorIter = mSensorList.begin(); *************** *** 110,114 **** } ! // Update motors. std::vector<Motor*>::iterator motorIter; for (motorIter = mMotorList.begin(); --- 109,113 ---- } ! // Update Motors. std::vector<Motor*>::iterator motorIter; for (motorIter = mMotorList.begin(); *************** *** 126,162 **** } ! // Update joints, check for broken joints. std::vector<Joint*>::iterator jointIter; for (jointIter = mJointList.begin(); ! jointIter != mJointList.end();) { ! Joint* j = (*jointIter); ! j->internal_update(); ! ! // Don't automatically destroy the Joint anymore; just notify ! // the user and let them handle it. ! ! //if (j->internal_isBroken()) ! //{ ! // // Send a Joint break event. ! // j->internal_handleJointBreakEvent(); ! ! // //// don't use Simulator::destroyJoint here because that would loop ! // //// over the joints multiple times; ! // //// swap the element to be deleted with the last element ! // //std::swap(j, mJointList.back()); ! ! // //// update iterator ! // //(*jointIter) = j; ! ! // //// delete the last element ! // //delete mJointList.back(); ! // //mJointList.pop_back(); ! // destroyJoint(j); ! //} ! //else ! //{ ! ++jointIter; ! //} } --- 125,136 ---- } ! // Update Joints. std::vector<Joint*>::iterator jointIter; for (jointIter = mJointList.begin(); ! jointIter != mJointList.end(); ++jointIter) { ! // If the Joint gets broken here, it will automatically ! // send a Joint break event. ! (*jointIter)->internal_update(); } *************** *** 353,365 **** break; } ! case RAY_SHAPE: ! { ! RayShapeData* rayData = ! (RayShapeData*)shapeData; ! Point3r origin = rayData->ray.getOrigin(); ! origin = scale * origin; ! rayData->ray.setOrigin(origin); ! break; ! } case MESH_SHAPE: { --- 327,339 ---- break; } ! //case RAY_SHAPE: ! //{ ! // RayShapeData* rayData = ! // (RayShapeData*)shapeData; ! // Point3r origin = rayData->ray.getOrigin(); ! // origin = scale * origin; ! // rayData->ray.setOrigin(origin); ! // break; ! //} case MESH_SHAPE: { *************** *** 572,575 **** --- 546,567 ---- } + void Simulator::setupContactGroups(unsigned int group0, + unsigned int group1, bool makeContacts) + { + // The interaction always goes both ways, so we need to set the bit + // flags both ways. + unsigned long int group0Bit = 1 << group0; + unsigned long int group1Bit = 1 << group1; + + if (makeContacts) + { + //m + } + else + { + + } + } + void Simulator::destroySolid(Solid* s) { *************** *** 644,652 **** } ! void Simulator::registerCustomMotor(Motor* m) ! { ! m->internal_setCustom(true); ! addMotor(m); ! } void Simulator::destroyMotor(Motor* m) --- 636,644 ---- } ! //void Simulator::registerCustomMotor(Motor* m) ! //{ ! // m->internal_setCustom(true); ! // addMotor(m); ! //} void Simulator::destroyMotor(Motor* m) *************** *** 814,821 **** if(mMotorList[i] == m) { ! if (!m->internal_isCustom()) ! { ! delete m; ! } mMotorList[i] = mMotorList.back(); mMotorList.pop_back(); --- 806,814 ---- if(mMotorList[i] == m) { ! //if (!m->internal_isCustom()) ! //{ ! // delete m; ! //} ! delete m; mMotorList[i] = mMotorList.back(); mMotorList.pop_back(); Index: SolidData.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/SolidData.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SolidData.cpp 1 Mar 2005 05:04:22 -0000 1.2 --- SolidData.cpp 5 Mar 2005 21:26:24 -0000 1.3 *************** *** 31,35 **** #include "CapsuleShapeData.h" #include "PlaneShapeData.h" - #include "RayShapeData.h" #include "MeshShapeData.h" --- 31,34 ---- *************** *** 87,95 **** break; } ! case RAY_SHAPE: ! { ! newShape = new RayShapeData((RayShapeData&)data); ! break; ! } case MESH_SHAPE: { --- 86,94 ---- break; } ! //case RAY_SHAPE: ! //{ ! // newShape = new RayShapeData((RayShapeData&)data); ! // break; ! //} case MESH_SHAPE: { Index: Motor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Motor.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Motor.cpp 25 Feb 2005 06:40:26 -0000 1.14 --- Motor.cpp 5 Mar 2005 21:26:24 -0000 1.15 *************** *** 33,37 **** { // "mData" is initialized in its own constructor. ! mIsCustom = false; mInitCalled = false; setUserData(NULL); --- 33,37 ---- { // "mData" is initialized in its own constructor. ! //mIsCustom = false; mInitCalled = false; setUserData(NULL); *************** *** 68,79 **** } ! void Motor::internal_setCustom(bool c) ! { ! mIsCustom = c; ! } ! bool Motor::internal_isCustom() ! { ! return mIsCustom; ! } } --- 68,79 ---- } ! //void Motor::internal_setCustom(bool c) ! //{ ! // mIsCustom = c; ! //} ! //bool Motor::internal_isCustom() ! //{ ! // return mIsCustom; ! //} } |
|
From: tylerstreeter <tyl...@us...> - 2005-03-05 21:26:35
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5467/src/ODE Modified Files: ODESimulator.cpp ODESolid.cpp Log Message: removed the Ray Shape; it should only be used for raycasting, not as an actual Shape attached to Solids Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** ODESimulator.cpp 4 Mar 2005 05:09:24 -0000 1.83 --- ODESimulator.cpp 5 Mar 2005 21:26:24 -0000 1.84 *************** *** 337,344 **** if (solid0->getEventHandler() || solid1->getEventHandler()) { ! // Call the event handlers - they will return true if ! // they want contacts generated. Note: we only want up to ! // two events per object/object collision; just use the ! // first contact to pass data to the event handlers. CollisionEvent e; --- 337,346 ---- if (solid0->getEventHandler() || solid1->getEventHandler()) { ! // Call the event handlers. Note: we only use one ! // contact point per collision; just use the first one ! // in the contact array. The order of the Solids ! // passed to the event handlers is important: the first ! // one should be the one whose event handler is ! // getting called. CollisionEvent e; *************** *** 762,766 **** result.distance = mRaycastResult.distance; ! // finished with ray, so destroy it dGeomDestroy(rayGeomID); --- 764,768 ---- result.distance = mRaycastResult.distance; ! // Finished with ODE ray, so destroy it. dGeomDestroy(rayGeomID); Index: ODESolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.cpp,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** ODESolid.cpp 4 Mar 2005 23:26:54 -0000 1.74 --- ODESolid.cpp 5 Mar 2005 21:26:24 -0000 1.75 *************** *** 32,36 **** #include "../CapsuleShapeData.h" #include "../PlaneShapeData.h" - #include "../RayShapeData.h" #include "../MeshShapeData.h" --- 32,35 ---- *************** *** 337,343 **** // Planes have no mass. break; ! case RAY_SHAPE: ! // Rays have no mass. ! break; case MESH_SHAPE: // Not implemented. --- 336,342 ---- // Planes have no mass. break; ! //case RAY_SHAPE: ! // // Rays have no mass. ! // break; case MESH_SHAPE: // Not implemented. *************** *** 580,596 **** break; } ! case RAY_SHAPE: ! { ! RayShapeData& rayData = (RayShapeData&)data; ! newGeomID = dCreateRay(spaceID, ! (dReal)rayData.ray.getLength()); ! Point3r origin = rayData.ray.getOrigin(); ! Vec3r dir = rayData.ray.getDir(); ! dGeomRaySet(newGeomID, (dReal)origin[0], (dReal)origin[1], ! (dReal)origin[2], (dReal)dir[0], (dReal)dir[1], ! (dReal)dir[2]); ! // Note: rays don't have mass. ! break; ! } #ifdef OPAL_USE_MESH case MESH_SHAPE: --- 579,595 ---- break; } ! //case RAY_SHAPE: ! //{ ! // RayShapeData& rayData = (RayShapeData&)data; ! // newGeomID = dCreateRay(spaceID, ! // (dReal)rayData.ray.getLength()); ! // Point3r origin = rayData.ray.getOrigin(); ! // Vec3r dir = rayData.ray.getDir(); ! // dGeomRaySet(newGeomID, (dReal)origin[0], (dReal)origin[1], ! // (dReal)origin[2], (dReal)dir[0], (dReal)dir[1], ! // (dReal)dir[2]); ! // // Note: rays don't have mass. ! // break; ! //} #ifdef OPAL_USE_MESH case MESH_SHAPE: |
|
From: tylerstreeter <tyl...@us...> - 2005-03-05 21:26:34
|
Update of /cvsroot/opal/opal/vc7 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5467/vc7 Modified Files: opal-ode.vcproj Log Message: removed the Ray Shape; it should only be used for raycasting, not as an actual Shape attached to Solids Index: opal-ode.vcproj =================================================================== RCS file: /cvsroot/opal/opal/vc7/opal-ode.vcproj,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** opal-ode.vcproj 4 Mar 2005 23:26:55 -0000 1.14 --- opal-ode.vcproj 5 Mar 2005 21:26:24 -0000 1.15 *************** *** 225,231 **** </File> <File - RelativePath="..\src\RayShapeData.h"> - </File> - <File RelativePath="..\src\Sensor.h"> </File> --- 225,228 ---- |
|
From: tylerstreeter <tyl...@us...> - 2005-03-05 21:26:34
|
Update of /cvsroot/opal/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5467 Modified Files: readme.txt todo.txt Log Message: removed the Ray Shape; it should only be used for raycasting, not as an actual Shape attached to Solids Index: todo.txt =================================================================== RCS file: /cvsroot/opal/opal/todo.txt,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** todo.txt 4 Mar 2005 23:26:53 -0000 1.49 --- todo.txt 5 Mar 2005 21:26:23 -0000 1.50 *************** *** 2,9 **** ================= ! * look at scons dylib-building problem on os x ! * add scons examples to readme ! - mention that paths might need to be full paths * fix memory allocation across dll boundary --- 2,10 ---- ================= ! * remove ray and plane from the usual set of shapes? ! - Simulator::createPlane; this might cause problems since the plane needs Material, collision group, etc. ! - ray is just used for raycasting anyway, it'll be used in the raycast sensor ! * look at scons dylib-building problem on os x * fix memory allocation across dll boundary *************** *** 25,39 **** * reenable collision detection for static-static, static-sleeping cases (or have an option) * make trimeshes work - * get rid of custom motors? - - for one thing, we can't use them in xml - For Version 0.4.0 ================= - * custom sensors? - * search and replace existing assert() calls - fatal errors print a message and assert --- 26,36 ---- * reenable collision detection for static-static, static-sleeping cases (or have an option) + - solution: probably use collision groups for this * make trimeshes work For Version 0.4.0 ================= * search and replace existing assert() calls - fatal errors print a message and assert *************** *** 46,54 **** - not updated regularly; must be updated manually by user - should this be combined with trigger solids? probably not: ProximitySensors are one-time, triggers are always updated (triggers are actually just solids with a ContactSensor and don't generate contact joints) ! - ContactSensor ! - hold a queue of contact events (attach to a solid, to a single shape, or to nothing?) - use callback functions - user-derived class - vital part of "trigger volumes" - VelocitySensor: linear vel (i.e. "velocimeter") and/or angular vel ("gyroscope") sensor - AccelerationSensor (i.e. "accelerometer"): linear and/or angular acceleration sensor --- 43,54 ---- - not updated regularly; must be updated manually by user - should this be combined with trigger solids? probably not: ProximitySensors are one-time, triggers are always updated (triggers are actually just solids with a ContactSensor and don't generate contact joints) ! - CollisionSensor ! - hold a queue of collision events (attach to a solid, to a single shape, or to nothing?) - use callback functions - user-derived class - vital part of "trigger volumes" + - not available in XML because they're derived; ignore these when saving and loading + - JointBreakSensor + - not available in XML because they're derived; ignore these when saving and loading - VelocitySensor: linear vel (i.e. "velocimeter") and/or angular vel ("gyroscope") sensor - AccelerationSensor (i.e. "accelerometer"): linear and/or angular acceleration sensor *************** *** 73,76 **** --- 73,80 ---- * separate Motors with different modes into separate types? + * use custom motors? + - for one thing, we can't use them in xml + - if we use them, should we also have custom sensors? + Build System ============ Index: readme.txt =================================================================== RCS file: /cvsroot/opal/opal/readme.txt,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** readme.txt 3 Feb 2005 21:07:56 -0000 1.35 --- readme.txt 5 Mar 2005 21:26:23 -0000 1.36 *************** *** 30,33 **** --- 30,53 ---- Use the provided SConstruct (on any platform) to build a shared library for OPAL. A target physics engine is required (e.g. "scons ODE"). Type "scons -h" to get a description of targets and build options. The "install" target can be used to copy the headers and compiled library to some user-defined location. + For example, to build the OPAL library with ODE support, type: + + scons ODE + + This should generate opal-ode.so or opal-ode.dll, depending on the platform. Note that it builds the optimized version by default. To build the debug version without XML support, type: + + scons ODE debug=true XML=false + + You can specify additional include and library paths like this: + + scons ODE extra_include_path=/path/to/includes extra_lib_path=/path/to/libs + + Finally, to install the OPAL headers and library, do this: + + scons ODE install prefix=/path/to/install/dir + + This will create "include" and "lib" directories if they don't exist in the given prefix. The "install" will automatically make sure the built library is up-to-date. You can actually just type "scons ODE install prefix=/path/to/install/dir" to have SCons build and install everything. + + Be aware that any paths used here should be full paths, not relative ones. + ------------------------------------ |
|
From: tylerstreeter <tyl...@us...> - 2005-03-04 23:27:05
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21757/src/ODE Modified Files: ODEJoint.h ODESolid.cpp ODESolid.h Log Message: added a define to conditionally compile mesh support (mainly for ODE on IRIX which can't use trimeshes); removed some old commented-out code Index: ODEJoint.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODEJoint.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ODEJoint.h 26 Feb 2005 10:22:24 -0000 1.30 --- ODEJoint.h 4 Mar 2005 23:26:54 -0000 1.31 *************** *** 57,64 **** virtual void OPAL_CALL setLimitsEnabled(int axisNum, bool e); - //virtual void OPAL_CALL setLimits(int axisNum, JointLimits l); - - //virtual const JointLimits& OPAL_CALL getLimits(int axisNum)const; - virtual void OPAL_CALL setEnabled(bool e); --- 57,60 ---- *************** *** 87,94 **** void setJointParam(int parameter, dReal value); - /// Helper function to make it easier to get parameters for - /// various ODE Joint types. - //real getJointParam(int parameter)const; - /// Returns the current amount of stress on this Joint. virtual real calcStress(); --- 83,86 ---- Index: ODESolid.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.h,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** ODESolid.h 25 Feb 2005 06:40:26 -0000 1.63 --- ODESolid.h 4 Mar 2005 23:26:54 -0000 1.64 *************** *** 47,51 **** --- 47,53 ---- spaceID = 0; transformID = 0; + #ifdef OPAL_USE_MESH trimeshDataID = 0; + #endif } *************** *** 55,59 **** --- 57,63 ---- dSpaceID spaceID; dGeomID transformID; + #ifdef OPAL_USE_MESH dTriMeshDataID trimeshDataID; // only used for Solids with trimeshes + #endif }; *************** *** 83,115 **** virtual void OPAL_CALL addShape(const ShapeData& data); - //virtual void OPAL_CALL addBox(const Vec3r& dimensions, - // const Matrix44r& offset = Matrix44r(), - // const Material& m = defaults::material); - - //virtual void OPAL_CALL addSphere(real radius, - // const Matrix44r& offset = Matrix44r(), - // const Material& m = defaults::material); - - //virtual void OPAL_CALL addPlane(real abcd[4], - // const Material& m = defaults::material); - - ////note: normal cylinders are not yet part of standard ODE - ////virtual void addCylinder(real radius, real length, - //// const Matrix44r& offset = Matrix44r(), - //// const Material& m = defaults::material); - - //virtual void OPAL_CALL addCapsule(real radius, real length, - // const Matrix44r& offset = Matrix44r(), - // const Material& m = defaults::material); - - //virtual void OPAL_CALL addRay(const Point3r& origin, const Vec3r& dir, - // real length, const Matrix44r& offset = Matrix44r(), - // const Material& m = defaults::material); - // - //virtual void OPAL_CALL addMesh(const real* vertexArray[3], - // int numVertices, const int* faceArray, int numFaces, - // const Matrix44r& offset = Matrix44r(), - // const Material& m = defaults::material); - virtual void OPAL_CALL setLocalLinearVel(const Vec3r& vel); --- 87,90 ---- Index: ODESolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** ODESolid.cpp 1 Mar 2005 05:04:23 -0000 1.73 --- ODESolid.cpp 4 Mar 2005 23:26:54 -0000 1.74 *************** *** 82,85 **** --- 82,86 ---- } + #ifdef OPAL_USE_MESH if (0 != mGeomDataList.back()->trimeshDataID) { *************** *** 89,92 **** --- 90,94 ---- dGeomTriMeshDataDestroy(mGeomDataList.back()->trimeshDataID); } + #endif // Destroy the ODE geom. *************** *** 338,342 **** // Rays have no mass. break; ! // TODO: add MESH_SHAPE type default: assert(false); --- 340,346 ---- // Rays have no mass. break; ! case MESH_SHAPE: ! // Not implemented. ! break; default: assert(false); *************** *** 480,484 **** --- 484,492 ---- dGeomID newGeomID = NULL; dGeomID newTransformID = NULL; + + #ifdef OPAL_USE_MESH dTriMeshDataID newTrimeshDataID = NULL; + #endif + dSpaceID spaceID = NULL; dMass newMass; *************** *** 487,492 **** { // No offset transform. - //newGeomID = dCreateBox(mSpaceID, dimensions[0], dimensions[1], - // dimensions[2]); spaceID = mSpaceID; newTransformID = 0; --- 495,498 ---- *************** *** 495,500 **** { // Use ODE's geom transform object. - //newGeomID = dCreateBox(0, dimensions[0], dimensions[1], - // dimensions[2]); spaceID = 0; newTransformID = dCreateGeomTransform(mSpaceID); --- 501,504 ---- *************** *** 534,542 **** (dReal)capsuleData.radius, (dReal)capsuleData.length); ! //The "direction" parameter orients the mass along one of the ! //body's local axes; x=1, y=2, z=3. TODO: This might be weird ! //if this capsule is not oriented along one of the body's axes. ! //Maybe have a default value in the Simulator that the user can ! //change. dMassSetCappedCylinder(&newMass, (dReal)data.material.density, 3, (dReal)capsuleData.radius, (dReal)capsuleData.length); --- 538,546 ---- (dReal)capsuleData.radius, (dReal)capsuleData.length); ! // The "direction" parameter orients the mass along one of the ! // body's local axes; x=1, y=2, z=3. TODO: This might be weird ! // if this capsule is not oriented along one of the body's axes. ! // Maybe have a default value in the Simulator that the user can ! // change. dMassSetCappedCylinder(&newMass, (dReal)data.material.density, 3, (dReal)capsuleData.radius, (dReal)capsuleData.length); *************** *** 548,553 **** if (!mData.isStatic) { ! // TODO: print warning: opal::ODESolid::addPlane: plane ! // Shape added to a non-static Solid. // ODE planes can't have bodies, so make it static. --- 552,558 ---- if (!mData.isStatic) { ! OPAL_LOGGER("warning") << "opal::ODESolid::addPlane: " << ! "Plane Shape added to a non-static Solid. " << ! "The Solid will be made static." << std::endl; // ODE planes can't have bodies, so make it static. *************** *** 588,591 **** --- 593,597 ---- break; } + #ifdef OPAL_USE_MESH case MESH_SHAPE: { *************** *** 607,610 **** --- 613,617 ---- break; } + #endif default: assert(false); *************** *** 623,627 **** --- 630,637 ---- newGeomData->transformID = newTransformID; newGeomData->spaceID = mSpaceID; + + #ifdef OPAL_USE_MESH newGeomData->trimeshDataID = newTrimeshDataID; + #endif // Setup the geom. *************** *** 629,915 **** } - //void ODESolid::addBox(const Vec3r& dimensions, const Matrix44r& offset, - // const Material& m) - //{ - // dGeomID newGeomID; - // dGeomID newTransformID; - - // if(Matrix44r() == offset) - // { - // //no offset transform - // newGeomID = dCreateBox(mSpaceID, dimensions[0], dimensions[1], - // dimensions[2]); - // newTransformID = 0; - // } - // else - // { - // //use ODE's geom transform object - // newGeomID = dCreateBox(0, dimensions[0], dimensions[1], - // dimensions[2]); - // newTransformID = dCreateGeomTransform(mSpaceID); - // } - - // if (!mStatic) - // { - // //setup new mass - // dMass newMass; - // dMassSetBox(&newMass, m.density, dimensions[0], dimensions[1], - // dimensions[2]); - // addMass(newMass, offset); - // } - - // GeomData* newGeomData = new GeomData; - - // newGeomData->solid = this; - // newGeomData->geomID = newGeomID; - // newGeomData->transformID = newTransformID; - // newGeomData->spaceID = mSpaceID; - // newGeomData->shape.type = BOX_SHAPE; - // newGeomData->shape.material = m; - // newGeomData->shape.offset = offset; - // newGeomData->shape.dimensions[0] = dimensions[0]; - // newGeomData->shape.dimensions[1] = dimensions[1]; - // newGeomData->shape.dimensions[2] = dimensions[2]; - - // setupNewGeom(newGeomData); - //} - - //void ODESolid::addSphere(real radius, const Matrix44r& offset, - // const Material& m) - //{ - // dGeomID newGeomID; - // dGeomID newTransformID; - - // if(Matrix44r() == offset) - // { - // //no offset transform - // newGeomID = dCreateSphere(mSpaceID, radius); - // newTransformID = 0; - // } - // else - // { - // //use ODE's geom transform object - // newGeomID = dCreateSphere(0, radius); - // newTransformID = dCreateGeomTransform(mSpaceID); - // } - - // if (!mStatic) - // { - // //setup new mass - // dMass newMass; - // dMassSetSphere(&newMass, m.density, radius); - // addMass(newMass, offset); - // } - - // GeomData* newGeomData = new GeomData; - - // newGeomData->solid = this; - // newGeomData->geomID = newGeomID; - // newGeomData->transformID = newTransformID; - // newGeomData->spaceID = mSpaceID; - // newGeomData->shape.type = SPHERE_SHAPE; - // newGeomData->shape.material = m; - // newGeomData->shape.offset = offset; - // newGeomData->shape.dimensions[0] = radius; - - // setupNewGeom(newGeomData); - //} - - //void ODESolid::addPlane(real abcd[4], const Material& m) - //{ - // //TODO: figure out what to do with ODE planes; setting their transform - // //crashes since ODE planes can't be moved - - // if (!mStatic) - // { - // std::cout << "Error in opal::ODESolid::addPlane: Plane shape \ - // added to a non-static solid" << std::endl; - - // //ODE planes can't have bodies - // assert(false); - // } - - // dGeomID newGeomID; - - // // ODE planes must have their normal vector (abc) normalized - // Vec3r normal(abcd[0], abcd[1], abcd[2]); - // normal.normalize(); - // abcd[0] = normal[0]; - // abcd[1] = normal[1]; - // abcd[2] = normal[2]; - - // //no offset transform - // newGeomID = dCreatePlane(mSpaceID, abcd[0], abcd[1], abcd[2], - // abcd[3]); - - // // note: no mass for this object since planes can't have mass - - // mIsPlaceable = false; - - // GeomData* newGeomData = new GeomData; - - // newGeomData->solid = this; - // newGeomData->geomID = newGeomID; - // newGeomData->transformID = 0; - // newGeomData->spaceID = mSpaceID; - // newGeomData->shape.type = PLANE_SHAPE; - // newGeomData->shape.material = m; - // newGeomData->shape.offset.makeIdentity(); - // newGeomData->shape.dimensions[0] = abcd[0]; - // newGeomData->shape.dimensions[1] = abcd[1]; - // newGeomData->shape.dimensions[2] = abcd[2]; - // newGeomData->shape.dimensions[3] = abcd[3]; - - // setupNewGeom(newGeomData); - //} - - //void ODESolid::addCapsule(real radius, real length, - // const Matrix44r& offset, const Material& m) - //{ - // dGeomID newGeomID; - // dGeomID newTransformID; - - // if(Matrix44r() == offset) - // { - // //no offset transform - // newGeomID = dCreateCCylinder(mSpaceID, radius, length); - // newTransformID = 0; - // } - // else - // { - // //use ODE's geom transform object - // newGeomID = dCreateCCylinder(0, radius, length); - // newTransformID = dCreateGeomTransform(mSpaceID); - // } - - // if (!mStatic) - // { - // //setup new mass - // dMass newMass; - // // The "direction" parameter orients the mass along one of the - // // body's local axes; x=1, y=2, z=3. TODO: This might be weird - // // if this capsule is not oriented along one of the body's axes. - // // Maybe have a default value in the Simulator that the user can - // // change. - // dMassSetCappedCylinder(&newMass, m.density, 3, radius, length); - // addMass(newMass, offset); - // } - - // GeomData* newGeomData = new GeomData; - - // newGeomData->solid = this; - // newGeomData->geomID = newGeomID; - // newGeomData->transformID = newTransformID; - // newGeomData->spaceID = mSpaceID; - // newGeomData->shape.type = CAPSULE_SHAPE; - // newGeomData->shape.material = m; - // newGeomData->shape.offset = offset; - // newGeomData->shape.dimensions[0] = radius; - // newGeomData->shape.dimensions[1] = length; - - // setupNewGeom(newGeomData); - //} - - //void ODESolid::addRay(const Point3r& origin, const Vec3r& dir, - // real length, const Matrix44r& offset, const Material& m) - //{ - // dGeomID newGeomID; - // dGeomID newTransformID; - - // if(Matrix44r() == offset) - // { - // //no offset transform - // newGeomID = dCreateRay(mSpaceID, length); - // dGeomRaySet(newGeomID, origin[0], origin[1], origin[2], dir[0], - // dir[1], dir[2]); - // newTransformID = 0; - // } - // else - // { - // //use ODE's geom transform object - // newGeomID = dCreateRay(0, length); - // dGeomRaySet(newGeomID, origin[0], origin[1], origin[2], dir[0], - // dir[1], dir[2]); - // newTransformID = dCreateGeomTransform(mSpaceID); - // } - - // //note: no mass for this object since rays can't have mass - - // GeomData* newGeomData = new GeomData; - - // newGeomData->solid = this; - // newGeomData->geomID = newGeomID; - // newGeomData->transformID = newTransformID; - // newGeomData->spaceID = mSpaceID; - // newGeomData->shape.type = RAY_SHAPE; - // newGeomData->shape.material = m; - // newGeomData->shape.offset = offset; - // newGeomData->shape.dimensions[0] = origin[0]; - // newGeomData->shape.dimensions[1] = origin[1]; - // newGeomData->shape.dimensions[2] = origin[2]; - // newGeomData->shape.dimensions[3] = dir[3]; - // newGeomData->shape.dimensions[4] = dir[4]; - // newGeomData->shape.dimensions[5] = dir[5]; - // newGeomData->shape.dimensions[6] = length; - - // setupNewGeom(newGeomData); - //} - - //void ODESolid::addMesh(const real* vertexArray[3], int numVertices, - // const int* faceArray, int numFaces, const Matrix44r& offset, - // const Material& m) - //{ - // dGeomID newGeomID; - // dGeomID newTransformID; - // dTriMeshDataID newTrimeshDataID; - - // // Setup trimesh data pointer. It is critical that the size of OPAL - // // reals at this point match the size of ODE's dReals. - // newTrimeshDataID = dGeomTriMeshDataCreate(); - // dGeomTriMeshDataBuildSimple(newTrimeshDataID, (dReal*)vertexArray, - // numVertices, faceArray, numFaces*3); - - // if(Matrix44r() == offset) - // { - // //no offset transform - // newGeomID = dCreateTriMesh(mSpaceID, newTrimeshDataID, NULL, - // NULL, NULL); - // newTransformID = 0; - // } - // else - // { - // //use ODE's geom transform object - // newGeomID = dCreateTriMesh(0, newTrimeshDataID, NULL, NULL, NULL); - // newTransformID = dCreateGeomTransform(mSpaceID); - // } - - // if (!mStatic) - // { - // // TODO: either do more sophisticated mass calculations, or just - // // enforce that all mesh must be static - - // // setup new mass - // dMass newMass; - // dMassSetSphere(&newMass, m.density, 1); - // addMass(newMass, offset); - // } - - // GeomData* newGeomData = new GeomData; - - // newGeomData->solid = this; - // newGeomData->geomID = newGeomID; - // newGeomData->transformID = newTransformID; - // newGeomData->spaceID = mSpaceID; - // newGeomData->shape.type = MESH_SHAPE; - // newGeomData->shape.material = m; - // newGeomData->shape.offset = offset; - // newGeomData->trimeshDataID = newTrimeshDataID; - - // // TODO: calculate trimesh dimensions (extents) and store them in the - // // geom data struct dimensions - - // setupNewGeom(newGeomData); - //} - void ODESolid::setLocalLinearVel(const Vec3r& vel) { --- 639,642 ---- |