opal-commits Mailing List for Open Physics Abstraction Layer (Page 20)
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: tylerstreeter <tyl...@us...> - 2005-03-21 04:29:14
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15060/src/ODE Modified Files: ODESimulator.cpp Log Message: added a PostStepEventHandler that gets notified at the end of every simulation step Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** ODESimulator.cpp 14 Mar 2005 01:20:55 -0000 1.91 --- ODESimulator.cpp 21 Mar 2005 04:29:05 -0000 1.92 *************** *** 395,400 **** // 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) --- 395,402 ---- // If at least one of the Solids has a CollisionEventHandler, // send it a CollisionEvent. ! CollisionEventHandler* handler0 = ! solid0->getCollisionEventHandler(); ! CollisionEventHandler* handler1 = ! solid1->getCollisionEventHandler(); if (handler0 || handler1) *************** *** 436,440 **** // Old version... //// Early check to save some time. ! //if (solid0->getEventHandler() || solid1->getEventHandler()) //{ // // Call the event handlers. Note: we only use one --- 438,443 ---- // Old version... //// Early check to save some time. ! //if (solid0->getCollisionEventHandler() ! // || solid1->getCollisionEventHandler()) //{ // // Call the event handlers. Note: we only use one *************** *** 456,460 **** // e.depth = contactArray[0].depth; ! // EventHandler* eventHandler = solid0->getEventHandler(); // if (eventHandler) // { --- 459,464 ---- // e.depth = contactArray[0].depth; ! // EventHandler* eventHandler = ! // solid0->getCollisionEventHandler(); // if (eventHandler) // { *************** *** 467,471 **** // e.solid1 = solid0; ! // eventHandler = solid1->getEventHandler(); // if (eventHandler) // { --- 471,475 ---- // e.solid1 = solid0; ! // eventHandler = solid1->getCollisionEventHandler(); // if (eventHandler) // { |
|
From: tylerstreeter <tyl...@us...> - 2005-03-21 04:29:14
|
Update of /cvsroot/opal/opal/samples/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15060/samples/src Modified Files: Base3DObject.h CapsuleObject.cpp Log Message: added a PostStepEventHandler that gets notified at the end of every simulation step Index: Base3DObject.h =================================================================== RCS file: /cvsroot/opal/opal/samples/src/Base3DObject.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Base3DObject.h 1 Mar 2005 05:04:20 -0000 1.8 --- Base3DObject.h 21 Mar 2005 04:29:05 -0000 1.9 *************** *** 44,47 **** --- 44,63 ---- } + void DrawCapsule(opal::real radius, opal::real length) + { + glPushMatrix(); + glTranslatef(0.0, 0.0, -length * (opal::real)0.5); + gluCylinder(mQuadric, radius, radius, length, 20, 20); + glPopMatrix(); + glPushMatrix(); + glTranslatef(0.0, 0.0, length * (opal::real)0.5); + gluSphere(mQuadric, radius, 20, 20); + glPopMatrix(); + glPushMatrix(); + glTranslatef(0.0, 0.0, -length * (opal::real)0.5); + gluSphere(mQuadric, radius, 20, 20); + glPopMatrix(); + } + void DrawBox(const opal::Vec3r& dimensions) { Index: CapsuleObject.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/src/CapsuleObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CapsuleObject.cpp 4 Mar 2005 05:09:23 -0000 1.2 --- CapsuleObject.cpp 21 Mar 2005 04:29:05 -0000 1.3 *************** *** 35,50 **** glMultMatrixf(mSolid->getTransform().getData()); glMultMatrixf(mOffset.getData()); ! glPushMatrix(); ! glTranslatef(0.0, 0.0, -mLength * (opal::real)0.5); ! gluCylinder(mQuadric, mRadius, mRadius, mLength, 20, 20); ! glPopMatrix(); ! glPushMatrix(); ! glTranslatef(0.0, 0.0, mLength * (opal::real)0.5); ! gluSphere(mQuadric, mRadius, 20, 20); ! glPopMatrix(); ! glPushMatrix(); ! glTranslatef(0.0, 0.0, -mLength * (opal::real)0.5); ! gluSphere(mQuadric, mRadius, 20, 20); ! glPopMatrix(); glPopMatrix(); } --- 35,39 ---- glMultMatrixf(mSolid->getTransform().getData()); glMultMatrixf(mOffset.getData()); ! DrawCapsule(mRadius, mLength); glPopMatrix(); } |
|
From: tylerstreeter <tyl...@us...> - 2005-03-21 04:29:13
|
Update of /cvsroot/opal/opal/samples/simple_objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15060/samples/simple_objects Modified Files: main.cpp Log Message: added a PostStepEventHandler that gets notified at the end of every simulation step Index: main.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/simple_objects/main.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** main.cpp 13 Mar 2005 23:06:54 -0000 1.25 --- main.cpp 21 Mar 2005 04:29:05 -0000 1.26 *************** *** 13,17 **** #include "../src/CarObject.h" #include "../src/Timer.h" - #include <opal/Matrix44r.h> #define SDL_SYSTEMS_USED SDL_INIT_VIDEO --- 13,16 ---- |
|
From: tylerstreeter <tyl...@us...> - 2005-03-21 04:29:13
|
Update of /cvsroot/opal/opal/samples/car In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15060/samples/car Modified Files: main.cpp Log Message: added a PostStepEventHandler that gets notified at the end of every simulation step Index: main.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/car/main.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** main.cpp 1 Mar 2005 05:04:19 -0000 1.23 --- main.cpp 21 Mar 2005 04:29:04 -0000 1.24 *************** *** 12,16 **** #include "../src/CarObject.h" #include "../src/Timer.h" - #include <opal/Matrix44r.h> #define SDL_SYSTEMS_USED SDL_INIT_VIDEO --- 12,15 ---- |
|
From: Andres R. <ar...@us...> - 2005-03-21 03:54:06
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24480/src Modified Files: VolumeSensor.h Log Message: added getSolid back into sensor and added clearShapes into ODESolid (I think) Index: VolumeSensor.h =================================================================== RCS file: /cvsroot/opal/opal/src/VolumeSensor.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VolumeSensor.h 14 Mar 2005 05:18:27 -0000 1.3 --- VolumeSensor.h 21 Mar 2005 03:53:57 -0000 1.4 *************** *** 75,88 **** /// Returns the number of Solids in the results. ! OPAL_DECL int OPAL_CALL getNumSolids()const { ! return (int)(mSolidList.size()); } ! // This is probably not needed... ! //Solid* getSolid(unsigned int i)const ! //{ ! // return mSolidList.at(i); ! //} /// Removes all Solids from the results. --- 75,87 ---- /// Returns the number of Solids in the results. ! OPAL_DECL unsigned int OPAL_CALL getNumSolids()const { ! return (unsigned int)(mSolidList.size()); } ! OPAL_DECL Solid* OPAL_CALL getSolid(unsigned int i)const ! { ! return mSolidList.at(i); ! } /// Removes all Solids from the results. |
|
From: Andres R. <ar...@us...> - 2005-03-21 03:54:06
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24480/src/ODE Modified Files: ODESolid.cpp Log Message: added getSolid back into sensor and added clearShapes into ODESolid (I think) Index: ODESolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.cpp,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** ODESolid.cpp 10 Mar 2005 21:11:05 -0000 1.76 --- ODESolid.cpp 21 Mar 2005 03:53:57 -0000 1.77 *************** *** 96,101 **** // Delete the geom data object. delete mGeomDataList[i]; - - mGeomDataList.pop_back(); } mGeomDataList.clear(); --- 96,99 ---- |
|
From: tylerstreeter <tyl...@us...> - 2005-03-14 22:36:41
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4849/src Modified Files: BlueprintManager.cpp SConscript Log Message: improved error messages of XML attribute parsing Index: SConscript =================================================================== RCS file: /cvsroot/opal/opal/src/SConscript,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SConscript 14 Mar 2005 05:18:27 -0000 1.15 --- SConscript 14 Mar 2005 22:36:31 -0000 1.16 *************** *** 35,39 **** RaycastSensorData.h Rayr.h - RayShapeData.h Sensor.h SensorData.h --- 35,38 ---- Index: BlueprintManager.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/BlueprintManager.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** BlueprintManager.cpp 13 Mar 2005 23:07:09 -0000 1.32 --- BlueprintManager.cpp 14 Mar 2005 22:36:31 -0000 1.33 *************** *** 1524,1529 **** { OPAL_LOGGER("warning") << ! "opal::BlueprintManager::getAttribute: Missing attribute " ! << name << ". Value will be set to 0.0." << std::endl; return 0; } --- 1524,1531 ---- { OPAL_LOGGER("warning") << ! "opal::BlueprintManager::getAttribute: Element " ! << nodePtr->Value() << " is missing attribute " ! << name << ". Parameter will be set to 0.0." ! << std::endl; return 0; } *************** *** 1549,1554 **** { OPAL_LOGGER("warning") << ! "opal::BlueprintManager::getAttribute: Missing attribute " ! << name << ". Value will be set to NULL." << std::endl; return ""; } --- 1551,1558 ---- { OPAL_LOGGER("warning") << ! "opal::BlueprintManager::getAttribute: Element " ! << nodePtr->Value() << " is missing attribute " ! << name << ". Parameter will be set to \"\"." ! << std::endl; return ""; } |
|
From: tylerstreeter <tyl...@us...> - 2005-03-14 05:18:39
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23596/src Modified Files: RaycastSensor.h SConscript Simulator.cpp VolumeSensor.h opal.h Added Files: AccelerationSensor.cpp AccelerationSensor.h AccelerationSensorData.h VelocitySensor.cpp VelocitySensor.h VelocitySensorData.h Log Message: added VelocitySensor and AccelerationSensor --- NEW FILE: AccelerationSensor.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_ACCELERATION_SENSOR_H #define OPAL_ACCELERATION_SENSOR_H #include "Defines.h" #include "Sensor.h" #include "AccelerationSensorData.h" namespace opal { /// A Sensor that monitors the linear and angular acceleration of a /// Solid. Using its transform, it can be set to a desired offset from /// the attached Solid. This Sensor does nothing if it is not attached /// to a Solid (i.e. its returned values are always zero). class AccelerationSensor : public Sensor { public: AccelerationSensor(); virtual ~AccelerationSensor(); /// Initializes the Sensor with the given data structure. If the /// Solid pointer in the data is valid, the Sensor's offset will /// be relative to the Solid's transform instead of the global /// origin. virtual void OPAL_CALL init(const AccelerationSensorData& data); /// Returns all data describing the Sensor. virtual const AccelerationSensorData& OPAL_CALL getData()const; /// Returns the Sensor's global linear acceleration. virtual real OPAL_CALL getGlobalLinearAccel()const; /// Returns the Sensor's global angular acceleration. virtual real OPAL_CALL getGlobalAngularAccel()const; /// Returns the Sensor's local linear acceleration. virtual real OPAL_CALL getLocalLinearAccel()const; /// Returns the Sensor's local angular acceleration. virtual real OPAL_CALL getLocalAngularAccel()const; virtual void OPAL_CALL setEnabled(bool e); virtual bool OPAL_CALL isEnabled()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. AccelerationSensorData mData; private: }; } #endif --- NEW FILE: AccelerationSensor.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 "AccelerationSensor.h" #include "Simulator.h" namespace opal { AccelerationSensor::AccelerationSensor() { // "mData" is initialized in its own constructor. } AccelerationSensor::~AccelerationSensor() { } void AccelerationSensor::init(const AccelerationSensorData& data) { Sensor::init(); mData = data; } const AccelerationSensorData& AccelerationSensor::getData()const { return mData; } real AccelerationSensor::getGlobalLinearAccel()const { if (!mData.solid) { return 0; } // TODO: use the Sensor's transform to find its actual position // in global coordinates. // TODO: get the acceleration of the Solid at the Sensor's position. return 0; // temporary } real AccelerationSensor::getGlobalAngularAccel()const { if (!mData.solid) { return 0; } // TODO: use the Sensor's transform to find its actual position // in global coordinates. // TODO: get the acceleration of the Solid at the Sensor's position. return 0; // temporary } real AccelerationSensor::getLocalLinearAccel()const { if (!mData.solid) { return 0; } // TODO: use the Sensor's transform to find its actual position // relative to the Solid. // TODO: get the acceleration of the Solid at the Sensor's position. return 0; // temporary } real AccelerationSensor::getLocalAngularAccel()const { if (!mData.solid) { return 0; } // TODO: use the Sensor's transform to find its actual position // relative to the Solid. // TODO: get the acceleration of the Solid at the Sensor's position. return 0; // temporary } void AccelerationSensor::setEnabled(bool e) { if (!mInitCalled) { return; } mData.enabled = e; } bool AccelerationSensor::isEnabled()const { return mData.enabled; } SensorType AccelerationSensor::getType()const { return mData.getType(); } void AccelerationSensor::setTransform(const Matrix44r& t) { mData.transform = t; } const Matrix44r& AccelerationSensor::getTransform()const { return mData.transform; } void AccelerationSensor::setName(const std::string& name) { mData.name = name; } const std::string& AccelerationSensor::getName()const { return mData.name; } void AccelerationSensor::internal_update() { if (mData.enabled) { // TODO: update acceleration calculations } } bool AccelerationSensor::internal_dependsOn(Solid* solid) { if (solid == mData.solid) { return true; } else { return false; } } } Index: opal.h =================================================================== RCS file: /cvsroot/opal/opal/src/opal.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** opal.h 12 Mar 2005 01:21:17 -0000 1.22 --- opal.h 14 Mar 2005 05:18:27 -0000 1.23 *************** *** 54,59 **** --- 54,63 ---- #include "Sensor.h" #include "SensorData.h" + #include "AccelerationSensor.h" + #include "AccelerationSensorData.h" #include "RaycastSensor.h" #include "RaycastSensorData.h" + #include "VelocitySensor.h" + #include "VelocitySensorData.h" #include "VolumeSensor.h" #include "VolumeSensorData.h" --- NEW FILE: VelocitySensor.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 "VelocitySensor.h" #include "Simulator.h" namespace opal { VelocitySensor::VelocitySensor() { // "mData" is initialized in its own constructor. } VelocitySensor::~VelocitySensor() { } void VelocitySensor::init(const VelocitySensorData& data) { Sensor::init(); mData = data; } const VelocitySensorData& VelocitySensor::getData()const { return mData; } real VelocitySensor::getGlobalLinearVel()const { if (!mData.solid) { return 0; } // TODO: use the Sensor's transform to find its actual position // in global coordinates. // TODO: get the velocity of the Solid at the Sensor's position. return 0; // temporary } real VelocitySensor::getGlobalAngularVel()const { if (!mData.solid) { return 0; } // TODO: use the Sensor's transform to find its actual position // in global coordinates. // TODO: get the velocity of the Solid at the Sensor's position. return 0; // temporary } real VelocitySensor::getLocalLinearVel()const { if (!mData.solid) { return 0; } // TODO: use the Sensor's transform to find its actual position // relative to the Solid. // TODO: get the velocity of the Solid at the Sensor's position. return 0; // temporary } real VelocitySensor::getLocalAngularVel()const { if (!mData.solid) { return 0; } // TODO: use the Sensor's transform to find its actual position // relative to the Solid. // TODO: get the velocity of the Solid at the Sensor's position. return 0; // temporary } void VelocitySensor::setEnabled(bool e) { if (!mInitCalled) { return; } mData.enabled = e; } bool VelocitySensor::isEnabled()const { return mData.enabled; } SensorType VelocitySensor::getType()const { return mData.getType(); } void VelocitySensor::setTransform(const Matrix44r& t) { mData.transform = t; } const Matrix44r& VelocitySensor::getTransform()const { return mData.transform; } void VelocitySensor::setName(const std::string& name) { mData.name = name; } const std::string& VelocitySensor::getName()const { return mData.name; } void VelocitySensor::internal_update() { if (mData.enabled) { // Do nothing. } } bool VelocitySensor::internal_dependsOn(Solid* solid) { if (solid == mData.solid) { return true; } else { return false; } } } Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Simulator.cpp 13 Mar 2005 23:07:10 -0000 1.46 --- Simulator.cpp 14 Mar 2005 05:18:27 -0000 1.47 *************** *** 38,41 **** --- 38,43 ---- #include "SpringMotor.h" #include "RaycastSensor.h" + #include "VelocitySensor.h" + #include "AccelerationSensor.h" #include "VolumeSensor.h" --- NEW FILE: VelocitySensor.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_VELOCITY_SENSOR_H #define OPAL_VELOCITY_SENSOR_H #include "Defines.h" #include "Sensor.h" #include "VelocitySensorData.h" namespace opal { /// A Sensor that monitors the linear and angular velocity of a Solid. /// Using its transform, it can be set to a desired offset from the /// attached Solid. This Sensor does nothing if it is not attached /// to a Solid (i.e. its returned values are always zero). Note that /// if you never need the velocity offset from a Solid, you can also /// use the Solid's get velocity functions. class VelocitySensor : public Sensor { public: VelocitySensor(); virtual ~VelocitySensor(); /// Initializes the Sensor with the given data structure. If the /// Solid pointer in the data is valid, the Sensor's offset will /// be relative to the Solid's transform instead of the global /// origin. virtual void OPAL_CALL init(const VelocitySensorData& data); /// Returns all data describing the Sensor. virtual const VelocitySensorData& OPAL_CALL getData()const; /// Returns the Sensor's global linear velocity. virtual real OPAL_CALL getGlobalLinearVel()const; /// Returns the Sensor's global angular velocity. virtual real OPAL_CALL getGlobalAngularVel()const; /// Returns the Sensor's local linear velocity. virtual real OPAL_CALL getLocalLinearVel()const; /// Returns the Sensor's local angular velocity. virtual real OPAL_CALL getLocalAngularVel()const; virtual void OPAL_CALL setEnabled(bool e); virtual bool OPAL_CALL isEnabled()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. VelocitySensorData mData; private: }; } #endif --- NEW FILE: VelocitySensorData.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_VELOCITY_SENSOR_DATA_H #define OPAL_VELOCITY_SENSOR_DATA_H #include "Defines.h" #include "SensorData.h" namespace opal { /// A data structure describing a VelocitySensor. class VelocitySensorData : public SensorData { public: OPAL_DECL VelocitySensorData() : SensorData() { mType = VELOCITY_SENSOR; } /// Copy constructor. OPAL_DECL VelocitySensorData(const VelocitySensorData& data) { (*this) = data; } OPAL_DECL virtual ~VelocitySensorData() { } /// Makes a deep copy. OPAL_DECL virtual void OPAL_CALL operator=( const VelocitySensorData& data) { mType = data.mType; enabled = data.enabled; name = data.name; solid = data.solid; internal_solidIndex = data.internal_solidIndex; internal_solidName = data.internal_solidName; transform = data.transform; } protected: private: }; } #endif Index: RaycastSensor.h =================================================================== RCS file: /cvsroot/opal/opal/src/RaycastSensor.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RaycastSensor.h 12 Mar 2005 01:21:16 -0000 1.4 --- RaycastSensor.h 14 Mar 2005 05:18:27 -0000 1.5 *************** *** 85,89 **** /// 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. --- 85,89 ---- /// A Sensor that fires a ray into a scene and returns data describing ! /// the closest intersection, if any. This Sensor does not fire a ray /// every time step because that would be a waste of time in most /// cases; it must be "fired" manually. Index: VolumeSensor.h =================================================================== RCS file: /cvsroot/opal/opal/src/VolumeSensor.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VolumeSensor.h 14 Mar 2005 01:20:53 -0000 1.2 --- VolumeSensor.h 14 Mar 2005 05:18:27 -0000 1.3 *************** *** 114,118 **** /// a specified volume. Each volume query returns a data structure /// containing a list of those Solids. This Sensor does not do a volume ! /// query on every time step because that would be a waste of time in /// most cases; it must be queried manually. class VolumeSensor : public Sensor --- 114,118 ---- /// a specified volume. Each volume query returns a data structure /// containing a list of those Solids. This Sensor does not do a volume ! /// query every time step because that would be a waste of time in /// most cases; it must be queried manually. class VolumeSensor : public Sensor --- NEW FILE: AccelerationSensorData.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_ACCELERATION_SENSOR_DATA_H #define OPAL_ACCELERATION_SENSOR_DATA_H #include "Defines.h" #include "SensorData.h" namespace opal { /// A data structure describing an AccelerationSensor. class AccelerationSensorData : public SensorData { public: OPAL_DECL AccelerationSensorData() : SensorData() { mType = ACCELERATION_SENSOR; } /// Copy constructor. OPAL_DECL AccelerationSensorData(const AccelerationSensorData& data) { (*this) = data; } OPAL_DECL virtual ~AccelerationSensorData() { } /// Makes a deep copy. OPAL_DECL virtual void OPAL_CALL operator=( const AccelerationSensorData& data) { mType = data.mType; enabled = data.enabled; name = data.name; solid = data.solid; internal_solidIndex = data.internal_solidIndex; internal_solidName = data.internal_solidName; transform = data.transform; } protected: private: }; } #endif Index: SConscript =================================================================== RCS file: /cvsroot/opal/opal/src/SConscript,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SConscript 12 Mar 2005 01:21:16 -0000 1.14 --- SConscript 14 Mar 2005 05:18:27 -0000 1.15 *************** *** 4,7 **** --- 4,9 ---- # OPAL headers headers = Split(""" + AccelerationSensor.h + AccelerationSensorData.h AttractorMotor.h AttractorMotorData.h *************** *** 50,53 **** --- 52,57 ---- ThrusterMotorData.h Vec3r.h + VelocitySensor.h + VelocitySensorData.h VolumeSensor.h VolumeSensorData.h *************** *** 56,59 **** --- 60,64 ---- # OPAL sources sources = Split(""" + AccelerationSensor.cpp AttractorMotor.cpp Blueprint.cpp *************** *** 73,76 **** --- 78,82 ---- SpringMotor.cpp ThrusterMotor.cpp + VelocitySensor.cpp VolumeSensor.cpp """) |
|
From: tylerstreeter <tyl...@us...> - 2005-03-14 05:18:38
|
Update of /cvsroot/opal/opal/vc7 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23596/vc7 Modified Files: opal-ode.vcproj Log Message: added VelocitySensor and AccelerationSensor Index: opal-ode.vcproj =================================================================== RCS file: /cvsroot/opal/opal/vc7/opal-ode.vcproj,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** opal-ode.vcproj 12 Mar 2005 01:21:17 -0000 1.18 --- opal-ode.vcproj 14 Mar 2005 05:18:28 -0000 1.19 *************** *** 116,119 **** --- 116,122 ---- Filter=""> <File + RelativePath="..\src\AccelerationSensor.cpp"> + </File> + <File RelativePath="..\src\AttractorMotor.cpp"> </File> *************** *** 167,170 **** --- 170,176 ---- </File> <File + RelativePath="..\src\VelocitySensor.cpp"> + </File> + <File RelativePath="..\src\VolumeSensor.cpp"> </File> *************** *** 174,177 **** --- 180,189 ---- Filter=""> <File + RelativePath="..\src\AccelerationSensor.h"> + </File> + <File + RelativePath="..\src\AccelerationSensorData.h"> + </File> + <File RelativePath="..\src\AttractorMotor.h"> </File> *************** *** 291,294 **** --- 303,312 ---- </File> <File + RelativePath="..\src\VelocitySensor.h"> + </File> + <File + RelativePath="..\src\VelocitySensorData.h"> + </File> + <File RelativePath="..\src\VolumeSensor.h"> </File> |
|
From: tylerstreeter <tyl...@us...> - 2005-03-14 05:18:38
|
Update of /cvsroot/opal/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23596 Modified Files: todo.txt Log Message: added VelocitySensor and AccelerationSensor Index: todo.txt =================================================================== RCS file: /cvsroot/opal/opal/todo.txt,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** todo.txt 13 Mar 2005 23:07:12 -0000 1.54 --- todo.txt 14 Mar 2005 05:18:28 -0000 1.55 *************** *** 3,9 **** * additional sensors ! - vel, accel, incline/orientation; relate these to vestibular senses? ! * sensors - parse from xml - add to xml example --- 3,11 ---- * additional sensors ! - incline/orientation relative to an initial orientation ! * finish implementing accel and vel sensors ! ! * accel and vel sensors: - parse from xml - add to xml example *************** *** 12,15 **** --- 14,27 ---- - add to Blueprint addSensor function + * 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) + - not updated regularly; must be updated manually by user + - VolumeSensor (i.e. "proximity sensor?"): similar to RaycastSensor, but for a volume; finds all Solids colliding with a given (attached) Solid + - 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) + - VelocitySensor: linear vel (i.e. "velocimeter") and/or angular vel ("gyroscope") sensor + - AccelerationSensor (i.e. "accelerometer"): linear and/or angular acceleration sensor + - InclineSensor (i.e. "inclinometer"): measures angle between initial and current orientation + * make trimeshes work *************** *** 28,41 **** - 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) - - not updated regularly; must be updated manually by user - - VolumeSensor (i.e. "proximity sensor?"): similar to RaycastSensor, but for a volume; finds all Solids colliding with a given (attached) Solid - - 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) - - VelocitySensor: linear vel (i.e. "velocimeter") and/or angular vel ("gyroscope") sensor - - AccelerationSensor (i.e. "accelerometer"): linear and/or angular acceleration sensor - - InclineSensor (i.e. "inclinometer"): measures angle between initial and current orientation - * dynamic number of contact joints? - depends on types of objects --- 40,43 ---- |
|
From: tylerstreeter <tyl...@us...> - 2005-03-14 05:18:36
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23596/src/ODE Modified Files: ODESimulator.h Log Message: added VelocitySensor and AccelerationSensor Index: ODESimulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.h,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** ODESimulator.h 14 Mar 2005 01:20:55 -0000 1.64 --- ODESimulator.h 14 Mar 2005 05:18:26 -0000 1.65 *************** *** 32,36 **** --- 32,38 ---- #include "../Defines.h" #include "../Simulator.h" + #include "../AccelerationSensor.h" #include "../RaycastSensor.h" + #include "../VelocitySensor.h" #include "../VolumeSensor.h" #include "ODESolid.h" |
|
From: tylerstreeter <tyl...@us...> - 2005-03-14 01:21:16
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27784/src/ODE Modified Files: ODESimulator.cpp ODESimulator.h Log Message: finished implementing RaycastSensor and VolumeSensor Index: ODESimulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.h,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** ODESimulator.h 12 Mar 2005 01:21:15 -0000 1.63 --- ODESimulator.h 14 Mar 2005 01:20:55 -0000 1.64 *************** *** 97,101 **** virtual const RaycastResult& OPAL_CALL internal_fireRay( ! const Rayr& r, real length); /// Helper function used for ray casting. --- 97,101 ---- virtual const RaycastResult& OPAL_CALL internal_fireRay( ! const Rayr& r, real length, const Solid* attachedSolid); /// Helper function used for ray casting. *************** *** 107,111 **** virtual const VolumeQueryResult& OPAL_CALL internal_queryVolume( ! const Solid* volume); protected: --- 107,111 ---- virtual const VolumeQueryResult& OPAL_CALL internal_queryVolume( ! const Solid* volume, const Solid* attachedSolid); protected: *************** *** 132,135 **** --- 132,141 ---- /// Used for ray casting. RaycastResult mRaycastResult; + + /// Used for ray casting and volume queries. If a RaycastSensor or + /// VolumeSensor is attached to a Solid, this pointer will point to + /// that Solid. It is used to make sure the raycasts and collision + /// query doesn't collide with the attached Solid. + const Solid* mSensorSolid; private: }; Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** ODESimulator.cpp 12 Mar 2005 01:21:08 -0000 1.90 --- ODESimulator.cpp 14 Mar 2005 01:20:55 -0000 1.91 *************** *** 76,79 **** --- 76,81 ---- setSolverAccuracy(defaults::solverAccuracy); mCollisionCount = 0; + // "mRaycastResult" is initialized in its own constructor. + mSensorSolid = NULL; } *************** *** 82,85 **** --- 84,108 ---- } + Solid* ODESimulator::createSolid() + { + Solid* newSolid = new ODESolid(mWorldID, mRootSpaceID); + addSolid(newSolid); + return newSolid; + } + + Space* ODESimulator::createSpace() + { + Space* newSpace = new ODESpace(); + addSpace(newSpace); + return newSpace; + } + + Joint* ODESimulator::createJoint() + { + Joint* newJoint = new ODEJoint(mWorldID); + addJoint(newJoint); + return newJoint; + } + void ODESimulator::destroy() { *************** *** 690,694 **** if (dGeomIsSpace(o0) || dGeomIsSpace(o1)) { ! //colliding a space with either a geom or another space dSpaceCollide2(o0, o1, data, &internal_volumeCollisionCallback); --- 713,717 ---- if (dGeomIsSpace(o0) || dGeomIsSpace(o1)) { ! // Colliding a space with either a geom or another space. dSpaceCollide2(o0, o1, data, &internal_volumeCollisionCallback); *************** *** 696,700 **** else { ! //colliding two geoms dBodyID o0BodyID = dGeomGetBody(o0); --- 719,723 ---- else { ! // Colliding two geoms. dBodyID o0BodyID = dGeomGetBody(o0); *************** *** 749,753 **** if (dGeomIsSpace(o0) || dGeomIsSpace(o1)) { ! //colliding a space with either a geom or another space dSpaceCollide2(o0, o1, data, &internal_volumeCollisionCallback); --- 772,776 ---- if (dGeomIsSpace(o0) || dGeomIsSpace(o1)) { ! // Colliding a space with either a geom or another space. dSpaceCollide2(o0, o1, data, &internal_volumeCollisionCallback); *************** *** 755,761 **** else { ! //colliding two geoms ! //now actually test for collision between the two geoms dContactGeom contactArray[1]; int numContacts = dCollide(o0, o1, 1, contactArray, --- 778,784 ---- else { ! // Colliding two geoms. ! // Now actually test for collision between the two geoms. dContactGeom contactArray[1]; int numContacts = dCollide(o0, o1, 1, contactArray, *************** *** 768,772 **** else { ! //these two geoms must be intersecting ODESimulator* sim = (ODESimulator*)data; --- 791,795 ---- else { ! // These two geoms must be intersecting. ODESimulator* sim = (ODESimulator*)data; *************** *** 789,792 **** --- 812,822 ---- void ODESimulator::internal_addCollidedSolid(Solid* solid) { + // If the collided Solid is attached to the Sensor performing the + // volume query, ignore this intersection. + if (mSensorSolid == solid) + { + return; + } + ODESolid* solidPtr = ((ODESolid*)solid); *************** *** 801,804 **** --- 831,843 ---- const Point3r& intersection, const Vec3r& normal, real distance) { + // If the collided Solid is attached to the Sensor performing the + // raycast, ignore this intersection. + if (mSensorSolid == solid) + { + return; + } + + // If this is the first collided Solid or the new intersection + // distance is less than the previous intersection's distance... if (NULL == mRaycastResult.solid || (distance < mRaycastResult.distance)) { *************** *** 830,856 **** //} - Solid* ODESimulator::createSolid() - { - Solid* newSolid = new ODESolid(mWorldID, mRootSpaceID); - addSolid(newSolid); - return newSolid; - } - - Space* ODESimulator::createSpace() - { - Space* newSpace = new ODESpace(); - addSpace(newSpace); - return newSpace; - } - - Joint* ODESimulator::createJoint() - { - Joint* newJoint = new ODEJoint(mWorldID); - addJoint(newJoint); - return newJoint; - } - const RaycastResult& ODESimulator::internal_fireRay(const Rayr& r, ! real length) { Point3r origin = r.getOrigin(); --- 869,874 ---- //} const RaycastResult& ODESimulator::internal_fireRay(const Rayr& r, ! real length, const Solid* attachedSolid) { Point3r origin = r.getOrigin(); *************** *** 861,864 **** --- 879,883 ---- mRaycastResult.normal.set(1,0,0); mRaycastResult.distance = 0; + mSensorSolid = attachedSolid; dGeomID rayGeomID = dCreateRay(mRootSpaceID, length); *************** *** 877,882 **** const VolumeQueryResult& ODESimulator::internal_queryVolume( ! const Solid* volume) { mCollisionCount++; mVolumeQueryResult.internal_clearSolids(); --- 896,902 ---- const VolumeQueryResult& ODESimulator::internal_queryVolume( ! const Solid* volume, const Solid* attachedSolid) { + mSensorSolid = attachedSolid; mCollisionCount++; mVolumeQueryResult.internal_clearSolids(); |
|
From: tylerstreeter <tyl...@us...> - 2005-03-14 01:21:16
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27784/src Modified Files: Matrix44r.h RaycastSensor.cpp Sensor.h Simulator.h Solid.cpp Solid.h VolumeSensor.cpp VolumeSensor.h Log Message: finished implementing RaycastSensor and VolumeSensor Index: Sensor.h =================================================================== RCS file: /cvsroot/opal/opal/src/Sensor.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Sensor.h 9 Mar 2005 02:09:49 -0000 1.8 --- Sensor.h 14 Mar 2005 01:20:53 -0000 1.9 *************** *** 34,42 **** 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 { --- 34,44 ---- namespace opal { ! /// A device that records data from a simulation. Sensors can either be ! /// attached to Solids or just positioned somewhere within an ! /// environment. Each Sensor maintains a transform matrix; depending ! /// on whether the Sensor is attached to a Solid, the transform is ! /// relative to the attached Solid or the global origin. All Sensors ! /// start out disabled and must be initialized (via init) before they ! /// can be enabled. class Sensor { *************** *** 65,69 **** /// Sets the Sensor's transform. ! virtual void OPAL_CALL setTransform(const Matrix44r& name) = 0; /// Returns the Sensor's transform. --- 67,71 ---- /// Sets the Sensor's transform. ! virtual void OPAL_CALL setTransform(const Matrix44r& t) = 0; /// Returns the Sensor's transform. Index: Solid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Solid.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Solid.cpp 8 Mar 2005 16:10:23 -0000 1.26 --- Solid.cpp 14 Mar 2005 01:20:53 -0000 1.27 *************** *** 137,143 **** } ! void Solid::setTransform(const Matrix44r& transform) { ! mData.transform = transform; internal_updateEngineTransform(); } --- 137,143 ---- } ! void Solid::setTransform(const Matrix44r& t) { ! mData.transform = t; internal_updateEngineTransform(); } Index: RaycastSensor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/RaycastSensor.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RaycastSensor.cpp 13 Mar 2005 23:07:10 -0000 1.5 --- RaycastSensor.cpp 14 Mar 2005 01:20:53 -0000 1.6 *************** *** 59,70 **** const RaycastResult& RaycastSensor::fireRay(real length) { ! // TODO: if mData.solid is valid, update this Sensor's ray ! // relative to the Solid; otherwise, update it relative to ! // global origin. ! // TODO: if this is attached to a Solid, keep the ray from ! // colliding with that Solid. ! return mSim->internal_fireRay(mData.ray, length); } --- 59,79 ---- const RaycastResult& RaycastSensor::fireRay(real length) { ! Rayr ray = mData.ray; ! // If the Sensor is attached to a Solid, we need to transform ! // the ray relative to that Solid's transform. ! if (mData.solid) ! { ! ray = mData.solid->getTransform() * ray; ! } ! // Use the Sensor's transform on the ray. ! ray = mData.transform * ray; ! ! // If this is attached to a Solid, the Simulator raycast function ! // will automatically ignore intersections between the ray and ! // that Solid. ! ! return mSim->internal_fireRay(ray, length, mData.solid); } Index: Solid.h =================================================================== RCS file: /cvsroot/opal/opal/src/Solid.h,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Solid.h 10 Mar 2005 21:10:36 -0000 1.82 --- Solid.h 14 Mar 2005 01:20:53 -0000 1.83 *************** *** 120,124 **** /// Sets this Solid's transform matrix. ! virtual void OPAL_CALL setTransform(const Matrix44r& transform); /// Returns a constant reference to this Solid's transform. --- 120,124 ---- /// Sets this Solid's transform matrix. ! virtual void OPAL_CALL setTransform(const Matrix44r& t); /// Returns a constant reference to this Solid's transform. Index: VolumeSensor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/VolumeSensor.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VolumeSensor.cpp 13 Mar 2005 23:07:11 -0000 1.2 --- VolumeSensor.cpp 14 Mar 2005 01:20:53 -0000 1.3 *************** *** 52,65 **** } ! const VolumeQueryResult& VolumeSensor::queryVolume(const Solid* volume) { ! // TODO: if mData.solid is valid, update this Sensor's transform ! // relative to the Solid; otherwise, update it relative to ! // global origin. ! // TODO: if this is attached to a Solid, don't add the volume Solid ! // to the results. ! return mSim->internal_queryVolume(volume); } --- 52,90 ---- } ! const VolumeQueryResult& VolumeSensor::queryVolume(Solid* volume) { ! // The volume Solid's transform will be totally ignored. ! // Store the volume Solid's transform. ! Matrix44r originalVolumeTransform = volume->getTransform(); ! Matrix44r newVolumeTransform; ! ! // If the Sensor is attached to a Solid, we need to transform ! // the volume relative to that Solid's transform. ! if (mData.solid) ! { ! newVolumeTransform = ! mData.solid->getTransform() * newVolumeTransform; ! } ! ! // Use the Sensor's transform on the volume. ! newVolumeTransform = mData.transform * newVolumeTransform; ! ! // Set the volume's new transform we just setup. ! volume->setTransform(newVolumeTransform); ! ! // If this is attached to a Solid, the Simulator volume query ! // function will automatically ignore intersections between the ! // volume and that Solid. ! ! // Query the volume for colliding Solids. ! const VolumeQueryResult& result = ! mSim->internal_queryVolume(volume, mData.solid); ! ! // Restore the volume Solid's original transform. ! volume->setTransform(originalVolumeTransform); ! ! return result; } Index: VolumeSensor.h =================================================================== RCS file: /cvsroot/opal/opal/src/VolumeSensor.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VolumeSensor.h 12 Mar 2005 01:21:17 -0000 1.1 --- VolumeSensor.h 14 Mar 2005 01:20:53 -0000 1.2 *************** *** 131,136 **** /// Queries the Sensor's environment with the given Solid's volume, /// returning a list of the Solids that collide with that Solid. virtual const VolumeQueryResult& OPAL_CALL queryVolume( ! const Solid* volume); virtual void OPAL_CALL setEnabled(bool e); --- 131,139 ---- /// Queries the Sensor's environment with the given Solid's volume, /// returning a list of the Solids that collide with that Solid. + /// The given Solid's transform will be totally ignored; use the + /// Sensor's transform instead. If this Sensor is attached to + /// a Solid, that Solid will not be added to the results. virtual const VolumeQueryResult& OPAL_CALL queryVolume( ! Solid* volume); virtual void OPAL_CALL setEnabled(bool e); Index: Matrix44r.h =================================================================== RCS file: /cvsroot/opal/opal/src/Matrix44r.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Matrix44r.h 2 Mar 2005 05:30:32 -0000 1.28 --- Matrix44r.h 14 Mar 2005 01:20:52 -0000 1.29 *************** *** 45,49 **** inline Matrix44r operator-(const Matrix44r & lhs, const Matrix44r & rhs); inline Point3r operator*(const Matrix44r & m, const Point3r &p); ! inline Rayr operator*(const Matrix44r & m, const Rayr &p); inline bool inverse(Matrix44r & dest, const Matrix44r & src); inline void fastInverse(Matrix44r & dest, const Matrix44r & src); --- 45,49 ---- inline Matrix44r operator-(const Matrix44r & lhs, const Matrix44r & rhs); inline Point3r operator*(const Matrix44r & m, const Point3r &p); ! inline Rayr operator*(const Matrix44r & m, const Rayr &r); inline bool inverse(Matrix44r & dest, const Matrix44r & src); inline void fastInverse(Matrix44r & dest, const Matrix44r & src); *************** *** 543,547 **** result(2, 2)).lengthSquared(); ! //TODO: write opal::abs if(fabs(l0) > eps) l0 = 1.0f / l0; if(fabs(l1) > eps) l1 = 1.0f / l1; --- 543,547 ---- result(2, 2)).lengthSquared(); ! // TODO: write opal::abs. if(fabs(l0) > eps) l0 = 1.0f / l0; if(fabs(l1) > eps) l1 = 1.0f / l1; *************** *** 648,658 **** } ! inline Rayr operator*(const Matrix44r & m, const Rayr & p) { ! Rayr r(m * p.getOrigin(), m * p.getDir()); ! return r; } } - #endif --- 648,657 ---- } ! inline Rayr operator*(const Matrix44r & m, const Rayr & r) { ! Rayr ray(m * r.getOrigin(), m * r.getDir()); ! return ray; } } #endif Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** Simulator.h 13 Mar 2005 23:07:11 -0000 1.86 --- Simulator.h 14 Mar 2005 01:20:53 -0000 1.87 *************** *** 226,234 **** /// into the scene and returns intersections results. virtual const RaycastResult& OPAL_CALL internal_fireRay( ! const Rayr& r, real length) = 0; /// Helper function used for volume queries. virtual const VolumeQueryResult& OPAL_CALL internal_queryVolume( ! const Solid* volume) = 0; /// Returns the Simulator's contact group flags. --- 226,234 ---- /// into the scene and returns intersections results. virtual const RaycastResult& OPAL_CALL internal_fireRay( ! const Rayr& r, real length, const Solid* attachedSolid) = 0; /// Helper function used for volume queries. virtual const VolumeQueryResult& OPAL_CALL internal_queryVolume( ! const Solid* volume, const Solid* attachedSolid) = 0; /// Returns the Simulator's contact group flags. |
|
From: tylerstreeter <tyl...@us...> - 2005-03-13 23:41:09
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv312/src Modified Files: Defines.h Log Message: changed ODE's global CFM from 1e-3 to 1e-5, hopefully making Joints less jittery during normal motion (not at stops) Index: Defines.h =================================================================== RCS file: /cvsroot/opal/opal/src/Defines.h,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Defines.h 8 Mar 2005 22:05:02 -0000 1.68 --- Defines.h 13 Mar 2005 23:40:53 -0000 1.69 *************** *** 395,400 **** const real minERP=(real)0.1; const real maxERP=(real)0.9; ! const real globalCFM=(real)1e-3; ! const real jointFudgeFactor=(real)0.001; const real maxFriction=(real)1000.0; const real maxCorrectingVel=(real)40.0; --- 395,400 ---- const real minERP=(real)0.1; const real maxERP=(real)0.9; ! const real globalCFM=(real)1e-5; ! const real jointFudgeFactor=(real)0.1; const real maxFriction=(real)1000.0; const real maxCorrectingVel=(real)40.0; |
|
From: tylerstreeter <tyl...@us...> - 2005-03-13 23:08:13
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24830/src Modified Files: Blueprint.cpp BlueprintManager.cpp BlueprintManager.h RaycastSensor.cpp RaycastSensorData.h SensorData.h Simulator.cpp Simulator.h VolumeSensor.cpp VolumeSensorData.h Log Message: added xml parsing for raycast and volume sensors Index: Blueprint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Blueprint.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Blueprint.cpp 28 Feb 2005 03:27:54 -0000 1.17 --- Blueprint.cpp 13 Mar 2005 23:07:09 -0000 1.18 *************** *** 36,39 **** --- 36,41 ---- #include "ThrusterMotorData.h" #include "SensorData.h" + #include "RaycastSensorData.h" + #include "VolumeSensorData.h" namespace opal *************** *** 210,214 **** } ! // TODO: once we have Sensors, loop over them here. mFinalized = true; --- 212,230 ---- } ! // Setup Sensor reference indices. ! for (i=0; i<mSensorList.size(); ++i) ! { ! SensorData* data = mSensorList.at(i); ! ! // At this time we have no Sensors with special references ! // besides the standard Solid reference present in every ! // Sensor. Thus we can just treat them all the same. ! ! // Find the index of the Solid reference. If the value of ! // the index is -1, the Sensor must not be attached to any ! // Solid. ! int solidIndex = getSolidIndex(data->internal_solidName); ! data->internal_solidIndex = solidIndex; ! } mFinalized = true; *************** *** 327,345 **** else { ! // TODO: implement this when we have some Sensors available. ! //SensorData* newData = NULL; ! //// Allocate the right type of Sensor. ! //switch(data->getType()) ! //{ ! // case VELOCITY_SENSOR: ! // newData = ! // new VelocitySensorData(*((VelocitySensorData*)data)); ! // break; ! // default: ! // assert(false); ! //} ! //mSensorList.push_back(newData); } } --- 343,380 ---- else { ! SensorData* newData = NULL; ! // Allocate the right type of Sensor. ! switch(data->getType()) ! { ! //case ACCELERATION_SENSOR: ! //{ ! // newData = ! // new AccelerationSensorData( ! // *((AccelerationSensorData*)data)); ! // break; ! //} ! case RAYCAST_SENSOR: ! { ! newData = ! new RaycastSensorData(*((RaycastSensorData*)data)); ! break; ! } ! //case VELOCITY_SENSOR: ! //{ ! // newData = ! // new VelocitySensorData(*((VelocitySensorData*)data)); ! //} ! case VOLUME_SENSOR: ! { ! newData = ! new VolumeSensorData(*((VolumeSensorData*)data)); ! break; ! } ! default: ! assert(false); ! } ! mSensorList.push_back(newData); } } Index: RaycastSensor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/RaycastSensor.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RaycastSensor.cpp 12 Mar 2005 01:21:16 -0000 1.4 --- RaycastSensor.cpp 13 Mar 2005 23:07:10 -0000 1.5 *************** *** 60,64 **** { // TODO: if mData.solid is valid, update this Sensor's ray ! // relative to the Solid // TODO: if this is attached to a Solid, keep the ray from --- 60,65 ---- { // TODO: if mData.solid is valid, update this Sensor's ray ! // relative to the Solid; otherwise, update it relative to ! // global origin. // TODO: if this is attached to a Solid, keep the ray from Index: SensorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SensorData.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SensorData.h 12 Mar 2005 01:21:16 -0000 1.6 --- SensorData.h 13 Mar 2005 23:07:10 -0000 1.7 *************** *** 54,57 **** --- 54,59 ---- name = ""; solid = NULL; + internal_solidIndex = 0; + internal_solidName = ""; // "transform" is initialized in its own constructor. } *************** *** 75,81 **** /// 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 --- 77,89 ---- /// 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 just positioned somewhere within the environment). Solid* solid; + /// Internal data used for Blueprint instantiation. + int internal_solidIndex; + + /// Internal data used for Blueprint instantiation. + std::string internal_solidName; + /// If the Sensor is attached to a Solid, this matrix is the global /// offset from that Solid's transform. Otherwise, it is just the Index: VolumeSensor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/VolumeSensor.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VolumeSensor.cpp 12 Mar 2005 01:21:17 -0000 1.1 --- VolumeSensor.cpp 13 Mar 2005 23:07:11 -0000 1.2 *************** *** 55,59 **** { // TODO: if mData.solid is valid, update this Sensor's transform ! // relative to the Solid // TODO: if this is attached to a Solid, don't add the volume Solid --- 55,60 ---- { // TODO: if mData.solid is valid, update this Sensor's transform ! // relative to the Solid; otherwise, update it relative to ! // global origin. // TODO: if this is attached to a Solid, don't add the volume Solid Index: BlueprintManager.h =================================================================== RCS file: /cvsroot/opal/opal/src/BlueprintManager.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** BlueprintManager.h 26 Feb 2005 10:22:23 -0000 1.17 --- BlueprintManager.h 13 Mar 2005 23:07:10 -0000 1.18 *************** *** 42,45 **** --- 42,47 ---- class SpringMotorData; class ThrusterMotorData; + class RaycastSensorData; + class VolumeSensorData; namespace blueprint_manager *************** *** 56,66 **** /// will be ignored). The Blueprint can contain any number /// of Solids, Joints, Motors, and Sensors. Most of the ! /// object parameters are optional, in which case the usual, /// default values will be used. The only required /// parameters are object types and references to other objects ! /// (i.e. the "References" elements in an XML file. For example, ! /// a Joint refers to two Solids; if either of those Solids ! /// are not in the file, the Joint will be ignored. For a ! /// particular element, all attributes are always required. /// All object names, if used, must be unique. virtual void OPAL_CALL loadFile(Blueprint& bp, --- 58,71 ---- /// will be ignored). The Blueprint can contain any number /// of Solids, Joints, Motors, and Sensors. Most of the ! /// object parameters are optional, in which case the usual /// default values will be used. The only required /// parameters are object types and references to other objects ! /// (i.e. the "References" elements in an XML file). For ! /// example, a Joint refers to two Solids; if either of those ! /// Solids are not in the file, the Joint will be ignored. The ! /// exception is Sensors' references to Solids; these aren't ! /// required because Sensors don't have to be attached to a ! /// Solid. For a particular element that does exist in the ! /// XML file, all attributes are always required. /// All object names, if used, must be unique. virtual void OPAL_CALL loadFile(Blueprint& bp, *************** *** 126,129 **** --- 131,146 ---- const Blueprint& bp, const std::string& filename); + /// Helper function for parsing RaycastSensor XML elements. + /// Allocates and returns a pointer to a new RaycastSensorData + /// object. Returns NULL if the element could not be loaded. + RaycastSensorData* loadRaycastSensor(const TiXmlNode* nodePtr, + const Blueprint& bp, const std::string& filename); + + /// Helper function for parsing VolumeSensor XML elements. + /// Allocates and returns a pointer to a new VolumeSensorData + /// object. Returns NULL if the element could not be loaded. + VolumeSensorData* loadVolumeSensor(const TiXmlNode* nodePtr, + const Blueprint& bp, const std::string& filename); + /// Helper function for parsing Shape XML elements. Allocates /// and returns a pointer to a new ShapeData object. Returns Index: RaycastSensorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/RaycastSensorData.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RaycastSensorData.h 11 Mar 2005 05:31:56 -0000 1.2 --- RaycastSensorData.h 13 Mar 2005 23:07:10 -0000 1.3 *************** *** 63,66 **** --- 63,68 ---- name = data.name; solid = data.solid; + internal_solidIndex = data.internal_solidIndex; + internal_solidName = data.internal_solidName; transform = data.transform; ray = data.ray; Index: BlueprintManager.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/BlueprintManager.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** BlueprintManager.cpp 8 Mar 2005 22:05:02 -0000 1.31 --- BlueprintManager.cpp 13 Mar 2005 23:07:09 -0000 1.32 *************** *** 38,41 **** --- 38,43 ---- #include "SpringMotorData.h" #include "SensorData.h" + #include "RaycastSensorData.h" + #include "VolumeSensorData.h" #ifdef OPAL_USE_XML *************** *** 1199,1216 **** } ! // TODO: implement this once we have some Sensors. ! //// Load data for the specific type of Sensor. ! //if ("velocity" == type) //{ ! // data = loadVelocitySensor(nodePtr, bp, filename); //} ! //else //{ ! // OPAL_LOGGER("warning") << ! // "opal::BlueprintManager::loadSensor: Invalid Sensor \ ! // type " << type << " in " << filename ! // << ". Ignoring the Sensor." << std::endl; ! // return NULL; //} // Load Name element if it exists. --- 1201,1230 ---- } ! // Load data for the specific type of Sensor. ! //if ("acceleration" == type) //{ ! // data = loadAccelerationSensor(nodePtr, bp, filename); //} ! //else if ("raycast" == type) ! if ("raycast" == type) ! { ! data = loadRaycastSensor(nodePtr, bp, filename); ! } ! //else if ("velocity" == type) //{ ! // data = loadVelocitySensor(nodePtr, bp, filename); //} + else if ("volume" == type) + { + data = loadVolumeSensor(nodePtr, bp, filename); + } + else + { + OPAL_LOGGER("warning") << + "opal::BlueprintManager::loadSensor: Invalid Sensor \ + type " << type << " in " << filename + << ". Ignoring the Sensor." << std::endl; + return NULL; + } // Load Name element if it exists. *************** *** 1244,1247 **** --- 1258,1330 ---- } } + + // Load Offset element if it exists. + TiXmlNode* offsetNodePtr = + const_cast<TiXmlNode*>(nodePtr)->FirstChild("Offset"); + if (NULL != offsetNodePtr) + { + loadOffset(data->transform, offsetNodePtr, filename); + } + + // Load References element. If it doesn't exist, just assume + // that this Sensor will not be attached to a Solid. + paramNodePtr = + const_cast<TiXmlNode*>(nodePtr)->FirstChild("References"); + if (NULL != paramNodePtr) + { + // Get the Solids' names. + data->internal_solidName = getAttributeString(paramNodePtr, + "solid"); + } + else + { + data->internal_solidName = ""; + } + #endif + return data; + } + + RaycastSensorData* BlueprintManager::loadRaycastSensor( + const TiXmlNode* nodePtr, const Blueprint& bp, + const std::string& filename) + { + // This data structure automatically gets initialized to + // default values in its constructor. + RaycastSensorData* data = new RaycastSensorData(); + + #ifdef OPAL_USE_XML + + TiXmlNode* paramNodePtr = NULL; + + // Load Ray element if it exists. + paramNodePtr = + const_cast<TiXmlNode*>(nodePtr)->FirstChild("Ray"); + if (NULL != paramNodePtr) + { + Point3r origin; + Vec3r dir; + origin[0] = getAttributeReal(paramNodePtr, "originx"); + origin[1] = getAttributeReal(paramNodePtr, "originy"); + origin[2] = getAttributeReal(paramNodePtr, "originz"); + dir[0] = getAttributeReal(paramNodePtr, "dirx"); + dir[1] = getAttributeReal(paramNodePtr, "diry"); + dir[2] = getAttributeReal(paramNodePtr, "dirz"); + data->ray.setOrigin(origin); + data->ray.setDir(dir); + } + #endif + return data; + } + + VolumeSensorData* BlueprintManager::loadVolumeSensor( + const TiXmlNode* nodePtr, const Blueprint& bp, + const std::string& filename) + { + // This data structure automatically gets initialized to + // default values in its constructor. + VolumeSensorData* data = new VolumeSensorData(); + + #ifdef OPAL_USE_XML + // Nothing special to load for VolumeSensors. #endif return data; Index: VolumeSensorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/VolumeSensorData.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VolumeSensorData.h 12 Mar 2005 01:21:17 -0000 1.1 --- VolumeSensorData.h 13 Mar 2005 23:07:11 -0000 1.2 *************** *** 62,65 **** --- 62,67 ---- name = data.name; solid = data.solid; + internal_solidIndex = data.internal_solidIndex; + internal_solidName = data.internal_solidName; transform = data.transform; } Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Simulator.cpp 12 Mar 2005 01:21:16 -0000 1.45 --- Simulator.cpp 13 Mar 2005 23:07:10 -0000 1.46 *************** *** 234,237 **** --- 234,238 ---- void Simulator::setStepSize(real stepSize) { + assert(stepSize > 0); mStepSize = stepSize; } *************** *** 288,291 **** --- 289,295 ---- { Solid* s = createSolid(); + + // Make a local copy of the Solid's data, including all of its + // Shapes. SolidData sd = *bp.getSolidData(i); *************** *** 379,389 **** for (i=0; i<bp.getNumJoints(); ++i) { - // Setup the Solid reference pointers. - JointData* data = bp.getJointData(i); - data->solid0 = solidList.at(data->internal_solid0Index); - data->solid1 = solidList.at(data->internal_solid1Index); - Joint* j = createJoint(); ! JointData jd = *data; if (useOffset) --- 383,394 ---- for (i=0; i<bp.getNumJoints(); ++i) { Joint* j = createJoint(); ! ! // Create a local copy of the Joint's data. ! JointData jd = *bp.getJointData(i); ! ! // Setup the Solid reference pointers. ! jd.solid0 = solidList.at(jd.internal_solid0Index); ! jd.solid1 = solidList.at(jd.internal_solid1Index); if (useOffset) *************** *** 413,480 **** { Motor* m = NULL; ! //MotorData* data = bp.getMotorData(i); switch(bp.getMotorData(i)->getType()) { - case ATTRACTOR_MOTOR: { ! AttractorMotorData* data = ! (AttractorMotorData*)(bp.getMotorData(i)); // Setup the Solid reference pointers. ! data->solid0 = solidList.at(data->internal_solid0Index); ! data->solid1 = solidList.at(data->internal_solid1Index); m = createAttractorMotor(); ! ((AttractorMotor*)m)->init(*data); break; } case GEARED_MOTOR: { ! GearedMotorData* data = ! (GearedMotorData*)(bp.getMotorData(i)); // Setup the Joint reference pointer. ! data->joint = jointList.at(data->internal_jointIndex); m = createGearedMotor(); ! ((GearedMotor*)m)->init(*data); break; } case SERVO_MOTOR: { ! ServoMotorData* data = ! (ServoMotorData*)(bp.getMotorData(i)); // Setup the Joint reference pointer. ! data->joint = jointList.at(data->internal_jointIndex); m = createServoMotor(); ! ((ServoMotor*)m)->init(*data); break; } case SPRING_MOTOR: { ! SpringMotorData* data = ! (SpringMotorData*)(bp.getMotorData(i)); // Setup the Solid reference pointer. ! data->solid = solidList.at(data->internal_solidIndex); m = createSpringMotor(); ! ((SpringMotor*)m)->init(*data); break; } case THRUSTER_MOTOR: { ! ThrusterMotorData* data = ! (ThrusterMotorData*)(bp.getMotorData(i)); // Setup the Solid reference pointer. ! data->solid = solidList.at(data->internal_solidIndex); m = createThrusterMotor(); ! ((ThrusterMotor*)m)->init(*data); break; } --- 418,485 ---- { Motor* m = NULL; ! MotorData* motorData = bp.getMotorData(i); + // Allocate and setup the right type of Motor. switch(bp.getMotorData(i)->getType()) { case ATTRACTOR_MOTOR: { ! // Make a local copy of the Motor's data. ! AttractorMotorData data = *(AttractorMotorData*)motorData; // Setup the Solid reference pointers. ! data.solid0 = solidList.at(data.internal_solid0Index); ! data.solid1 = solidList.at(data.internal_solid1Index); m = createAttractorMotor(); ! ((AttractorMotor*)m)->init(data); break; } case GEARED_MOTOR: { ! // Make a local copy of the Motor's data. ! GearedMotorData data = *(GearedMotorData*)motorData; // Setup the Joint reference pointer. ! data.joint = jointList.at(data.internal_jointIndex); m = createGearedMotor(); ! ((GearedMotor*)m)->init(data); break; } case SERVO_MOTOR: { ! // Make a local copy of the Motor's data. ! ServoMotorData data = *(ServoMotorData*)motorData; // Setup the Joint reference pointer. ! data.joint = jointList.at(data.internal_jointIndex); m = createServoMotor(); ! ((ServoMotor*)m)->init(data); break; } case SPRING_MOTOR: { ! // Make a local copy of the Motor's data. ! SpringMotorData data = *(SpringMotorData*)motorData; // Setup the Solid reference pointer. ! data.solid = solidList.at(data.internal_solidIndex); m = createSpringMotor(); ! ((SpringMotor*)m)->init(data); break; } case THRUSTER_MOTOR: { ! // Make a local copy of the Motor's data. ! ThrusterMotorData data = *(ThrusterMotorData*)motorData; // Setup the Solid reference pointer. ! data.solid = solidList.at(data.internal_solidIndex); m = createThrusterMotor(); ! ((ThrusterMotor*)m)->init(data); break; } *************** *** 487,511 **** } ! // TODO: implement this when we have Sensors. ! //// Create all Sensors in the Blueprint. ! // This is outdated... ! //for (int i=0; i<bp.getNumSensors(); ++i) ! //{ ! // Sensor* s = NULL; ! // SensorData* data = bp.getSensorData(i); ! // switch(bp.getMotorData(i).getType()) ! // { ! // case VELOCITY_SENSOR: ! // m = createVelocitySensor(); ! // ((VelocitySensor*)m)->init(*((VelocitySensorData*)data)); ! // break; ! // default: ! // assert(false); ! // } ! // // Add the Sensor to the BlueprintInstance. ! // instance.internal_addSensor(s); ! //} solidList.clear(); --- 492,587 ---- } ! // Create all Sensors in the Blueprint. ! for (i=0; i<bp.getNumSensors(); ++i) ! { ! Sensor* s = NULL; ! SensorData* sensorData = bp.getSensorData(i); ! // These are necessary because we don't want to change teh ! // Blueprint's Sensor data directly; we need a local copy. ! Solid* solidPtr = NULL; ! Matrix44r transform = sensorData->transform; ! // Setup the Solid reference pointer. ! if (-1 == sensorData->internal_solidIndex) ! { ! // This Sensor must not be attached to any Solid. ! solidPtr = NULL; ! } ! else ! { ! // This Sensor is attached to a Solid. ! solidPtr = solidList.at(sensorData->internal_solidIndex); ! } ! ! if (useOffset) ! { ! // Offset the Sensor's transform. ! transform = offset * transform; ! } ! ! if (useScale) ! { ! // Scale the Solid's transform. ! transform[12] *= scale; ! transform[13] *= scale; ! transform[14] *= scale; ! } ! ! // Allocate the right type of Sensor. ! switch(sensorData->getType()) ! { ! //case ACCELERATION_SENSOR: ! //{ ! // // Make a local copy of the Sensor's data. ! // AccelerationSensorData data = ! // *(AccelerationSensorData*)sensorData; ! // data.solid = solidPtr; ! // data.transform = transform; ! ! // s = createAccelerationSensor(); ! // ((AccelerationSensor*)s)->init(data); ! // break; ! //} ! case RAYCAST_SENSOR: ! { ! // Make a local copy of the Sensor's data. ! RaycastSensorData data = *(RaycastSensorData*)sensorData; ! data.solid = solidPtr; ! data.transform = transform; ! ! s = createRaycastSensor(); ! ((RaycastSensor*)s)->init(data); ! break; ! } ! //case VELOCITY_SENSOR: ! //{ ! // // Make a local copy of the Sensor's data. ! // VelocitySensorData data = *(VelocitySensorData*)sensorData; ! // data.solid = solidPtr; ! // data.transform = transform; ! ! // s = createVelocitySensor(); ! // ((VelocitySensor*)s)->init(data); ! // break; ! //} ! case VOLUME_SENSOR: ! { ! // Make a local copy of the Sensor's data. ! VolumeSensorData data = *(VolumeSensorData*)sensorData; ! data.solid = solidPtr; ! data.transform = transform; ! ! s = createVolumeSensor(); ! ((VolumeSensor*)s)->init(data); ! break; ! } ! default: ! assert(false); ! } ! ! // Add the Sensor to the BlueprintInstance. ! instance.internal_addSensor(s); ! } solidList.clear(); *************** *** 734,737 **** --- 810,820 ---- } + VolumeSensor* Simulator::createVolumeSensor() + { + VolumeSensor* newSensor = new VolumeSensor(this); + addSensor(newSensor); + return newSensor; + } + void Simulator::destroySensor(Sensor* s) { Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** Simulator.h 12 Mar 2005 01:21:17 -0000 1.85 --- Simulator.h 13 Mar 2005 23:07:11 -0000 1.86 *************** *** 45,48 **** --- 45,49 ---- class ThrusterMotor; class RaycastSensor; + class VolumeSensor; class BlueprintInstance; struct RaycastResult; *************** *** 70,74 **** virtual bool OPAL_CALL simulate(real dt); ! /// Sets the constant step size used in the simulation. virtual void OPAL_CALL setStepSize(real stepSize); --- 71,76 ---- virtual bool OPAL_CALL simulate(real dt); ! /// Sets the constant step size used in the simulation. The step ! /// size must be greater than zero. virtual void OPAL_CALL setStepSize(real stepSize); *************** *** 201,204 **** --- 203,209 ---- virtual RaycastSensor* OPAL_CALL createRaycastSensor(); + /// Creates and returns a pointer to a VolumeSensor. + virtual VolumeSensor* OPAL_CALL createVolumeSensor(); + /// Immediately destroys the given Sensor. virtual void OPAL_CALL destroySensor(Sensor* s); |
|
From: tylerstreeter <tyl...@us...> - 2005-03-13 23:08:03
|
Update of /cvsroot/opal/opal/samples/simple_objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24830/samples/simple_objects Modified Files: main.cpp ragdoll.xml Log Message: added xml parsing for raycast and volume sensors Index: main.cpp =================================================================== RCS file: /cvsroot/opal/opal/samples/simple_objects/main.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** main.cpp 8 Mar 2005 16:10:21 -0000 1.24 --- main.cpp 13 Mar 2005 23:06:54 -0000 1.25 *************** *** 128,134 **** void makeRagdoll() { // Instantiate the Blueprint. opal::BlueprintInstance instance; ! gSimulator->instantiateBlueprint(instance, gRagdollBP); int i=0; --- 128,137 ---- void makeRagdoll() { + opal::Matrix44r offset; + offset.translate(0, 10, 0); + // Instantiate the Blueprint. opal::BlueprintInstance instance; ! gSimulator->instantiateBlueprint(instance, gRagdollBP, offset); int i=0; Index: ragdoll.xml =================================================================== RCS file: /cvsroot/opal/opal/samples/simple_objects/ragdoll.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ragdoll.xml 1 Mar 2005 05:04:20 -0000 1.1 --- ragdoll.xml 13 Mar 2005 23:07:09 -0000 1.2 *************** *** 37,40 **** --- 37,42 ---- <Name value="left shoulder"/> <Type value="universal"/> + <BreakMode value="threshold"/> + <BreakThresh value="0.5"/> <References solid0="upper left arm" solid1="upper torso"/> <Anchor x="0.16" y="0.9" z="0.0"/> *************** *** 112,115 **** --- 114,119 ---- <Name value="right shoulder"/> <Type value="universal"/> + <BreakMode value="threshold"/> + <BreakThresh value="0.5"/> <References solid0="upper right arm" solid1="upper torso"/> <Anchor x="-0.16" y="0.9" z="0.0"/> *************** *** 239,242 **** --- 243,248 ---- <Name value="left hip"/> <Type value="universal"/> + <BreakMode value="threshold"/> + <BreakThresh value="0.5"/> <References solid0="upper left leg" solid1="pelvis"/> <Anchor x="0.08" y="0.58" z="0.0"/> *************** *** 269,272 **** --- 275,280 ---- <Name value="right hip"/> <Type value="universal"/> + <BreakMode value="threshold"/> + <BreakThresh value="0.5"/> <References solid0="upper right leg" solid1="pelvis"/> <Anchor x="-0.08" y="0.58" z="0.0"/> |
|
From: tylerstreeter <tyl...@us...> - 2005-03-13 23:07:31
|
Update of /cvsroot/opal/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24830 Modified Files: todo.txt Log Message: added xml parsing for raycast and volume sensors Index: todo.txt =================================================================== RCS file: /cvsroot/opal/opal/todo.txt,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** todo.txt 12 Mar 2005 01:21:07 -0000 1.53 --- todo.txt 13 Mar 2005 23:07:12 -0000 1.54 *************** *** 10,13 **** --- 10,14 ---- - add to instantiateBlueprint - add to Blueprint finalize function + - add to Blueprint addSensor function * make trimeshes work |
|
From: tylerstreeter <tyl...@us...> - 2005-03-12 01:22:44
|
Update of /cvsroot/opal/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17528 Modified Files: documentation.html Log Message: minor changes Index: documentation.html =================================================================== RCS file: /cvsroot/opal/web/documentation.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** documentation.html 8 Mar 2005 22:37:37 -0000 1.8 --- documentation.html 12 Mar 2005 01:22:24 -0000 1.9 *************** *** 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> --- 25,39 ---- <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> ! <o:Revision>98</o:Revision> <o:TotalTime>107</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> ! <o:LastSaved>2005-03-08T22:48:00Z</o:LastSaved> <o:Pages>1</o:Pages> ! <o:Words>323</o:Words> ! <o:Characters>1844</o:Characters> <o:Company>none</o:Company> <o:Lines>15</o:Lines> <o:Paragraphs>4</o:Paragraphs> ! <o:CharactersWithSpaces>2163</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="54274"> <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="55298"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> *************** *** 177,186 **** color:black'>Documentation<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'>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"; --- 177,187 ---- color:black'>Documentation<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'>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"; *************** *** 216,220 **** <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"; --- 217,222 ---- <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, Collision ! Groups, and Trigger Volumes<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"; *************** *** 224,229 **** <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 ! every object type and parameter.<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"; --- 226,231 ---- <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 every ! object type and parameter.<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"; *************** *** 235,240 **** color:black'><a href="api/index.html">API Documentation</a></span><span 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: --- 237,242 ---- color:black'><a href="api/index.html">API Documentation</a></span><span 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: |
|
From: tylerstreeter <tyl...@us...> - 2005-03-12 01:21:52
|
Update of /cvsroot/opal/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17179 Modified Files: changelog.txt todo.txt Log Message: added VolumeSensor Index: changelog.txt =================================================================== RCS file: /cvsroot/opal/opal/changelog.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** changelog.txt 26 Feb 2005 10:22:22 -0000 1.10 --- changelog.txt 12 Mar 2005 01:21:07 -0000 1.11 *************** *** 2,8 **** , 2005 ------------------------------------------ ! * Overhauled XML loading system ! * New additional object creation system: all objects can be created from/saved to a data structure ! * Separate Joint types were combined into a single Joint class * Numerous API changes * Various bug fixes --- 2,11 ---- , 2005 ------------------------------------------ ! * New additional object creation system: all objects can be created from/saved to a data object ! * EventHandler was changed to a base class for CollisionEventHandler and JointBreakEventHandler ! * Collision events now get queued up during collision detection and handled at the end of each time step ! * Added RaycastSensor, VolumeSensor ! * Overhauled XML loading system; now all Solid, Shape, Joint, Motor, and Sensor data can be loaded from OPAL XML files ! * Joints have a parameter to allow contacts between connected Solids or not * Numerous API changes * Various bug fixes Index: todo.txt =================================================================== RCS file: /cvsroot/opal/opal/todo.txt,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** todo.txt 9 Mar 2005 02:09:51 -0000 1.52 --- todo.txt 12 Mar 2005 01:21:07 -0000 1.53 *************** *** 2,5 **** --- 2,8 ---- ================= + * additional sensors + - vel, accel, incline/orientation; relate these to vestibular senses? + * sensors - parse from xml *************** *** 8,14 **** - add to Blueprint finalize function - * fix memory allocation across dll boundary - - volume collision check results -> put results in a specific class - * make trimeshes work --- 11,14 ---- *************** *** 41,60 **** - contact filtering? - * event handling/callbacks - - collisions - - broken joints - - beginning of step - * 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? * separate Joint back into separate subclasses? ! * 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? --- 41,54 ---- - contact filtering? * 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 objects with multiple modes of operation (e.g. spring motor, accel sensor) take bit flags? ! - or just separate objects with different modes into separate types? * separate Joint back into separate subclasses? ! * get rid of custom motors? - for one thing, we can't use them in xml - if we use them, should we also have custom sensors? *************** *** 71,77 **** ============== - * joint flags - - allow collisions between joined solids - * GearedMotor - talk to Jim Bernard --- 65,68 ---- |
|
From: tylerstreeter <tyl...@us...> - 2005-03-12 01:21:30
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17179/src Modified Files: RaycastSensor.cpp RaycastSensor.h SConscript SensorData.h Simulator.cpp Simulator.h opal.h Added Files: VolumeSensor.cpp VolumeSensor.h VolumeSensorData.h Log Message: added VolumeSensor Index: opal.h =================================================================== RCS file: /cvsroot/opal/opal/src/opal.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** opal.h 9 Mar 2005 02:09:50 -0000 1.21 --- opal.h 12 Mar 2005 01:21:17 -0000 1.22 *************** *** 56,59 **** --- 56,61 ---- #include "RaycastSensor.h" #include "RaycastSensorData.h" + #include "VolumeSensor.h" + #include "VolumeSensorData.h" #include "EventHandler.h" #include "JointBreakEventHandler.h" Index: RaycastSensor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/RaycastSensor.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RaycastSensor.cpp 11 Mar 2005 05:31:56 -0000 1.3 --- RaycastSensor.cpp 12 Mar 2005 01:21:16 -0000 1.4 *************** *** 43,47 **** void RaycastSensor::init(const RaycastSensorData& data) { - assert(data.solid); Sensor::init(); mData = data; --- 43,46 ---- *************** *** 55,63 **** const RaycastResult& RaycastSensor::fireRay() { ! return mSim->internal_fireRay(mData.ray, mData.ray.getLength()); } const RaycastResult& RaycastSensor::fireRay(real length) { return mSim->internal_fireRay(mData.ray, length); } --- 54,68 ---- const RaycastResult& RaycastSensor::fireRay() { ! return fireRay(mData.ray.getLength()); } const RaycastResult& RaycastSensor::fireRay(real length) { + // TODO: if mData.solid is valid, update this Sensor's ray + // relative to the Solid + + // TODO: if this is attached to a Solid, keep the ray from + // colliding with that Solid. + return mSim->internal_fireRay(mData.ray, length); } *************** *** 117,122 **** if (mData.enabled) { ! // TODO: if mData.solid is valid, update this Sensor's ray ! // relative to the Solid } } --- 122,126 ---- if (mData.enabled) { ! // Do nothing. } } Index: SensorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SensorData.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SensorData.h 11 Mar 2005 05:31:56 -0000 1.5 --- SensorData.h 12 Mar 2005 01:21:16 -0000 1.6 *************** *** 36,42 **** enum SensorType { ! VELOCITY_SENSOR, ! ACCELERATION_SENSOR, ! RAYCAST_SENSOR }; --- 36,43 ---- enum SensorType { ! ACCELERATION_SENSOR, ! RAYCAST_SENSOR, ! VELOCITY_SENSOR, ! VOLUME_SENSOR }; *************** *** 49,53 **** // The initial type doesn't matter since the abstract base // class will never be instantiated. ! mType = VELOCITY_SENSOR; enabled = defaults::sensor::enabled; name = ""; --- 50,54 ---- // The initial type doesn't matter since the abstract base // class will never be instantiated. ! mType = ACCELERATION_SENSOR; enabled = defaults::sensor::enabled; name = ""; --- NEW FILE: VolumeSensor.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 "VolumeSensor.h" #include "Simulator.h" namespace opal { VolumeSensor::VolumeSensor(Simulator* s) { // "mData" is initialized in its own constructor. mSim = s; } VolumeSensor::~VolumeSensor() { } void VolumeSensor::init(const VolumeSensorData& data) { Sensor::init(); mData = data; } const VolumeSensorData& VolumeSensor::getData()const { return mData; } const VolumeQueryResult& VolumeSensor::queryVolume(const Solid* volume) { // TODO: if mData.solid is valid, update this Sensor's transform // relative to the Solid // TODO: if this is attached to a Solid, don't add the volume Solid // to the results. return mSim->internal_queryVolume(volume); } void VolumeSensor::setEnabled(bool e) { if (!mInitCalled) { return; } mData.enabled = e; } bool VolumeSensor::isEnabled()const { return mData.enabled; } SensorType VolumeSensor::getType()const { return mData.getType(); } void VolumeSensor::setTransform(const Matrix44r& t) { mData.transform = t; } const Matrix44r& VolumeSensor::getTransform()const { return mData.transform; } void VolumeSensor::setName(const std::string& name) { mData.name = name; } const std::string& VolumeSensor::getName()const { return mData.name; } void VolumeSensor::internal_update() { if (mData.enabled) { // Do nothing. } } bool VolumeSensor::internal_dependsOn(Solid* solid) { if (solid == mData.solid) { return true; } else { return false; } } } Index: RaycastSensor.h =================================================================== RCS file: /cvsroot/opal/opal/src/RaycastSensor.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RaycastSensor.h 11 Mar 2005 05:31:56 -0000 1.3 --- RaycastSensor.h 12 Mar 2005 01:21:16 -0000 1.4 *************** *** 41,45 **** struct RaycastResult { ! RaycastResult() { solid = NULL; --- 41,45 ---- struct RaycastResult { ! OPAL_DECL RaycastResult() { solid = NULL; *************** *** 49,52 **** --- 49,72 ---- } + /// Copy constructor. + OPAL_DECL RaycastResult(const RaycastResult& result) + { + (*this) = result; + } + + OPAL_DECL ~RaycastResult() + { + } + + /// Makes a deep copy. + OPAL_DECL void OPAL_CALL operator=( + const RaycastResult& result) + { + solid = result.solid; + intersection = result.intersection; + normal = result.normal; + distance = result.distance; + } + /// The first Solid hit by the ray. This will remain NULL if no /// Solid is hit. *************** *** 75,80 **** 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); --- 95,102 ---- virtual ~RaycastSensor(); ! /// Initializes the Sensor with the given data structure. If the ! /// Solid pointer in the data is valid, the Sensor's offset will ! /// be relative to the Solid's transform instead of the global ! /// origin. virtual void OPAL_CALL init(const RaycastSensorData& data); *************** *** 83,92 **** /// Fires a ray into the Sensor's environment, returning ! /// information about the first intersection encountered. virtual const RaycastResult& OPAL_CALL fireRay(); /// Fires a ray of a given length into the Sensor's environment ! /// information about the first intersection encountered. ! virtual const RaycastResult& OPAL_CALL fireRay( real length ); virtual void OPAL_CALL setEnabled(bool e); --- 105,117 ---- /// Fires a ray into the Sensor's environment, returning ! /// information about the first intersection encountered. The ! /// length of the ray used will be the length of the Sensor's ! /// ray data. virtual const RaycastResult& OPAL_CALL fireRay(); /// Fires a ray of a given length into the Sensor's environment ! /// information about the first intersection encountered. The ! /// length of the ray used will be the given length parameter. ! virtual const RaycastResult& OPAL_CALL fireRay(real length); virtual void OPAL_CALL setEnabled(bool e); --- NEW FILE: VolumeSensor.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_VOLUME_SENSOR_H #define OPAL_VOLUME_SENSOR_H #include "Defines.h" #include "Sensor.h" #include "VolumeSensorData.h" namespace opal { class Simulator; /// A data structure containing information about a specific /// volume query. struct VolumeQueryResult { OPAL_DECL VolumeQueryResult() { } /// Copy constructor. OPAL_DECL VolumeQueryResult(const VolumeQueryResult& result) { (*this) = result; } OPAL_DECL ~VolumeQueryResult() { internal_clearSolids(); } /// Makes a deep copy. OPAL_DECL void OPAL_CALL operator=( const VolumeQueryResult& result) { unsigned int i=0; for (i=0; i<result.mSolidList.size(); ++i) { mSolidList.push_back(result.mSolidList[i]); } } /// Adds a Solid pointer to the list of results. OPAL_DECL void OPAL_CALL internal_addSolid(Solid* s) { assert(s); mSolidList.push_back(s); } /// Returns the number of Solids in the results. OPAL_DECL int OPAL_CALL getNumSolids()const { return (int)(mSolidList.size()); } // This is probably not needed... //Solid* getSolid(unsigned int i)const //{ // return mSolidList.at(i); //} /// Removes all Solids from the results. OPAL_DECL void OPAL_CALL internal_clearSolids() { mSolidList.clear(); } /// Removes a specified Solid from the list of collided Solids. OPAL_DECL void OPAL_CALL internal_removeSolid(const Solid* s) { for(size_t i = 0; i<mSolidList.size(); ++i) { if(mSolidList[i] == s) { mSolidList[i] = mSolidList.back(); mSolidList.pop_back(); return; } } } private: /// A list of Solids that were found in a volume query. std::vector<Solid*> mSolidList; }; /// A Sensor that queries a scene to find which Solids are intersecting /// a specified volume. Each volume query returns a data structure /// containing a list of those Solids. This Sensor does not do a volume /// query on every time step because that would be a waste of time in /// most cases; it must be queried manually. class VolumeSensor : public Sensor { public: VolumeSensor(Simulator* s); virtual ~VolumeSensor(); /// Initializes the Sensor with the given data structure. virtual void OPAL_CALL init(const VolumeSensorData& data); /// Returns all data describing the Sensor. virtual const VolumeSensorData& OPAL_CALL getData()const; /// Queries the Sensor's environment with the given Solid's volume, /// returning a list of the Solids that collide with that Solid. virtual const VolumeQueryResult& OPAL_CALL queryVolume( const Solid* volume); virtual void OPAL_CALL setEnabled(bool e); virtual bool OPAL_CALL isEnabled()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. VolumeSensorData mData; /// Pointer to the Simulator containing this Sensor; used to fire /// rays into the Simulator. Simulator* mSim; private: }; } #endif Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** Simulator.cpp 9 Mar 2005 02:09:49 -0000 1.44 --- Simulator.cpp 12 Mar 2005 01:21:16 -0000 1.45 *************** *** 38,41 **** --- 38,42 ---- #include "SpringMotor.h" #include "RaycastSensor.h" + #include "VolumeSensor.h" namespace opal --- NEW FILE: VolumeSensorData.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_VOLUME_SENSOR_DATA_H #define OPAL_VOLUME_SENSOR_DATA_H #include "Defines.h" #include "SensorData.h" namespace opal { /// A data structure describing a VolumeSensor. class VolumeSensorData : public SensorData { public: OPAL_DECL VolumeSensorData() : SensorData() { mType = VOLUME_SENSOR; } /// Copy constructor. OPAL_DECL VolumeSensorData(const VolumeSensorData& data) { (*this) = data; } OPAL_DECL virtual ~VolumeSensorData() { } /// Makes a deep copy. OPAL_DECL virtual void OPAL_CALL operator=( const VolumeSensorData& data) { mType = data.mType; enabled = data.enabled; name = data.name; solid = data.solid; transform = data.transform; } protected: private: }; } #endif Index: SConscript =================================================================== RCS file: /cvsroot/opal/opal/src/SConscript,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** SConscript 9 Mar 2005 02:09:49 -0000 1.13 --- SConscript 12 Mar 2005 01:21:16 -0000 1.14 *************** *** 50,53 **** --- 50,55 ---- ThrusterMotorData.h Vec3r.h + VolumeSensor.h + VolumeSensorData.h """) *************** *** 71,74 **** --- 73,77 ---- SpringMotor.cpp ThrusterMotor.cpp + VolumeSensor.cpp """) Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Simulator.h 11 Mar 2005 05:31:56 -0000 1.84 --- Simulator.h 12 Mar 2005 01:21:17 -0000 1.85 *************** *** 47,50 **** --- 47,51 ---- class BlueprintInstance; struct RaycastResult; + struct VolumeQueryResult; /// A Simulator is an environment that contains simulated objects. *************** *** 81,92 **** const Matrix44r& offset=Matrix44r(), real scale=1); - /// A convenient volume collision check function. TODO: replace - /// with a Sensor. TODO: the vector pointer here is bad because - /// memory is allocated within the DLL and deallocated on the - /// user's side; make a VolumeCollisionReport object with an - /// add function - //virtual void OPAL_CALL collide(const Solid* solid, - // std::vector<Solid*>* solids) = 0; - /// Sets the gravity used in the simulation. virtual void OPAL_CALL setGravity(const Vec3r& gravity) = 0; --- 82,85 ---- *************** *** 230,233 **** --- 223,230 ---- const Rayr& r, real length) = 0; + /// Helper function used for volume queries. + virtual const VolumeQueryResult& OPAL_CALL internal_queryVolume( + const Solid* volume) = 0; + /// Returns the Simulator's contact group flags. virtual unsigned long int OPAL_CALL |
|
From: tylerstreeter <tyl...@us...> - 2005-03-12 01:21:29
|
Update of /cvsroot/opal/opal/vc7 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17179/vc7 Modified Files: opal-ode.vcproj Log Message: added VolumeSensor Index: opal-ode.vcproj =================================================================== RCS file: /cvsroot/opal/opal/vc7/opal-ode.vcproj,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** opal-ode.vcproj 9 Mar 2005 02:09:51 -0000 1.17 --- opal-ode.vcproj 12 Mar 2005 01:21:17 -0000 1.18 *************** *** 166,169 **** --- 166,172 ---- RelativePath="..\src\ThrusterMotor.cpp"> </File> + <File + RelativePath="..\src\VolumeSensor.cpp"> + </File> </Filter> <Filter *************** *** 287,290 **** --- 290,299 ---- RelativePath="..\src\ThrusterMotorData.h"> </File> + <File + RelativePath="..\src\VolumeSensor.h"> + </File> + <File + RelativePath="..\src\VolumeSensorData.h"> + </File> </Filter> <Filter |
|
From: tylerstreeter <tyl...@us...> - 2005-03-12 01:21:27
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17179/src/ODE Modified Files: ODESimulator.cpp ODESimulator.h Log Message: added VolumeSensor Index: ODESimulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.h,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** ODESimulator.h 11 Mar 2005 05:31:57 -0000 1.62 --- ODESimulator.h 12 Mar 2005 01:21:15 -0000 1.63 *************** *** 33,36 **** --- 33,37 ---- #include "../Simulator.h" #include "../RaycastSensor.h" + #include "../VolumeSensor.h" #include "ODESolid.h" #include "ODEJoint.h" *************** *** 73,83 **** // No ODE-specific Motor implementations at this time. // SPACES virtual Space* OPAL_CALL createSpace(); - //virtual void OPAL_CALL collide(const Solid* solid, - // std::vector<Solid*>* solids); - virtual void OPAL_CALL setGravity(const Vec3r& gravity); --- 74,85 ---- // No ODE-specific Motor implementations at this time. + // SENSORS + + // No ODE-specific Sensor implementations at this time. + // SPACES virtual Space* OPAL_CALL createSpace(); virtual void OPAL_CALL setGravity(const Vec3r& gravity); *************** *** 94,100 **** 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, real length); --- 96,99 ---- *************** *** 104,107 **** --- 103,112 ---- const Point3r& intersection, const Vec3r& normal, real distance); + /// Helper function for volume collision checking. + virtual void OPAL_CALL internal_addCollidedSolid(Solid* solid); + + virtual const VolumeQueryResult& OPAL_CALL internal_queryVolume( + const Solid* volume); + protected: *************** *** 123,127 **** /// Temporary list of Solids that collided in a volume collision /// check. ! std::vector<Solid*> mCollidedSolids; /// Used for ray casting. --- 128,132 ---- /// Temporary list of Solids that collided in a volume collision /// check. ! VolumeQueryResult mVolumeQueryResult; /// Used for ray casting. Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** ODESimulator.cpp 11 Mar 2005 05:31:57 -0000 1.89 --- ODESimulator.cpp 12 Mar 2005 01:21:08 -0000 1.90 *************** *** 28,32 **** #include "ODESimulator.h" #include "../ShapeData.h" - //#include <ode/config.h> namespace opal --- 28,31 ---- *************** *** 794,798 **** if (solidPtr->internal_getCollisionCount() != mCollisionCount) { ! mCollidedSolids.push_back(solid); solidPtr->internal_setCollisionCount(mCollisionCount); } --- 793,797 ---- if (solidPtr->internal_getCollisionCount() != mCollisionCount) { ! mVolumeQueryResult.internal_addSolid(solid); solidPtr->internal_setCollisionCount(mCollisionCount); } *************** *** 877,906 **** } ! //void ODESimulator::collide(const Solid* solid, std::vector<Solid*>* solids) ! //{ ! // mCollisionCount++; ! // mCollidedSolids.clear(); ! // const std::vector<GeomData*>* geomList = ! // ((ODESolid*)solid)->internal_getGeomDataList(); ! // ! // //check for collisions; this will fill up mCollidedSolids ! // std::vector<GeomData*>::const_iterator iter; ! // for (iter = geomList->begin(); iter != geomList->end(); ++iter) ! // { ! // dSpaceCollide2((*iter)->geomID, (dGeomID)mRootSpaceID, this, ! // &ode_hidden::internal_pickingCollisionCallback); ! // } ! // std::vector<Solid*>::iterator solidIter; ! // for (solidIter = mCollidedSolids.begin(); ! // solidIter != mCollidedSolids.end(); ++solidIter) ! // { ! // //we don't want the volume solid to be added ! // if (*solidIter != solid) ! // { ! // solids->push_back(*solidIter); ! // } ! // } ! //} void ODESimulator::setGravity(const Vec3r& gravity) --- 876,902 ---- } ! const VolumeQueryResult& ODESimulator::internal_queryVolume( ! const Solid* volume) ! { ! mCollisionCount++; ! mVolumeQueryResult.internal_clearSolids(); ! const std::vector<GeomData*>* geomList = ! ((ODESolid*)volume)->internal_getGeomDataList(); ! // Check for collisions with each of the volume Solid's geoms. ! // This will fill up mVolumeQueryResult with those Solids that ! // collide with these geoms. ! std::vector<GeomData*>::const_iterator iter; ! for (iter = geomList->begin(); iter != geomList->end(); ++iter) ! { ! dSpaceCollide2((*iter)->geomID, (dGeomID)mRootSpaceID, this, ! &ode_hidden::internal_volumeCollisionCallback); ! } ! ! // We don't want the volume Solid to be listed in the results. ! mVolumeQueryResult.internal_removeSolid(volume); ! ! return mVolumeQueryResult; ! } void ODESimulator::setGravity(const Vec3r& gravity) |
|
From: tylerstreeter <tyl...@us...> - 2005-03-11 05:32:10
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32461/src Modified Files: AttractorMotorData.h BoxShapeData.h CapsuleShapeData.h GearedMotorData.h JointData.h MeshShapeData.h MotorData.h PlaneShapeData.h RaycastSensor.cpp RaycastSensor.h RaycastSensorData.h SensorData.h ServoMotorData.h ShapeData.h Simulator.h SolidData.h SphereShapeData.h SpringMotorData.h ThrusterMotorData.h Log Message: made data classes exported through win32 dll interface Index: SolidData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SolidData.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SolidData.h 25 Feb 2005 06:40:26 -0000 1.6 --- SolidData.h 11 Mar 2005 05:31:56 -0000 1.7 *************** *** 38,63 **** { public: ! SolidData(); /// Copy constructor. ! SolidData(const SolidData& data); ! virtual ~SolidData(); /// Adds a new Shape to the SolidData. This automatically /// allocates the right ShapeData type. ! virtual void OPAL_CALL addShape(const ShapeData& data); /// Returns the number of Shapes in this SolidData. ! virtual int OPAL_CALL getNumShapes()const; /// Returns a pointer to the ShapeData at the given index. ! virtual ShapeData* OPAL_CALL getShapeData(unsigned int i)const; /// Destroys all Shapes in the SolidData. ! virtual void OPAL_CALL destroyShapes(); /// Makes a deep copy. ! virtual void OPAL_CALL operator=(const SolidData& data); /// Determines whether the Solid is enabled. --- 38,64 ---- { public: ! OPAL_DECL SolidData(); /// Copy constructor. ! OPAL_DECL SolidData(const SolidData& data); ! OPAL_DECL virtual ~SolidData(); /// Adds a new Shape to the SolidData. This automatically /// allocates the right ShapeData type. ! OPAL_DECL virtual void OPAL_CALL addShape(const ShapeData& data); /// Returns the number of Shapes in this SolidData. ! OPAL_DECL virtual int OPAL_CALL getNumShapes()const; /// Returns a pointer to the ShapeData at the given index. ! OPAL_DECL virtual ShapeData* OPAL_CALL getShapeData( ! unsigned int i)const; /// Destroys all Shapes in the SolidData. ! OPAL_DECL virtual void OPAL_CALL destroyShapes(); /// Makes a deep copy. ! OPAL_DECL virtual void OPAL_CALL operator=(const SolidData& data); /// Determines whether the Solid is enabled. Index: SphereShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SphereShapeData.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SphereShapeData.h 8 Mar 2005 16:10:23 -0000 1.4 --- SphereShapeData.h 11 Mar 2005 05:31:56 -0000 1.5 *************** *** 38,42 **** { public: ! SphereShapeData() : ShapeData() { --- 38,42 ---- { public: ! OPAL_DECL SphereShapeData() : ShapeData() { *************** *** 46,60 **** /// Copy constructor. ! SphereShapeData(const SphereShapeData& data) { (*this) = data; } ! virtual ~SphereShapeData() { } /// Makes a deep copy. ! virtual void OPAL_CALL operator=(const SphereShapeData& data) { mType = data.mType; --- 46,61 ---- /// Copy constructor. ! OPAL_DECL SphereShapeData(const SphereShapeData& data) { (*this) = data; } ! OPAL_DECL virtual ~SphereShapeData() { } /// Makes a deep copy. ! OPAL_DECL virtual void OPAL_CALL operator=( ! const SphereShapeData& data) { mType = data.mType; Index: ShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/ShapeData.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ShapeData.h 8 Mar 2005 16:10:23 -0000 1.6 --- ShapeData.h 11 Mar 2005 05:31:56 -0000 1.7 *************** *** 49,53 **** { public: ! ShapeData() { // The initial type doesn't matter since the abstract base --- 49,53 ---- { public: ! OPAL_DECL ShapeData() { // The initial type doesn't matter since the abstract base *************** *** 59,68 **** } ! virtual ~ShapeData() { } /// Returns the Shape's type. ! virtual ShapeType OPAL_CALL getType()const { return mType; --- 59,68 ---- } ! OPAL_DECL virtual ~ShapeData() { } /// Returns the Shape's type. ! OPAL_DECL virtual ShapeType OPAL_CALL getType()const { return mType; Index: SensorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SensorData.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SensorData.h 9 Mar 2005 02:09:49 -0000 1.4 --- SensorData.h 11 Mar 2005 05:31:56 -0000 1.5 *************** *** 45,49 **** { public: ! SensorData() { // The initial type doesn't matter since the abstract base --- 45,49 ---- { public: ! OPAL_DECL SensorData() { // The initial type doesn't matter since the abstract base *************** *** 56,65 **** } ! virtual ~SensorData() { } /// Returns the Sensor's type. ! virtual SensorType OPAL_CALL getType()const { return mType; --- 56,65 ---- } ! OPAL_DECL virtual ~SensorData() { } /// Returns the Sensor's type. ! OPAL_DECL virtual SensorType OPAL_CALL getType()const { return mType; Index: MotorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/MotorData.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MotorData.h 25 Feb 2005 06:40:26 -0000 1.2 --- MotorData.h 11 Mar 2005 05:31:56 -0000 1.3 *************** *** 47,51 **** { public: ! MotorData() { // The initial type doesn't matter since the abstract base --- 47,51 ---- { public: ! OPAL_DECL MotorData() { // The initial type doesn't matter since the abstract base *************** *** 56,65 **** } ! virtual ~MotorData() { } /// Returns the Motor's type. ! virtual MotorType OPAL_CALL getType()const { return mType; --- 56,65 ---- } ! OPAL_DECL virtual ~MotorData() { } /// Returns the Motor's type. ! OPAL_DECL virtual MotorType OPAL_CALL getType()const { return mType; Index: BoxShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/BoxShapeData.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BoxShapeData.h 8 Mar 2005 16:10:23 -0000 1.4 --- BoxShapeData.h 11 Mar 2005 05:31:56 -0000 1.5 *************** *** 38,42 **** { public: ! BoxShapeData() : ShapeData() { --- 38,42 ---- { public: ! OPAL_DECL BoxShapeData() : ShapeData() { *************** *** 46,60 **** /// Copy constructor. ! BoxShapeData(const BoxShapeData& data) { (*this) = data; } ! virtual ~BoxShapeData() { } /// Makes a deep copy. ! virtual void OPAL_CALL operator=(const BoxShapeData& data) { mType = data.mType; --- 46,60 ---- /// Copy constructor. ! OPAL_DECL BoxShapeData(const BoxShapeData& data) { (*this) = data; } ! OPAL_DECL virtual ~BoxShapeData() { } /// Makes a deep copy. ! OPAL_DECL virtual void OPAL_CALL operator=(const BoxShapeData& data) { mType = data.mType; Index: CapsuleShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/CapsuleShapeData.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CapsuleShapeData.h 8 Mar 2005 16:10:23 -0000 1.4 --- CapsuleShapeData.h 11 Mar 2005 05:31:56 -0000 1.5 *************** *** 38,42 **** { public: ! CapsuleShapeData() : ShapeData() { --- 38,42 ---- { public: ! OPAL_DECL CapsuleShapeData() : ShapeData() { *************** *** 47,61 **** /// Copy constructor. ! CapsuleShapeData(const CapsuleShapeData& data) { (*this) = data; } ! virtual ~CapsuleShapeData() { } /// Makes a deep copy. ! virtual void OPAL_CALL operator=(const CapsuleShapeData& data) { mType = data.mType; --- 47,62 ---- /// Copy constructor. ! OPAL_DECL CapsuleShapeData(const CapsuleShapeData& data) { (*this) = data; } ! OPAL_DECL virtual ~CapsuleShapeData() { } /// Makes a deep copy. ! OPAL_DECL virtual void OPAL_CALL operator=( ! const CapsuleShapeData& data) { mType = data.mType; Index: RaycastSensorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/RaycastSensorData.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RaycastSensorData.h 9 Mar 2005 02:09:50 -0000 1.1 --- RaycastSensorData.h 11 Mar 2005 05:31:56 -0000 1.2 *************** *** 38,42 **** { public: ! RaycastSensorData() : SensorData() { --- 38,42 ---- { public: ! OPAL_DECL RaycastSensorData() : SensorData() { *************** *** 46,60 **** /// 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; --- 46,61 ---- /// Copy constructor. ! OPAL_DECL RaycastSensorData(const RaycastSensorData& data) { (*this) = data; } ! OPAL_DECL virtual ~RaycastSensorData() { } /// Makes a deep copy. ! OPAL_DECL virtual void OPAL_CALL operator=( ! const RaycastSensorData& data) { mType = data.mType; Index: GearedMotorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/GearedMotorData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GearedMotorData.h 26 Feb 2005 10:22:23 -0000 1.3 --- GearedMotorData.h 11 Mar 2005 05:31:56 -0000 1.4 *************** *** 38,42 **** { public: ! GearedMotorData() : MotorData() { --- 38,42 ---- { public: ! OPAL_DECL GearedMotorData() : MotorData() { *************** *** 52,66 **** /// Copy constructor. ! GearedMotorData(const GearedMotorData& data) { (*this) = data; } ! virtual ~GearedMotorData() { } /// Makes a deep copy. ! virtual void OPAL_CALL operator=(const GearedMotorData& data) { mType = data.mType; --- 52,67 ---- /// Copy constructor. ! OPAL_DECL GearedMotorData(const GearedMotorData& data) { (*this) = data; } ! OPAL_DECL virtual ~GearedMotorData() { } /// Makes a deep copy. ! OPAL_DECL virtual void OPAL_CALL operator=( ! const GearedMotorData& data) { mType = data.mType; Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Simulator.h 10 Mar 2005 21:13:00 -0000 1.83 --- Simulator.h 11 Mar 2005 05:31:56 -0000 1.84 *************** *** 226,235 **** /// 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; ! ! virtual const RaycastResult& OPAL_CALL internal_fireRay( const Rayr& r, real length ) = 0; /// Returns the Simulator's contact group flags. --- 226,232 ---- /// Helper function used for ray casting. Immediately fires a ray ! /// into the scene and returns intersections results. ! virtual const RaycastResult& OPAL_CALL internal_fireRay( ! const Rayr& r, real length) = 0; /// Returns the Simulator's contact group flags. Index: AttractorMotorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/AttractorMotorData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AttractorMotorData.h 26 Feb 2005 10:22:23 -0000 1.3 --- AttractorMotorData.h 11 Mar 2005 05:31:56 -0000 1.4 *************** *** 38,42 **** { public: ! AttractorMotorData() : MotorData() { --- 38,42 ---- { public: ! OPAL_DECL AttractorMotorData() : MotorData() { *************** *** 53,67 **** /// Copy constructor. ! AttractorMotorData(const AttractorMotorData& data) { (*this) = data; } ! virtual ~AttractorMotorData() { } /// Makes a deep copy. ! virtual void OPAL_CALL operator=(const AttractorMotorData& data) { mType = data.mType; --- 53,68 ---- /// Copy constructor. ! OPAL_DECL AttractorMotorData(const AttractorMotorData& data) { (*this) = data; } ! OPAL_DECL virtual ~AttractorMotorData() { } /// Makes a deep copy. ! OPAL_DECL virtual void OPAL_CALL operator=( ! const AttractorMotorData& data) { mType = data.mType; Index: PlaneShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/PlaneShapeData.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PlaneShapeData.h 8 Mar 2005 16:10:23 -0000 1.4 --- PlaneShapeData.h 11 Mar 2005 05:31:56 -0000 1.5 *************** *** 38,42 **** { public: ! PlaneShapeData() : ShapeData() { --- 38,42 ---- { public: ! OPAL_DECL PlaneShapeData() : ShapeData() { *************** *** 50,64 **** /// Copy constructor. ! PlaneShapeData(const PlaneShapeData& data) { (*this) = data; } ! virtual ~PlaneShapeData() { } /// Makes a deep copy. ! virtual void OPAL_CALL operator=(const PlaneShapeData& data) { mType = data.mType; --- 50,64 ---- /// Copy constructor. ! OPAL_DECL PlaneShapeData(const PlaneShapeData& data) { (*this) = data; } ! OPAL_DECL virtual ~PlaneShapeData() { } /// Makes a deep copy. ! OPAL_DECL virtual void OPAL_CALL operator=(const PlaneShapeData& data) { mType = data.mType; Index: RaycastSensor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/RaycastSensor.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RaycastSensor.cpp 10 Mar 2005 21:13:00 -0000 1.2 --- RaycastSensor.cpp 11 Mar 2005 05:31:56 -0000 1.3 *************** *** 55,59 **** const RaycastResult& RaycastSensor::fireRay() { ! return mSim->internal_fireRay(mData.ray); } --- 55,59 ---- const RaycastResult& RaycastSensor::fireRay() { ! return mSim->internal_fireRay(mData.ray, mData.ray.getLength()); } Index: SpringMotorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SpringMotorData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SpringMotorData.h 26 Feb 2005 10:22:23 -0000 1.3 --- SpringMotorData.h 11 Mar 2005 05:31:56 -0000 1.4 *************** *** 52,56 **** { public: ! SpringMotorData() : MotorData() { --- 52,56 ---- { public: ! OPAL_DECL SpringMotorData() : MotorData() { *************** *** 71,85 **** /// Copy constructor. ! SpringMotorData(const SpringMotorData& data) { (*this) = data; } ! virtual ~SpringMotorData() { } /// Makes a deep copy. ! virtual void OPAL_CALL operator=(const SpringMotorData& data) { mType = data.mType; --- 71,86 ---- /// Copy constructor. ! OPAL_DECL SpringMotorData(const SpringMotorData& data) { (*this) = data; } ! OPAL_DECL virtual ~SpringMotorData() { } /// Makes a deep copy. ! OPAL_DECL virtual void OPAL_CALL operator=( ! const SpringMotorData& data) { mType = data.mType; Index: RaycastSensor.h =================================================================== RCS file: /cvsroot/opal/opal/src/RaycastSensor.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RaycastSensor.h 10 Mar 2005 21:13:00 -0000 1.2 --- RaycastSensor.h 11 Mar 2005 05:31:56 -0000 1.3 *************** *** 68,72 **** /// every time step because that would be a waste of time in most /// cases; it must be "fired" manually. ! class OPAL_DECL RaycastSensor : public Sensor { public: --- 68,72 ---- /// every time step because that would be a waste of time in most /// cases; it must be "fired" manually. ! class RaycastSensor : public Sensor { public: Index: ThrusterMotorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/ThrusterMotorData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ThrusterMotorData.h 26 Feb 2005 10:22:23 -0000 1.3 --- ThrusterMotorData.h 11 Mar 2005 05:31:56 -0000 1.4 *************** *** 38,42 **** { public: ! ThrusterMotorData() : MotorData() { --- 38,42 ---- { public: ! OPAL_DECL ThrusterMotorData() : MotorData() { *************** *** 49,63 **** /// Copy constructor. ! ThrusterMotorData(const ThrusterMotorData& data) { (*this) = data; } ! virtual ~ThrusterMotorData() { } /// Makes a deep copy. ! virtual void OPAL_CALL operator=(const ThrusterMotorData& data) { mType = data.mType; --- 49,64 ---- /// Copy constructor. ! OPAL_DECL ThrusterMotorData(const ThrusterMotorData& data) { (*this) = data; } ! OPAL_DECL virtual ~ThrusterMotorData() { } /// Makes a deep copy. ! OPAL_DECL virtual void OPAL_CALL operator=( ! const ThrusterMotorData& data) { mType = data.mType; Index: ServoMotorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/ServoMotorData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ServoMotorData.h 26 Feb 2005 10:22:23 -0000 1.3 --- ServoMotorData.h 11 Mar 2005 05:31:56 -0000 1.4 *************** *** 50,54 **** { public: ! ServoMotorData() : MotorData() { --- 50,54 ---- { public: ! OPAL_DECL ServoMotorData() : MotorData() { *************** *** 66,80 **** /// Copy constructor. ! ServoMotorData(const ServoMotorData& data) { (*this) = data; } ! virtual ~ServoMotorData() { } /// Makes a deep copy. ! virtual void OPAL_CALL operator=(const ServoMotorData& data) { mType = data.mType; --- 66,80 ---- /// Copy constructor. ! OPAL_DECL ServoMotorData(const ServoMotorData& data) { (*this) = data; } ! OPAL_DECL virtual ~ServoMotorData() { } /// Makes a deep copy. ! OPAL_DECL virtual void OPAL_CALL operator=(const ServoMotorData& data) { mType = data.mType; Index: JointData.h =================================================================== RCS file: /cvsroot/opal/opal/src/JointData.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JointData.h 8 Mar 2005 22:05:03 -0000 1.5 --- JointData.h 11 Mar 2005 05:31:56 -0000 1.6 *************** *** 82,86 **** { public: ! JointData() { mType = defaults::joint::type; --- 82,86 ---- { public: ! OPAL_DECL JointData() { mType = defaults::joint::type; *************** *** 107,121 **** /// Copy constructor. ! JointData(const JointData& data) { (*this) = data; } ! virtual ~JointData() { } /// Makes a deep copy. ! void operator=(const JointData& data) { mType = data.mType; --- 107,121 ---- /// Copy constructor. ! OPAL_DECL JointData(const JointData& data) { (*this) = data; } ! OPAL_DECL virtual ~JointData() { } /// Makes a deep copy. ! OPAL_DECL void operator=(const JointData& data) { mType = data.mType; *************** *** 143,147 **** /// Sets the Joint's type. ! virtual void OPAL_CALL setType(JointType type) { mType = type; --- 143,147 ---- /// Sets the Joint's type. ! OPAL_DECL virtual void OPAL_CALL setType(JointType type) { mType = type; *************** *** 149,153 **** /// Returns the Joint's type. ! virtual JointType OPAL_CALL getType()const { return mType; --- 149,153 ---- /// Returns the Joint's type. ! OPAL_DECL virtual JointType OPAL_CALL getType()const { return mType; Index: MeshShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/MeshShapeData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MeshShapeData.h 8 Mar 2005 16:10:23 -0000 1.3 --- MeshShapeData.h 11 Mar 2005 05:31:56 -0000 1.4 *************** *** 42,46 **** { public: ! MeshShapeData() : ShapeData() { --- 42,46 ---- { public: ! OPAL_DECL MeshShapeData() : ShapeData() { *************** *** 53,67 **** /// Copy constructor. ! MeshShapeData(const MeshShapeData& data) { (*this) = data; } ! virtual ~MeshShapeData() { } /// Makes a shallow copy, simply copying data pointers. ! virtual void OPAL_CALL operator=(const MeshShapeData& data) { mType = data.mType; --- 53,67 ---- /// Copy constructor. ! OPAL_DECL MeshShapeData(const MeshShapeData& data) { (*this) = data; } ! OPAL_DECL virtual ~MeshShapeData() { } /// Makes a shallow copy, simply copying data pointers. ! OPAL_DECL virtual void OPAL_CALL operator=(const MeshShapeData& data) { mType = data.mType; |
|
From: tylerstreeter <tyl...@us...> - 2005-03-11 05:32:07
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32461/src/ODE Modified Files: ODESimulator.cpp ODESimulator.h Log Message: made data classes exported through win32 dll interface Index: ODESimulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.h,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** ODESimulator.h 10 Mar 2005 21:12:53 -0000 1.61 --- ODESimulator.h 11 Mar 2005 05:31:57 -0000 1.62 *************** *** 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. --- 97,102 ---- void OPAL_CALL internal_addCollidedSolid(Solid* solid); ! 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.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** ODESimulator.cpp 10 Mar 2005 21:12:53 -0000 1.88 --- ODESimulator.cpp 11 Mar 2005 05:31:57 -0000 1.89 *************** *** 852,875 **** } ! 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) - { - dir.normalize(); - } - */ - mRaycastResult.solid = NULL; mRaycastResult.intersection.set(0,0,0); --- 852,861 ---- } ! const RaycastResult& ODESimulator::internal_fireRay(const Rayr& r, ! real length) { Point3r origin = r.getOrigin(); Vec3r dir = r.getDir(); mRaycastResult.solid = NULL; mRaycastResult.intersection.set(0,0,0); |
|
From: Andres R. <ar...@us...> - 2005-03-10 21:13:11
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3842/src Modified Files: RaycastSensor.cpp RaycastSensor.h Simulator.h Log Message: added a raycast that takes ray length separately for optimization Index: RaycastSensor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/RaycastSensor.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RaycastSensor.cpp 9 Mar 2005 02:09:50 -0000 1.1 --- RaycastSensor.cpp 10 Mar 2005 21:13:00 -0000 1.2 *************** *** 58,61 **** --- 58,66 ---- } + const RaycastResult& RaycastSensor::fireRay(real length) + { + return mSim->internal_fireRay(mData.ray, length); + } + void RaycastSensor::setEnabled(bool e) { Index: RaycastSensor.h =================================================================== RCS file: /cvsroot/opal/opal/src/RaycastSensor.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RaycastSensor.h 9 Mar 2005 02:09:50 -0000 1.1 --- RaycastSensor.h 10 Mar 2005 21:13:00 -0000 1.2 *************** *** 68,72 **** /// every time step because that would be a waste of time in most /// cases; it must be "fired" manually. ! class RaycastSensor : public Sensor { public: --- 68,72 ---- /// every time step because that would be a waste of time in most /// cases; it must be "fired" manually. ! class OPAL_DECL RaycastSensor : public Sensor { public: *************** *** 86,89 **** --- 86,93 ---- virtual const RaycastResult& OPAL_CALL fireRay(); + /// Fires a ray of a given length into the Sensor's environment + /// information about the first intersection encountered. + virtual const RaycastResult& OPAL_CALL fireRay( real length ); + virtual void OPAL_CALL setEnabled(bool e); Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Simulator.h 9 Mar 2005 02:09:50 -0000 1.82 --- Simulator.h 10 Mar 2005 21:13:00 -0000 1.83 *************** *** 229,234 **** /// 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. --- 229,235 ---- /// 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; ! ! virtual const RaycastResult& OPAL_CALL internal_fireRay( const Rayr& r, real length ) = 0; /// Returns the Simulator's contact group flags. |