Thread: [Opal-commits] opal/src Simulator.cpp,1.66,1.67 Simulator.h,1.101,1.102 opal.h,1.28,1.29 testRaycast
Status: Inactive
Brought to you by:
tylerstreeter
|
From: Olex <ole...@us...> - 2005-11-26 22:40:27
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7819/src Modified Files: Simulator.cpp Simulator.h opal.h testRaycastSensor.cpp Log Message: Simulator::getRootSpace() Added option for the custom simulator. Additional unit tests. Index: opal.h =================================================================== RCS file: /cvsroot/opal/opal/src/opal.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** opal.h 19 Apr 2005 14:20:36 -0000 1.28 --- opal.h 26 Nov 2005 22:40:18 -0000 1.29 *************** *** 76,85 **** OPAL_EXPORT_FUNCTION Simulator* OPAL_CALL createSimulator(); /// Loads a Blueprint from an OPAL XML file. ! OPAL_EXPORT_FUNCTION void OPAL_CALL loadFile(Blueprint& bp, const std::string& filename); /// Saves a Blueprint in an OPAL XML file. ! //OPAL_EXPORT_FUNCTION void OPAL_CALL saveFile(const Blueprint& bp, // const std::string& filename); } --- 76,88 ---- OPAL_EXPORT_FUNCTION Simulator* OPAL_CALL createSimulator(); + /// Creates a custom Simulator. + OPAL_EXPORT_FUNCTION Simulator* OPAL_CALL createCustomSimulator( SimulatorData & data ); + /// Loads a Blueprint from an OPAL XML file. ! OPAL_EXPORT_FUNCTION void OPAL_CALL loadFile(Blueprint& bp, const std::string& filename); /// Saves a Blueprint in an OPAL XML file. ! //OPAL_EXPORT_FUNCTION void OPAL_CALL saveFile(const Blueprint& bp, // const std::string& filename); } Index: testRaycastSensor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/testRaycastSensor.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testRaycastSensor.cpp 15 Nov 2005 03:32:43 -0000 1.1 --- testRaycastSensor.cpp 26 Nov 2005 22:40:18 -0000 1.2 *************** *** 58,62 **** { PlaneShapeData data; ! real plane_params[ 4 ] = {1, 0, 1, 0}; for ( int i = 0; i < 4; ++i ) data.abcd[ i ] = plane_params[ i ]; --- 58,62 ---- { PlaneShapeData data; ! real plane_params[ 4 ] = {0, 1, 0, 0}; for ( int i = 0; i < 4; ++i ) data.abcd[ i ] = plane_params[ i ]; *************** *** 91,95 **** f.caster->setPosition( 0, 10, 0 ); ! RaycastResult r = f.sensor->fireRay(); Point3r hitPoint = r.intersection; --- 91,95 ---- f.caster->setPosition( 0, 10, 0 ); ! RaycastResult r = f.sensor->fireRay( 500 ); Point3r hitPoint = r.intersection; *************** *** 116,120 **** intheway->setStatic( false ); ! RaycastResult r = f.sensor->fireRay(); Point3r hitPoint = r.intersection; Solid * hit = r.solid; --- 116,120 ---- intheway->setStatic( false ); ! RaycastResult r = f.sensor->fireRay( 500 ); Point3r hitPoint = r.intersection; Solid * hit = r.solid; *************** *** 122,126 **** real diff = r.distance; ! QT_CHECK_EQUAL( diff, 5 ); f.sim->destroySolid( intheway ); --- 122,126 ---- real diff = r.distance; ! QT_CHECK_EQUAL( diff, 4 ); f.sim->destroySolid( intheway ); Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Simulator.cpp 19 Jul 2005 17:53:30 -0000 1.66 --- Simulator.cpp 26 Nov 2005 22:40:18 -0000 1.67 *************** *** 57,61 **** mIsSolidDestructionSafe = true; mIsJointDestructionSafe = true; ! mStaticSleepingContactsEnabled = defaults::staticSleepingContactsEnabled; --- 57,61 ---- mIsSolidDestructionSafe = true; mIsJointDestructionSafe = true; ! mStaticSleepingContactsEnabled = defaults::staticSleepingContactsEnabled; *************** *** 65,70 **** --- 65,77 ---- mContactGroupFlags[i] = defaults::contactGroupFlags; } + + mRootSpace = NULL; } + void Simulator::initData( SimulatorData data ) + { + mData = data; + } + Simulator::~Simulator() { *************** *** 79,82 **** --- 86,90 ---- mSpaceList.pop_back(); } + mRootSpace->internal_destroy(); mSolidGarbageList.clear(); *************** *** 104,108 **** // Update Sensors. std::vector<Sensor*>::iterator sensorIter; ! for (sensorIter = mSensorList.begin(); sensorIter != mSensorList.end(); ++sensorIter) { --- 112,116 ---- // Update Sensors. std::vector<Sensor*>::iterator sensorIter; ! for (sensorIter = mSensorList.begin(); sensorIter != mSensorList.end(); ++sensorIter) { *************** *** 112,116 **** // Update Motors. std::vector<Motor*>::iterator motorIter; ! for (motorIter = mMotorList.begin(); motorIter != mMotorList.end(); ++motorIter) { --- 120,124 ---- // Update Motors. std::vector<Motor*>::iterator motorIter; ! for (motorIter = mMotorList.begin(); motorIter != mMotorList.end(); ++motorIter) { *************** *** 120,124 **** // Apply forces/torques to Solids. std::vector<Solid*>::iterator solidIter; ! for (solidIter = mSolidList.begin(); solidIter != mSolidList.end(); ++solidIter) { --- 128,132 ---- // Apply forces/torques to Solids. std::vector<Solid*>::iterator solidIter; ! for (solidIter = mSolidList.begin(); solidIter != mSolidList.end(); ++solidIter) { *************** *** 129,137 **** mIsJointDestructionSafe = false; std::vector<Joint*>::iterator jointIter; ! for (jointIter = mJointList.begin(); jointIter != mJointList.end(); ++jointIter) { ! // If a Joint gets broken here, it will automatically ! // send a Joint break event to the Joint's // JointBreakEventHandler (assuming one exists). (*jointIter)->internal_update(); --- 137,145 ---- mIsJointDestructionSafe = false; std::vector<Joint*>::iterator jointIter; ! for (jointIter = mJointList.begin(); jointIter != mJointList.end(); ++jointIter) { ! // If a Joint gets broken here, it will automatically ! // send a Joint break event to the Joint's // JointBreakEventHandler (assuming one exists). (*jointIter)->internal_update(); *************** *** 139,143 **** mIsJointDestructionSafe = true; ! // Now do physics engine-specific stuff; collision events will // be sent from here. stepPhysics(); --- 147,151 ---- mIsJointDestructionSafe = true; ! // Now do physics engine-specific stuff; collision events will // be sent from here. stepPhysics(); *************** *** 145,154 **** // Loop over Solids again to handle a few more things... mIsSolidDestructionSafe = false; ! for (solidIter = mSolidList.begin(); solidIter != mSolidList.end(); ++solidIter) { Solid* solid = *solidIter; ! // Get each dynamic, awake Solid's new transform from the // physics engine. if (!solid->isStatic() && !solid->isSleeping()) --- 153,162 ---- // Loop over Solids again to handle a few more things... mIsSolidDestructionSafe = false; ! for (solidIter = mSolidList.begin(); solidIter != mSolidList.end(); ++solidIter) { Solid* solid = *solidIter; ! // Get each dynamic, awake Solid's new transform from the // physics engine. if (!solid->isStatic() && !solid->isSleeping()) *************** *** 157,164 **** } ! // Update the sleeping value from the physics engine. This // needs to be updated to keep the Solid's SolidData valid. //solid->internal_updateSleeping(); ! // Update... Now this gets updated in the Solid::getData // function. --- 165,172 ---- } ! // Update the sleeping value from the physics engine. This // needs to be updated to keep the Solid's SolidData valid. //solid->internal_updateSleeping(); ! // Update... Now this gets updated in the Solid::getData // function. *************** *** 211,215 **** void Simulator::instantiateBlueprint( ! BlueprintInstance& instance, const Blueprint& bp, const Matrix44r& offset, real scale) { --- 219,223 ---- void Simulator::instantiateBlueprint( ! BlueprintInstance& instance, const Blueprint& bp, const Matrix44r& offset, real scale) { *************** *** 218,222 **** if (!bp.isFinalized()) { ! OPAL_LOGGER("warning") << "opal::Simulator::instantiateBlueprint: Cannot \ instantiate a Blueprint before it is finalized. Ignoring \ --- 226,230 ---- if (!bp.isFinalized()) { ! OPAL_LOGGER("warning") << "opal::Simulator::instantiateBlueprint: Cannot \ instantiate a Blueprint before it is finalized. Ignoring \ *************** *** 239,255 **** } ! // For each object created here, only the ones with names get added // to the BlueprintInstance. ! // Some of the objects depend on the presence of others, so ! // they must be created in a specific order: Solids depend on ! // nothing, Joints depend on Solids, Motors depend on Joints // and Solids, and Sensors depend on Joints and Solids. ! // For the objects with references to their dependencies (i.e. ! // Joints, Motors, and Sensors), use the stored indices to // find pointers in the appropriate array. ! // Create these temporary arrays of pointers. Other objects // will use these to find pointers to their dependencies. std::vector<Solid*> solidList; --- 247,263 ---- } ! // For each object created here, only the ones with names get added // to the BlueprintInstance. ! // Some of the objects depend on the presence of others, so ! // they must be created in a specific order: Solids depend on ! // nothing, Joints depend on Solids, Motors depend on Joints // and Solids, and Sensors depend on Joints and Solids. ! // For the objects with references to their dependencies (i.e. ! // Joints, Motors, and Sensors), use the stored indices to // find pointers in the appropriate array. ! // Create these temporary arrays of pointers. Other objects // will use these to find pointers to their dependencies. std::vector<Solid*> solidList; *************** *** 262,266 **** Solid* s = createSolid(); ! // Make a local copy of the Solid's data, including all of its // Shapes. SolidData sd = *bp.getSolidData(i); --- 270,274 ---- Solid* s = createSolid(); ! // Make a local copy of the Solid's data, including all of its // Shapes. SolidData sd = *bp.getSolidData(i); *************** *** 286,292 **** case BOX_SHAPE: { ! BoxShapeData* boxData = (BoxShapeData*)shapeData; ! boxData->dimensions = scale * boxData->dimensions; break; --- 294,300 ---- case BOX_SHAPE: { ! BoxShapeData* boxData = (BoxShapeData*)shapeData; ! boxData->dimensions = scale * boxData->dimensions; break; *************** *** 294,300 **** case SPHERE_SHAPE: { ! SphereShapeData* sphereData = (SphereShapeData*)shapeData; ! sphereData->radius = scale * sphereData->radius; break; --- 302,308 ---- case SPHERE_SHAPE: { ! SphereShapeData* sphereData = (SphereShapeData*)shapeData; ! sphereData->radius = scale * sphereData->radius; break; *************** *** 302,310 **** case CAPSULE_SHAPE: { ! CapsuleShapeData* capsuleData = (CapsuleShapeData*)shapeData; ! capsuleData->radius = scale * capsuleData->radius; ! capsuleData->length = scale * capsuleData->length; break; --- 310,318 ---- case CAPSULE_SHAPE: { ! CapsuleShapeData* capsuleData = (CapsuleShapeData*)shapeData; ! capsuleData->radius = scale * capsuleData->radius; ! capsuleData->length = scale * capsuleData->length; break; *************** *** 312,318 **** case PLANE_SHAPE: { ! PlaneShapeData* planeData = (PlaneShapeData*)shapeData; ! planeData->abcd[3] = scale * planeData->abcd[3]; break; --- 320,326 ---- case PLANE_SHAPE: { ! PlaneShapeData* planeData = (PlaneShapeData*)shapeData; ! planeData->abcd[3] = scale * planeData->abcd[3]; break; *************** *** 320,324 **** //case RAY_SHAPE: //{ ! // RayShapeData* rayData = // (RayShapeData*)shapeData; // Point3r origin = rayData->ray.getOrigin(); --- 328,332 ---- //case RAY_SHAPE: //{ ! // RayShapeData* rayData = // (RayShapeData*)shapeData; // Point3r origin = rayData->ray.getOrigin(); *************** *** 329,333 **** case MESH_SHAPE: { ! // Not implemented. Scaling the Mesh data // should be handled elsewhere. break; --- 337,341 ---- case MESH_SHAPE: { ! // Not implemented. Scaling the Mesh data // should be handled elsewhere. break; *************** *** 470,474 **** 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; --- 478,482 ---- 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; *************** *** 507,511 **** { // Make a local copy of the Sensor's data. ! AccelerationSensorData data = *(AccelerationSensorData*)sensorData; data.solid = solidPtr; --- 515,519 ---- { // Make a local copy of the Sensor's data. ! AccelerationSensorData data = *(AccelerationSensorData*)sensorData; data.solid = solidPtr; *************** *** 615,625 **** } ! void Simulator::setupContactGroups(unsigned int group0, unsigned int group1, bool makeContacts) { if (group0 > 31) { ! OPAL_LOGGER("warning") << "opal::Simulator::setupContactGroups: " ! << "Invalid contact group " << group0 << ". Request will be ignored." << std::endl; return; --- 623,633 ---- } ! void Simulator::setupContactGroups(unsigned int group0, unsigned int group1, bool makeContacts) { if (group0 > 31) { ! OPAL_LOGGER("warning") << "opal::Simulator::setupContactGroups: " ! << "Invalid contact group " << group0 << ". Request will be ignored." << std::endl; return; *************** *** 628,638 **** if (group1 > 31) { ! OPAL_LOGGER("warning") << "opal::Simulator::setupContactGroups: " ! << "Invalid contact group " << group1 << ". Request will be ignored." << std::endl; return; } ! // The interaction always goes both ways, so we need to set the bit // flags both ways. --- 636,646 ---- if (group1 > 31) { ! OPAL_LOGGER("warning") << "opal::Simulator::setupContactGroups: " ! << "Invalid contact group " << group1 << ". Request will be ignored." << std::endl; return; } ! // The interaction always goes both ways, so we need to set the bit // flags both ways. *************** *** 662,666 **** } ! void Simulator::setupContactGroup(unsigned int group, bool makeContacts) { --- 670,674 ---- } ! void Simulator::setupContactGroup(unsigned int group, bool makeContacts) { *************** *** 672,681 **** } ! bool Simulator::groupsMakeContacts(unsigned int group0, unsigned int group1) { ! // We only need to check for "one side" of the contact groups ! // here because the groups are always setup both ways (i.e. ! // the interaction between object 0's contact group and // object 1's contact group is always symmetric). --- 680,689 ---- } ! bool Simulator::groupsMakeContacts(unsigned int group0, unsigned int group1) { ! // We only need to check for "one side" of the contact groups ! // here because the groups are always setup both ways (i.e. ! // the interaction between object 0's contact group and // object 1's contact group is always symmetric). *************** *** 707,711 **** } ! Solid* Simulator::createPlane(real a, real b, real c, real d, const Material& m) { --- 715,719 ---- } ! Solid* Simulator::createPlane(real a, real b, real c, real d, const Material& m) { *************** *** 912,917 **** void Simulator::removeSolid(Solid* s) { ! // TODO: make this more efficient by not iterating through all Motors, ! // Sensors, and Joints; maybe have the Solid maintain pointers to // things that depend on it. --- 920,925 ---- void Simulator::removeSolid(Solid* s) { ! // TODO: make this more efficient by not iterating through all Motors, ! // Sensors, and Joints; maybe have the Solid maintain pointers to // things that depend on it. *************** *** 967,972 **** void Simulator::removeJoint(Joint* j) { ! // TODO: make this more efficient by not iterating through all Motors; ! // maybe have the Solid maintain pointers to things that // depend on it. --- 975,980 ---- void Simulator::removeJoint(Joint* j) { ! // TODO: make this more efficient by not iterating through all Motors; ! // maybe have the Solid maintain pointers to things that // depend on it. *************** *** 1044,1047 **** --- 1052,1060 ---- } + Space* Simulator::getRootSpace() + { + return mRootSpace; + } + void Simulator::destroyGarbage() { Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** Simulator.h 24 Jun 2005 18:46:29 -0000 1.101 --- Simulator.h 26 Nov 2005 22:40:18 -0000 1.102 *************** *** 36,39 **** --- 36,40 ---- #include "Blueprint.h" #include "Sensor.h" + #include "Vec3r.h" namespace opal *************** *** 53,59 **** struct VolumeQueryResult; ! /// A Simulator is an environment that contains simulated objects. ! /// It performs collision detection and physical simulation. It is ! /// a factory that creates, maintains, and destroys Solids, Joints, /// Motors, and Sensors. class Simulator --- 54,116 ---- struct VolumeQueryResult; ! /// Various configuration data for Simulator ! class SimulatorData ! { ! public: ! /// constructor with default values ! SimulatorData() ! { ! useOctreeInsteadHash = false; ! ! // octree defaults ! worldSize = Vec3r( 1000, 1000, 1000 ); ! octreeDepth = 7; ! worldCenter = Vec3r( 0, 0, 0 ); ! ! // hash defaults ! hashMinLevel = -5; ! hashMaxLevel = 9; ! } ! ! /// copy-constructor ! /* ! SimulatorData( SimulatorData & copy ) ! { ! useOctreeInsteadHash = copy.useOctreeInsteadHash; ! ! // octree defaults ! worldSize = copy.worldSize; ! octreeDepth = copy.octreeDepth; ! worldCenter = copy.worldCenter; ! ! // hash defaults ! hashMinLevel = copy.hashMinLevel; ! hashMaxLevel = copy.hashMaxLevel; ! }*/ ! ! /// if true, octree space will be used ! /// if false, hash space will be used instead ! /// default is false = hash space ! bool useOctreeInsteadHash; ! ! /// used for octree space, default - (1000,1000,1000) ! Vec3r worldSize; ! ! /// used for octree space, default - (0,0,0) ! Vec3r worldCenter; ! ! /// used for octree space, default - 7 ! int octreeDepth; ! ! /// for hash space: 2^(this value) ! int hashMinLevel; ! ! /// for hash space: 2^(this value) ! int hashMaxLevel; ! }; ! ! /// A Simulator is an environment that contains simulated objects. ! /// It performs collision detection and physical simulation. It is ! /// a factory that creates, maintains, and destroys Solids, Joints, /// Motors, and Sensors. class Simulator *************** *** 62,80 **** Simulator(); ! /// Deallocates everything within the Simulator. This should be ! /// called when finished with everything. Simulator implementations /// should call "delete this" within this function. virtual void OPAL_CALL destroy() = 0; ! /// This function performs collision detection and simulates ! /// everything ahead by the given dt. Internally, it steps through ! /// the simulation iteratively using a fixed step size (so you can ! /// pass in whatever dt you want; it will be broken up into fixed ! /// increments automatically). Any "leftover" time will be saved ! /// until the next time this is called. The function returns true ! /// if at least one time step has been taken. During collision ! /// detection, the following cases are ignored when deciding whether ! /// to collide two Solids (ignored both for physical contact ! /// generation and collision event handling): /// 1. Two static Solids, each without a CollisionEventHandler. /// 2. Two Shapes that are part of the same Solid. --- 119,139 ---- Simulator(); ! virtual void initData( SimulatorData data ); ! ! /// Deallocates everything within the Simulator. This should be ! /// called when finished with everything. Simulator implementations /// should call "delete this" within this function. virtual void OPAL_CALL destroy() = 0; ! /// This function performs collision detection and simulates ! /// everything ahead by the given dt. Internally, it steps through ! /// the simulation iteratively using a fixed step size (so you can ! /// pass in whatever dt you want; it will be broken up into fixed ! /// increments automatically). Any "leftover" time will be saved ! /// until the next time this is called. The function returns true ! /// if at least one time step has been taken. During collision ! /// detection, the following cases are ignored when deciding whether ! /// to collide two Solids (ignored both for physical contact ! /// generation and collision event handling): /// 1. Two static Solids, each without a CollisionEventHandler. /// 2. Two Shapes that are part of the same Solid. *************** *** 82,99 **** /// 4. Two Solids connected by a fixed Joint. /// 5. Two Solids connected by a Joint with contacts disabled. ! /// 6. Solid0 is static, Solid1 dynamic and is sleeping, ! /// static-to-sleeping contacts are ignored by the ! /// Simulator, and neither Solid has a /// CollisionEventHandler. ! /// 7. Solid1 is static, Solid0 dynamic and is sleeping, ! /// static-to-sleeping contacts are ignored by the ! /// Simulator, and neither Solid has a /// CollisionEventHandler. ! /// 8. The two Solids' contact groups do not generate ! /// contacts when they collide, and neither Solid has a /// CollisionEventHandler. 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); --- 141,158 ---- /// 4. Two Solids connected by a fixed Joint. /// 5. Two Solids connected by a Joint with contacts disabled. ! /// 6. Solid0 is static, Solid1 dynamic and is sleeping, ! /// static-to-sleeping contacts are ignored by the ! /// Simulator, and neither Solid has a /// CollisionEventHandler. ! /// 7. Solid1 is static, Solid0 dynamic and is sleeping, ! /// static-to-sleeping contacts are ignored by the ! /// Simulator, and neither Solid has a /// CollisionEventHandler. ! /// 8. The two Solids' contact groups do not generate ! /// contacts when they collide, and neither Solid has a /// CollisionEventHandler. 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); *************** *** 102,209 **** virtual real OPAL_CALL getStepSize(); ! /// Sets the Simulator's post-step event handler. virtual void OPAL_CALL setPostStepEventHandler( PostStepEventHandler* eventHandler); ! /// Returns the Simulator's post-step event handler. If this /// returns NULL, the Simulator is not using one. ! virtual PostStepEventHandler* OPAL_CALL getPostStepEventHandler()const; ! /// Creates instances of all objects in a Blueprint and fills the ! /// given BlueprintInstance with pointers of the named objects. The ! /// offset transform and scale factor can be used to affect ! /// all instantiated objects at once. The scale factor must be /// greater than zero. virtual void OPAL_CALL instantiateBlueprint( ! BlueprintInstance& instance, const Blueprint& bp, const Matrix44r& offset=Matrix44r(), real scale=1); ! /// Sets the gravity used in the simulation. virtual void OPAL_CALL setGravity(const Vec3r& gravity) = 0; ! /// Returns the gravity used in the simulation. virtual Vec3r OPAL_CALL getGravity()const = 0; ! /// Sets the accuracy level used by the physics engine's constraint /// solver. virtual void OPAL_CALL setSolverAccuracy(SolverAccuracyLevel level); ! /// Returns the accuracy level. virtual SolverAccuracyLevel OPAL_CALL getSolverAccuracy()const; ! /// Sets the maximum correcting velocity for interpenetrating /// objects. The given velocity must be positive. virtual void OPAL_CALL setMaxCorrectingVel(real vel); ! /// Returns the maximum correcting velocity for interpenetrating /// objects. virtual real OPAL_CALL getMaxCorrectingVel()const; ! /// Sets the maximum number of physical contacts generated when ! /// two Solids collide. This number cannot be larger than the /// global "max max contacts" parameter. virtual void OPAL_CALL setMaxContacts(unsigned int mc); ! /// Returns the maximum number of physical contacts generated /// when two Solids collide. virtual unsigned int OPAL_CALL getMaxContacts()const; ! /// Sets the maximum linear velocity for any Solid. This limits ! /// Solid motion to prevent explosions from numerical innacuracy. //virtual void OPAL_CALL setMaxLinearVel(real max); ! /// Returns the maximum linear velocity for any Solid. This limits ! /// Solid motion to prevent explosions from numerical innacuracy. //virtual real OPAL_CALL getMaxLinearVel()const; ! /// Sets the maximum angular velocity for any Solid. This limits ! /// Solid motion to prevent explosions from numerical innacuracy. //virtual void OPAL_CALL setMaxAngularVel(real max); ! /// Returns the maximum angular velocity for any Solid. This limits ! /// Solid motion to prevent explosions from numerical innacuracy. //virtual real OPAL_CALL getMaxAngularVel()const; ! /// Set the user data pointer to some external data. The user data /// is totally user-managed /// (i.e. it is not destroyed when the Simulator is destroyed). virtual void OPAL_CALL setUserData(void* data); ! /// Returns the user data pointer (NULL if it has not been set). virtual void* OPAL_CALL getUserData(); ! /// Defines the interaction between two contact groups. If the ! /// last argument is true, the two groups will generate physical ! /// points when they collide. Otherwise, they will pass through ! /// each other. Keep in mind that certain cases are already ! /// ignored when performing collision detection; see comments ! /// on Simulator::simulate for more details. ! /// Note that contact groups do not affect collision events; two ! /// colliding objects might not generate contacts and still /// generate collision events sent to their CollisionEventHandlers. ! virtual void OPAL_CALL setupContactGroups(unsigned int group0, unsigned int group1, bool makeContacts); ! /// 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); ! /// Returns true if the two contact groups are setup to generate /// contacts when they collide. ! virtual bool OPAL_CALL groupsMakeContacts(unsigned int group0, unsigned int group1); ! /// Sets whether contacts should be generated between static Solids ! /// and sleeping Solids. Usually this isn't necessary, but ! /// sometimes you might want a static Solid to wake up a sleeping /// dynamic Solid by touching it. virtual void OPAL_CALL setStaticSleepingContactsEnabled(bool enable); ! /// Returns true if contacts are generated between static Solids /// and sleeping Solids. virtual bool OPAL_CALL areStaticSleepingContactsEnabled(); --- 161,268 ---- virtual real OPAL_CALL getStepSize(); ! /// Sets the Simulator's post-step event handler. virtual void OPAL_CALL setPostStepEventHandl... [truncated message content] |