[Opal-commits] opal/src RaycastSensor.cpp,NONE,1.1 RaycastSensor.h,NONE,1.1 RaycastSensorData.h,NONE
Status: Inactive
Brought to you by:
tylerstreeter
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11688/src Modified Files: AttractorMotor.cpp AttractorMotor.h GearedMotor.cpp GearedMotor.h Motor.cpp Motor.h SConscript Sensor.cpp Sensor.h SensorData.h ServoMotor.cpp ServoMotor.h Simulator.cpp Simulator.h SpringMotor.cpp SpringMotor.h ThrusterMotor.cpp ThrusterMotor.h opal.h Added Files: RaycastSensor.cpp RaycastSensor.h RaycastSensorData.h Log Message: added a RaycastSensor, which replaces the old Simulator ray casting functions Index: Sensor.h =================================================================== RCS file: /cvsroot/opal/opal/src/Sensor.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Sensor.h 25 Feb 2005 06:40:26 -0000 1.7 --- Sensor.h 9 Mar 2005 02:09:49 -0000 1.8 *************** *** 30,40 **** #include "Defines.h" namespace opal { ! /// A device that records data from a simulation. Some Sensors must be /// attached to Solids, some can simply be positioned somewhere within /// an environment, and some can work either way. All Sensors start out ! /// disabled and must be initialized via init) before they can be /// enabled. class Sensor --- 30,41 ---- #include "Defines.h" + #include "SensorData.h" namespace opal { ! /// A device that records data from a simulation. Some Sensors can be /// attached to Solids, some can simply be positioned somewhere within /// an environment, and some can work either way. All Sensors start out ! /// disabled and must be initialized via init) before they can be /// enabled. class Sensor *************** *** 60,63 **** --- 61,73 ---- virtual void* OPAL_CALL getUserData(); + /// Returns the Sensor type. + virtual SensorType OPAL_CALL getType()const = 0; + + /// Sets the Sensor's transform. + virtual void OPAL_CALL setTransform(const Matrix44r& name) = 0; + + /// Returns the Sensor's transform. + virtual const Matrix44r& OPAL_CALL getTransform()const = 0; + /// Sets the Sensor's name. virtual void OPAL_CALL setName(const std::string& name) = 0; *************** *** 74,79 **** protected: ! /// True if the Sensor is enabled. ! //bool mEnabled; /// Pointer to user data. This is totally user-managed (i.e. OPAL --- 84,89 ---- protected: ! /// Called by subclasses when they are initialized. ! void init(); /// Pointer to user data. This is totally user-managed (i.e. OPAL Index: opal.h =================================================================== RCS file: /cvsroot/opal/opal/src/opal.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** opal.h 8 Mar 2005 16:10:23 -0000 1.20 --- opal.h 9 Mar 2005 02:09:50 -0000 1.21 *************** *** 54,57 **** --- 54,59 ---- #include "Sensor.h" #include "SensorData.h" + #include "RaycastSensor.h" + #include "RaycastSensorData.h" #include "EventHandler.h" #include "JointBreakEventHandler.h" Index: SConscript =================================================================== RCS file: /cvsroot/opal/opal/src/SConscript,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SConscript 8 Mar 2005 16:10:23 -0000 1.12 --- SConscript 9 Mar 2005 02:09:49 -0000 1.13 *************** *** 30,33 **** --- 30,35 ---- Portability.h Quaternion.h + RaycastSensor.h + RaycastSensorData.h Rayr.h RayShapeData.h *************** *** 61,64 **** --- 63,67 ---- Logger.cpp Motor.cpp + RaycastSensor.cpp Sensor.cpp ServoMotor.cpp Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Simulator.cpp 8 Mar 2005 16:10:23 -0000 1.43 --- Simulator.cpp 9 Mar 2005 02:09:49 -0000 1.44 *************** *** 32,35 **** --- 32,41 ---- #include "CapsuleShapeData.h" #include "PlaneShapeData.h" + #include "ThrusterMotor.h" + #include "GearedMotor.h" + #include "ServoMotor.h" + #include "AttractorMotor.h" + #include "SpringMotor.h" + #include "RaycastSensor.h" namespace opal *************** *** 107,111 **** while (mTimeBuffer >= mStepSize) { ! // TODO: Call some user-defined function here... // Update Sensors. --- 113,118 ---- while (mTimeBuffer >= mStepSize) { ! // TODO: Call some user-defined function here; maybe have ! // a BeginStepEventHandler // Update Sensors. *************** *** 606,609 **** --- 613,626 ---- } + void Simulator::setupContactGroup(unsigned int group, + bool makeContacts) + { + int i=0; + for (i=0; i<32; ++i) + { + setupContactGroups(group, i, makeContacts); + } + } + unsigned long int Simulator::internal_getContactGroupFlags( unsigned int groupNum)const *************** *** 709,720 **** } ! Solid* Simulator::createSensor() { ! //Sensor* newSensor = new Sensor(); ! //addSensor(newSensor); ! //return newSensor; ! ! // Temporary... ! return NULL; } --- 726,734 ---- } ! RaycastSensor* Simulator::createRaycastSensor() { ! RaycastSensor* newSensor = new RaycastSensor(this); ! addSensor(newSensor); ! return newSensor; } Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** Simulator.h 8 Mar 2005 22:05:03 -0000 1.81 --- Simulator.h 9 Mar 2005 02:09:50 -0000 1.82 *************** *** 34,42 **** #include "Solid.h" #include "Space.h" - #include "ThrusterMotor.h" - #include "GearedMotor.h" - #include "ServoMotor.h" - #include "AttractorMotor.h" - #include "SpringMotor.h" #include "Blueprint.h" #include "Sensor.h" --- 34,37 ---- *************** *** 44,74 **** namespace opal { class BlueprintInstance; ! ! /// A data structure containing information about a specific ! /// intersection from a ray cast. ! struct RaycastResult ! { ! RaycastResult() ! { ! solid = NULL; ! // "intersection" is initialized in its own constructor. ! // "normal" is initialized in its own constructor. ! distance = 0; ! } ! ! /// The first Solid hit by the ray. ! Solid* solid; ! ! /// The point of intersection. ! Point3r intersection; ! ! /// The normal vector at the point of intersection. ! Vec3r normal; ! ! /// The distance from the base of the ray to the intersection ! /// point. ! real distance; ! }; /// A Simulator is an environment that contains simulated objects. --- 39,50 ---- namespace opal { + class AttractorMotor; + class GearedMotor; + class ServoMotor; + class SpringMotor; + class ThrusterMotor; + class RaycastSensor; class BlueprintInstance; ! struct RaycastResult; /// A Simulator is an environment that contains simulated objects. *************** *** 113,121 **** // std::vector<Solid*>* solids) = 0; - /// A convenient ray casting function. TODO: replace with a - /// Sensor. - virtual RaycastResult OPAL_CALL shootRay(const Point3r& origin, - const Vec3r& dir, real length) = 0; - /// Sets the gravity used in the simulation. virtual void OPAL_CALL setGravity(const Vec3r& gravity) = 0; --- 89,92 ---- *************** *** 169,172 **** --- 140,151 ---- unsigned int group1, bool makeContacts); + /// Similar to setupContactGroups. Determines how a single contact + /// group interacts with all other groups. This is useful when + /// you want to e.g. disable collisions between a group and + /// everything else for a "trigger volume." (See setupContactGroups + /// for more details). + virtual void OPAL_CALL setupContactGroup(unsigned int group, + bool makeContacts); + // SOLIDS *************** *** 226,231 **** // SENSORS ! /// Creates and returns a pointer to a Sensor. ! virtual Solid* OPAL_CALL createSensor(); /// Immediately destroys the given Sensor. --- 205,210 ---- // SENSORS ! /// Creates and returns a pointer to a RaycastSensor. ! virtual RaycastSensor* OPAL_CALL createRaycastSensor(); /// Immediately destroys the given Sensor. *************** *** 246,249 **** --- 225,235 ---- virtual void OPAL_CALL internal_stepPhysics() = 0; + /// Helper function used for ray casting. Immediately fires a ray + /// into the scene and returns intersections results. Takes an + /// unnormalized ray, which is important because the ray's length + /// is used when casting the ray into the scene. + virtual const RaycastResult& OPAL_CALL internal_fireRay( + const Rayr& r) = 0; + /// Returns the Simulator's contact group flags. virtual unsigned long int OPAL_CALL Index: Sensor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Sensor.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Sensor.cpp 25 Feb 2005 06:40:26 -0000 1.4 --- Sensor.cpp 9 Mar 2005 02:09:49 -0000 1.5 *************** *** 32,37 **** Sensor::Sensor() { - // "mData" is initialized in its own constructor. - //mEnabled = false; mInitCalled = false; setUserData(NULL); --- 32,35 ---- *************** *** 42,45 **** --- 40,48 ---- } + void Sensor::init() + { + mInitCalled = true; + } + void Sensor::setUserData(void* data) { --- NEW FILE: RaycastSensor.h --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #ifndef OPAL_RAYCAST_SENSOR_H #define OPAL_RAYCAST_SENSOR_H #include "Defines.h" #include "Sensor.h" #include "RaycastSensorData.h" namespace opal { class Simulator; /// A data structure containing information about a specific /// intersection from a ray cast. struct RaycastResult { RaycastResult() { solid = NULL; // "intersection" is initialized in its own constructor. // "normal" is initialized in its own constructor. distance = 0; } /// The first Solid hit by the ray. This will remain NULL if no /// Solid is hit. Solid* solid; /// The point of intersection. Point3r intersection; /// The normal vector at the point of intersection. Vec3r normal; /// The distance from the base of the ray to the intersection /// point. real distance; }; /// A Sensor that fires a ray into a scene and returns data describing /// the intersection, if any. This Sensor does not fire a ray on /// every time step because that would be a waste of time in most /// cases; it must be "fired" manually. class RaycastSensor : public Sensor { public: RaycastSensor(Simulator* s); virtual ~RaycastSensor(); /// Initializes the Sensor with the given data structure. Solid /// pointer in the data must be valid. virtual void OPAL_CALL init(const RaycastSensorData& data); /// Returns all data describing the Sensor. virtual const RaycastSensorData& OPAL_CALL getData()const; /// Fires a ray into the Sensor's environment, returning /// information about the first intersection encountered. virtual const RaycastResult& OPAL_CALL fireRay(); virtual void OPAL_CALL setEnabled(bool e); virtual bool OPAL_CALL isEnabled()const; /// Sets the Sensor's ray. virtual void OPAL_CALL setRay(Rayr r); /// Returns the Sensor's ray. virtual const Rayr& OPAL_CALL getRay()const; virtual void OPAL_CALL setTransform(const Matrix44r& t); virtual const Matrix44r& OPAL_CALL getTransform()const; virtual SensorType OPAL_CALL getType()const; virtual void OPAL_CALL setName(const std::string& name); virtual const std::string& OPAL_CALL getName()const; virtual void OPAL_CALL internal_update(); virtual bool OPAL_CALL internal_dependsOn(Solid* solid); protected: /// Stores data describing the Sensor. RaycastSensorData mData; /// Pointer to the Simulator containing this Sensor; used to fire /// rays into the Simulator. Simulator* mSim; private: }; } #endif Index: GearedMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/GearedMotor.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GearedMotor.h 1 Mar 2005 05:04:22 -0000 1.9 --- GearedMotor.h 9 Mar 2005 02:09:49 -0000 1.10 *************** *** 65,68 **** --- 65,70 ---- virtual const GearedMotorData& OPAL_CALL getData()const; + virtual MotorType OPAL_CALL getType()const; + virtual void OPAL_CALL setName(const std::string& name); *************** *** 100,121 **** GearedMotorData mData; - ///// Pointer to the Joint affected by this Motor. - //Joint* mJoint; - - ///// The index of the specific Joint axis affected by this Motor. - //int mJointAxisNum; - - ///// The maximum amount of torque that can be applied to the Joint - ///// axis. - //real mMaxTorque; - - ///// The inverse of the maximum velocity that can be achieved by - ///// the Motor. The inverse is cached for faster computations. - //real mMaxVelInverse; - - ///// The throttle (i.e. the "gas") affects how much of the available - ///// torque is applied to the Joint axis. - //real mThrottle; - private: --- 102,105 ---- Index: SpringMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/SpringMotor.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SpringMotor.h 8 Mar 2005 16:10:23 -0000 1.10 --- SpringMotor.h 9 Mar 2005 02:09:50 -0000 1.11 *************** *** 59,62 **** --- 59,64 ---- virtual const SpringMotorData& OPAL_CALL getData()const; + virtual MotorType OPAL_CALL getType()const; + virtual void OPAL_CALL setName(const std::string& name); Index: SensorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SensorData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SensorData.h 25 Feb 2005 06:40:26 -0000 1.3 --- SensorData.h 9 Mar 2005 02:09:49 -0000 1.4 *************** *** 37,41 **** { VELOCITY_SENSOR, ! ACCELERATION_SENSOR }; --- 37,42 ---- { VELOCITY_SENSOR, ! ACCELERATION_SENSOR, ! RAYCAST_SENSOR }; *************** *** 51,54 **** --- 52,57 ---- enabled = defaults::sensor::enabled; name = ""; + solid = NULL; + // "transform" is initialized in its own constructor. } *************** *** 69,72 **** --- 72,85 ---- std::string name; + /// Pointer to the Solid to which this Sensor is attached. This + /// will be NULL if the Sensor is not attached to a Solid (i.e. + /// it is positioned somewhere within the environment). + Solid* solid; + + /// If the Sensor is attached to a Solid, this matrix is the global + /// offset from that Solid's transform. Otherwise, it is just the + /// Sensor's global transform. + Matrix44r transform; + protected: /// The Sensor type. Index: ThrusterMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/ThrusterMotor.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ThrusterMotor.h 8 Mar 2005 16:10:23 -0000 1.11 --- ThrusterMotor.h 9 Mar 2005 02:09:50 -0000 1.12 *************** *** 59,62 **** --- 59,64 ---- virtual const ThrusterMotorData& OPAL_CALL getData()const; + virtual MotorType OPAL_CALL getType()const; + virtual void OPAL_CALL setName(const std::string& name); Index: Motor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Motor.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Motor.cpp 5 Mar 2005 21:26:24 -0000 1.15 --- Motor.cpp 9 Mar 2005 02:09:49 -0000 1.16 *************** *** 32,36 **** Motor::Motor() { - // "mData" is initialized in its own constructor. //mIsCustom = false; mInitCalled = false; --- 32,35 ---- *************** *** 45,49 **** { mInitCalled = true; - //mEnabled = true; } --- 44,47 ---- Index: GearedMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/GearedMotor.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GearedMotor.cpp 1 Mar 2005 05:04:22 -0000 1.9 --- GearedMotor.cpp 9 Mar 2005 02:09:49 -0000 1.10 *************** *** 62,65 **** --- 62,70 ---- } + MotorType GearedMotor::getType()const + { + return mData.getType(); + } + void GearedMotor::setName(const std::string& name) { Index: ServoMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/ServoMotor.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ServoMotor.h 1 Mar 2005 05:04:22 -0000 1.23 --- ServoMotor.h 9 Mar 2005 02:09:49 -0000 1.24 *************** *** 61,64 **** --- 61,66 ---- virtual const ServoMotorData& OPAL_CALL getData()const; + virtual MotorType OPAL_CALL getType()const; + virtual void OPAL_CALL setName(const std::string& name); *************** *** 109,137 **** ServoMotorData mData; - ///// Pointer to the Joint affected by this Motor. - //Joint* mJoint; - - ///// The Motor's mode of operation. - //Mode mMode; - - ///// The index of the Joint axes affected by this Motor. - //int mJointAxis; - - ///// The Motor's desired position. This is only used if the - ///// appropriate mode is set. - //real mDesiredPos; - // - ///// The Motor's desired position. This is only used if the - ///// appropriate mode is set. - //real mDesiredVel; - - ///// The maximum amount of force that can be used to help the - ///// Joint axis achieve its desired position or velocity. - //real mMaxForce; - - ///// A constant used in desired position mode that scaled how fast - ///// the Joint axis will achieve its desired position. - //real mRestoreSpeed; - private: --- 111,114 ---- Index: AttractorMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/AttractorMotor.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** AttractorMotor.h 8 Mar 2005 16:10:23 -0000 1.26 --- AttractorMotor.h 9 Mar 2005 02:09:49 -0000 1.27 *************** *** 60,63 **** --- 60,65 ---- virtual const AttractorMotorData& OPAL_CALL getData()const; + virtual MotorType OPAL_CALL getType()const; + virtual void OPAL_CALL setName(const std::string& name); Index: ThrusterMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ThrusterMotor.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ThrusterMotor.cpp 4 Mar 2005 05:09:24 -0000 1.9 --- ThrusterMotor.cpp 9 Mar 2005 02:09:50 -0000 1.10 *************** *** 61,64 **** --- 61,69 ---- } + MotorType ThrusterMotor::getType()const + { + return mData.getType(); + } + void ThrusterMotor::setName(const std::string& name) { --- NEW FILE: RaycastSensorData.h --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #ifndef OPAL_RAYCAST_SENSOR_DATA_H #define OPAL_RAYCAST_SENSOR_DATA_H #include "Defines.h" #include "SensorData.h" namespace opal { /// A data structure describing a RaycastSensor. class RaycastSensorData : public SensorData { public: RaycastSensorData() : SensorData() { mType = RAYCAST_SENSOR; // "ray" is initialized in its own constructor. } /// Copy constructor. RaycastSensorData(const RaycastSensorData& data) { (*this) = data; } virtual ~RaycastSensorData() { } /// Makes a deep copy. virtual void OPAL_CALL operator=(const RaycastSensorData& data) { mType = data.mType; enabled = data.enabled; name = data.name; solid = data.solid; transform = data.transform; ray = data.ray; } /// The ray used by this Sensor for ray casting. The length of the /// ray is important; objects beyond the length of the ray will not /// be intersected. Keep in mind that the Sensor's transform may /// affect the ray's final origin and direction. Rayr ray; protected: private: }; } #endif --- NEW FILE: RaycastSensor.cpp --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #include "RaycastSensor.h" #include "Simulator.h" namespace opal { RaycastSensor::RaycastSensor(Simulator* s) { // "mData" is initialized in its own constructor. mSim = s; } RaycastSensor::~RaycastSensor() { } void RaycastSensor::init(const RaycastSensorData& data) { assert(data.solid); Sensor::init(); mData = data; } const RaycastSensorData& RaycastSensor::getData()const { return mData; } const RaycastResult& RaycastSensor::fireRay() { return mSim->internal_fireRay(mData.ray); } void RaycastSensor::setEnabled(bool e) { if (!mInitCalled) { return; } mData.enabled = e; } bool RaycastSensor::isEnabled()const { return mData.enabled; } void RaycastSensor::setRay(Rayr r) { mData.ray = r; } const Rayr& RaycastSensor::getRay()const { return mData.ray; } SensorType RaycastSensor::getType()const { return mData.getType(); } void RaycastSensor::setTransform(const Matrix44r& t) { mData.transform = t; } const Matrix44r& RaycastSensor::getTransform()const { return mData.transform; } void RaycastSensor::setName(const std::string& name) { mData.name = name; } const std::string& RaycastSensor::getName()const { return mData.name; } void RaycastSensor::internal_update() { if (mData.enabled) { // TODO: if mData.solid is valid, update this Sensor's ray // relative to the Solid } } bool RaycastSensor::internal_dependsOn(Solid* solid) { if (solid == mData.solid) { return true; } else { return false; } } } Index: ServoMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ServoMotor.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ServoMotor.cpp 1 Mar 2005 05:04:22 -0000 1.13 --- ServoMotor.cpp 9 Mar 2005 02:09:49 -0000 1.14 *************** *** 90,93 **** --- 90,98 ---- } + MotorType ServoMotor::getType()const + { + return mData.getType(); + } + void ServoMotor::setName(const std::string& name) { Index: SpringMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/SpringMotor.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SpringMotor.cpp 1 Mar 2005 05:04:22 -0000 1.8 --- SpringMotor.cpp 9 Mar 2005 02:09:50 -0000 1.9 *************** *** 60,63 **** --- 60,68 ---- } + MotorType SpringMotor::getType()const + { + return mData.getType(); + } + void SpringMotor::setName(const std::string& name) { Index: AttractorMotor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/AttractorMotor.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AttractorMotor.cpp 4 Mar 2005 23:26:53 -0000 1.19 --- AttractorMotor.cpp 9 Mar 2005 02:09:49 -0000 1.20 *************** *** 73,76 **** --- 73,81 ---- } + MotorType AttractorMotor::getType()const + { + return mData.getType(); + } + void AttractorMotor::setName(const std::string& name) { Index: Motor.h =================================================================== RCS file: /cvsroot/opal/opal/src/Motor.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Motor.h 5 Mar 2005 21:26:24 -0000 1.36 --- Motor.h 9 Mar 2005 02:09:49 -0000 1.37 *************** *** 30,33 **** --- 30,34 ---- #include "Defines.h" + #include "MotorData.h" namespace opal *************** *** 67,70 **** --- 68,74 ---- virtual void* OPAL_CALL getUserData(); + /// Returns the Motor type. + virtual MotorType OPAL_CALL getType()const = 0; + /// Sets the Motor's name. virtual void OPAL_CALL setName(const std::string& name) = 0; *************** *** 94,100 **** void init(); - /// True if the Motor is enabled. - //bool mEnabled; - /// Pointer to user data. This is totally user-managed (i.e. OPAL /// will never delete it). --- 98,101 ---- |