Thread: [Opal-commits] opal/src Vec3r.cpp,NONE,1.1 testPoint3r.cpp,NONE,1.1 testVec3r.cpp,NONE,1.1 Defines.h
Status: Inactive
Brought to you by:
tylerstreeter
|
From: Olex <ole...@us...> - 2005-11-30 06:28:20
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18063/src Modified Files: Defines.h Makefile.am Makefile.in Matrix44r.h OpalMath.h Point3r.h SConscript SensorData.h ShapeData.h SpringMotor.h Vec3r.h Added Files: Vec3r.cpp testPoint3r.cpp testVec3r.cpp Log Message: Vec3r and Point3r refactored and fixed with unit tests. Index: ShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/ShapeData.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ShapeData.h 21 Jul 2005 15:59:01 -0000 1.9 --- ShapeData.h 30 Nov 2005 06:28:12 -0000 1.10 *************** *** 29,33 **** --- 29,35 ---- #define OPAL_SHAPE_DATA_H + // project headers #include "Defines.h" + #include "Matrix44r.h" namespace opal *************** *** 44,48 **** }; ! /// A data structure describing a Shape. Note that there is no other /// class associated with Shapes besides this one. class ShapeData --- 46,50 ---- }; ! /// A data structure describing a Shape. Note that there is no other /// class associated with Shapes besides this one. class ShapeData *************** *** 51,55 **** OPAL_DECL ShapeData() { ! // The initial type doesn't matter since the abstract base // class will never be instantiated. mType = SPHERE_SHAPE; --- 53,57 ---- OPAL_DECL ShapeData() { ! // The initial type doesn't matter since the abstract base // class will never be instantiated. mType = SPHERE_SHAPE; *************** *** 69,74 **** } ! /// Returns the axis-aligned bounding box of the ShapeData relative ! /// to its center. The 'aabb' array stores data in the following /// order: min x, max x, min y, max y, min z, max z. OPAL_DECL virtual void OPAL_CALL getLocalAABB(real aabb[6]) = 0; --- 71,76 ---- } ! /// Returns the axis-aligned bounding box of the ShapeData relative ! /// to its center. The 'aabb' array stores data in the following /// order: min x, max x, min y, max y, min z, max z. OPAL_DECL virtual void OPAL_CALL getLocalAABB(real aabb[6]) = 0; *************** *** 80,84 **** Material material; ! /// The Shape's contact group. If this exceeds 31, bad things /// might happen since there are only 32 groups. unsigned int contactGroup; --- 82,86 ---- Material material; ! /// The Shape's contact group. If this exceeds 31, bad things /// might happen since there are only 32 groups. unsigned int contactGroup; Index: SensorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SensorData.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SensorData.h 29 Mar 2005 03:05:46 -0000 1.11 --- SensorData.h 30 Nov 2005 06:28:12 -0000 1.12 *************** *** 29,33 **** --- 29,35 ---- #define OPAL_SENSOR_DATA_H + // project headers #include "Defines.h" + #include "Matrix44r.h" namespace opal *************** *** 48,52 **** OPAL_DECL SensorData() { ! // The initial type doesn't matter since the abstract base // class will never be instantiated. mType = ACCELERATION_SENSOR; --- 50,54 ---- OPAL_DECL SensorData() { ! // The initial type doesn't matter since the abstract base // class will never be instantiated. mType = ACCELERATION_SENSOR; *************** *** 72,80 **** bool enabled; ! /// An identifier for the Sensor. 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 just positioned somewhere within the environment). Solid* solid; --- 74,82 ---- bool enabled; ! /// An identifier for the Sensor. 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 just positioned somewhere within the environment). Solid* solid; *************** *** 86,91 **** std::string solidBlueprintRefName; ! /// If the Sensor is attached to a Solid, this transform is the global ! /// offset from that Solid's transform. Otherwise, it is just the /// Sensor's global transform. Matrix44r transform; --- 88,93 ---- std::string solidBlueprintRefName; ! /// If the Sensor is attached to a Solid, this transform is the global ! /// offset from that Solid's transform. Otherwise, it is just the /// Sensor's global transform. Matrix44r transform; Index: Makefile.am =================================================================== RCS file: /cvsroot/opal/opal/src/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 21 Nov 2005 13:59:16 -0000 1.3 --- Makefile.am 30 Nov 2005 06:28:12 -0000 1.4 *************** *** 8,20 **** SUBDIRS = external ODE noinst_LIBRARIES = libopalode.a ! libopalode_a_SOURCES = AccelerationSensor.cpp AttractorMotor.cpp Blueprint.cpp\ ! BlueprintInstance.cpp BlueprintManager.cpp CollisionEventHandler.cpp\ ! GearedMotor.cpp InclineSensor.cpp Joint.cpp Logger.cpp Motor.cpp\ ! RaycastSensor.cpp Sensor.cpp ServoMotor.cpp Simulator.cpp Solid.cpp\ ! SolidData.cpp Space.cpp SpringMotor.cpp ThrusterMotor.cpp\ ! VolumeSensor.cpp bin_PROGRAMS = test_opal test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp test_opal_LDADD = $(top_builddir)/src/external/tinyxml/libtinyxml.a \ $(top_builddir)/src/ODE/libodeimpl.a $(top_builddir)/src/libopalode.a -lode --- 8,20 ---- SUBDIRS = external ODE noinst_LIBRARIES = libopalode.a ! libopalode_a_SOURCES = AccelerationSensor.cpp AttractorMotor.cpp Blueprint.cpp \ ! BlueprintInstance.cpp BlueprintManager.cpp CollisionEventHandler.cpp GearedMotor.cpp \ ! InclineSensor.cpp Joint.cpp Logger.cpp Motor.cpp RaycastSensor.cpp Sensor.cpp \ ! ServoMotor.cpp Simulator.cpp Solid.cpp SolidData.cpp Space.cpp SpringMotor.cpp \ ! ThrusterMotor.cpp VolumeSensor.cpp Vec3r.cpp bin_PROGRAMS = test_opal test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp test_opal_LDADD = $(top_builddir)/src/external/tinyxml/libtinyxml.a \ $(top_builddir)/src/ODE/libodeimpl.a $(top_builddir)/src/libopalode.a -lode + noinst_HEADERS = Mass.h Matrix33r.h Index: Vec3r.h =================================================================== RCS file: /cvsroot/opal/opal/src/Vec3r.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Vec3r.h 27 Apr 2005 02:28:18 -0000 1.17 --- Vec3r.h 30 Nov 2005 06:28:12 -0000 1.18 *************** *** 1,317 **** /************************************************************************* ! * * ! * 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_VEC3R_H #define OPAL_VEC3R_H #include "OpalMath.h" namespace opal { ! class Vec3r; ! inline Vec3r operator+(const Vec3r &u, const Vec3r &v); ! inline Vec3r operator-(const Vec3r &u, const Vec3r &v); ! inline Vec3r operator*(const Vec3r &v, real scalar); ! inline Vec3r operator*(real scalar, const Vec3r &v); ! inline Vec3r operator/(const Vec3r &v, real scalar); ! inline Vec3r operator%(const Vec3r & a, const Vec3r & b); ! inline Vec3r operator-(const Vec3r &v); ! inline real dot(const Vec3r & u, const Vec3r & v); ! inline Vec3r cross(const Vec3r & u, const Vec3r& v); ! /// Returns the projection of 'v' onto 'u'. ! inline Vec3r project(const Vec3r& u, const Vec3r& v); ! /// Given that the vector 'u' is already a unit vector, returns the ! /// projection of v onto u. ! inline Vec3r projectPreNorm(const Vec3r& u, const Vec3r& v); ! /// Returns a positive angle between 0 and 180 degrees. ! inline real angleBetween(const Vec3r& u, const Vec3r& v); ! /// Given that the vectors 'u' and 'v' are already normalized, returns ! /// a positive angle between 0 and 180 degrees. ! inline real angleBetweenPreNorm(const Vec3r& u, const Vec3r& v); ! /// Returns true if the two vectors are roughly collinear. ! inline bool areCollinear(const Vec3r& u, const Vec3r& v); ! /// Prints the Vec3r to the given output stream. ! inline std::ostream& operator<<(std::ostream& o, const Vec3r& v); ! class Vec3r ! { ! private: ! real mData[3]; ! public: ! Vec3r() ! { ! mData[0] = 0; ! mData[1] = 0; ! mData[2] = 0; ! } ! Vec3r(const Vec3r & src) ! { ! mData[0] = src.mData[0]; ! mData[1] = src.mData[1]; ! mData[2] = src.mData[2]; ! } ! Vec3r(real x, real y, real z) ! { ! mData[0] = x; ! mData[1] = y; ! mData[2] = z; ! } ! Vec3r(const real * data) ! { ! mData[0] = data[0]; ! mData[1] = data[1]; ! mData[2] = data[2]; ! } ! inline void set(real x, real y, real z) ! { ! mData[0] = x; ! mData[1] = y; ! mData[2] = z; ! } ! ! inline void set(real * data) ! { ! mData[0] = data[0]; ! mData[1] = data[1]; ! mData[2] = data[2]; ! } ! inline real * getData() ! { ! return mData; ! } ! inline const real * getData()const ! { ! return mData; ! } ! inline real & operator[](unsigned int i) ! { ! assert(i < 3); ! return mData[i]; ! } ! inline const real & operator[](unsigned int i)const ! { ! assert(i < 3); ! return mData[i]; ! } ! inline real lengthSquared()const ! { ! return dot(*this, *this); ! } ! inline real length()const ! { ! return sqrt(dot(*this, *this)); ! } ! inline void normalize() ! { ! real len = length(); ! assert(0 != len); ! real factor = (real)1.0 / len; ! (*this) *= factor; ! } ! inline Vec3r unit()const ! { ! return (*this) / length(); ! } ! inline void operator+=(const Vec3r & v) ! { ! mData[0] += v.mData[0]; ! mData[1] += v.mData[1]; ! mData[2] += v.mData[2]; ! } ! inline void operator-=(const Vec3r & v) ! { ! mData[0] -= v.mData[0]; ! mData[1] -= v.mData[1]; ! mData[2] -= v.mData[2]; ! } ! inline void operator*=(const Vec3r & v) ! { ! mData[0] *= v.mData[0]; ! mData[1] *= v.mData[1]; ! mData[2] *= v.mData[2]; ! } ! inline void operator*=(real scalar) ! { ! mData[0] *= scalar; ! mData[1] *= scalar; ! mData[2] *= scalar; ! } ! inline void operator/=(real scalar) ! { ! mData[0] /= scalar; ! mData[1] /= scalar; ! mData[2] /= scalar; ! } ! inline void operator/=(const Vec3r & v) ! { ! mData[0] /= v.mData[0]; ! mData[1] /= v.mData[1]; ! mData[2] /= v.mData[2]; ! } ! inline bool operator==(const Vec3r & v) ! { ! return(mData[0]==v.mData[0] && mData[1]==v.mData[1] && ! v.mData[2]==mData[2]); ! } ! inline bool operator!=(const Vec3r & v) ! { ! return(mData[0]!=v.mData[0] && mData[1]!=v.mData[1] && ! v.mData[2]!=mData[2]); ! } ! }; ! inline Vec3r operator+(const Vec3r &u, const Vec3r &v) ! { ! return Vec3r(u[0] + v[0], u[1] + v[1], u[2] + v[2]); ! } ! inline Vec3r operator-(const Vec3r &u, const Vec3r &v) ! { ! return Vec3r(u[0] - v[0], u[1] - v[1], u[2] - v[2]); ! } ! inline Vec3r operator*(const Vec3r &v, real scalar) ! { ! return Vec3r(scalar * v[0], scalar * v[1], scalar * v[2]); ! } ! inline Vec3r operator*(real scalar, const Vec3r &v) ! { ! return Vec3r(scalar * v[0], scalar * v[1], scalar * v[2]); ! } ! inline Vec3r operator/(const Vec3r &v, real scalar) ! { ! return Vec3r(v[0] / scalar, v[1] / scalar, v[2] / scalar); ! } ! inline Vec3r operator%(const Vec3r & a, const Vec3r & b) ! { ! return Vec3r((a[1]*b[2]) - (a[2]*b[1]), (a[2]*b[0]) - (a[0]*b[2]), ! (a[0]*b[1]) - (a[1]*b[0])); ! } ! inline real dot(const Vec3r & u, const Vec3r & v) ! { ! return u[0] * v[0] + u[1] * v[1] + u[2] * v[2]; ! } ! inline Vec3r cross(const Vec3r & u, const Vec3r & v) ! { ! return u%v; ! } ! inline Vec3r operator-(const Vec3r &v) ! { ! return v * -1; ! } ! inline Vec3r project(const Vec3r& u, const Vec3r& v) ! { ! Vec3r u2 = u; ! u2.normalize(); ! return projectPreNorm(u2, v); ! } ! inline Vec3r projectPreNorm(const Vec3r& u, const Vec3r& v) ! { ! return dot(u, v) * u; ! } ! inline real angleBetween(const Vec3r& u, const Vec3r& v) ! { ! Vec3r u2 = u; ! u2.normalize(); ! Vec3r v2 = v; ! v2.normalize(); ! return angleBetweenPreNorm(u2, v2); ! } ! inline real angleBetweenPreNorm(const Vec3r& u, const Vec3r& v) ! { ! real val = dot(u, v); ! // Clamp to avoid rounding errors; acos will puke with values outside ! // this range. ! if (val < -1) ! { ! val = -1; ! } ! else if (val > 1) ! { ! val = 1; ! } ! return radToDeg(acos(val)); ! } ! inline bool areCollinear(const Vec3r& u, const Vec3r& v) ! { ! real value = 1 - dot(u, v); ! if (areEqual(value, 0)) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! inline std::ostream& operator<<(std::ostream& o, const Vec3r& v) ! { ! return o << "[" << v[0] << " " << v[1] << " " << v[2] << "]"; ! } } --- 1,216 ---- /************************************************************************* ! * * ! * 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_VEC3R_H #define OPAL_VEC3R_H + // project headers #include "OpalMath.h" + // system headers + #include <iostream> + namespace opal { ! class Vec3r; ! inline Vec3r operator+( const Vec3r &u, const Vec3r &v ); ! inline Vec3r operator-( const Vec3r &u, const Vec3r &v ); ! inline Vec3r operator*( const Vec3r &v, real scalar ); ! inline Vec3r operator*( real scalar, const Vec3r &v ); ! inline Vec3r operator/( const Vec3r &v, real scalar ); ! inline Vec3r operator%( const Vec3r & a, const Vec3r & b ); ! inline Vec3r operator-( const Vec3r &v ); ! inline real dot( const Vec3r & u, const Vec3r & v ); ! inline Vec3r cross( const Vec3r & u, const Vec3r& v ); ! /// Returns the projection of 'v' onto 'u'. ! inline Vec3r project( const Vec3r& u, const Vec3r& v ); ! /// Given that the vector 'u' is already a unit vector, returns the ! /// projection of v onto u. ! inline Vec3r projectPreNorm( const Vec3r& u, const Vec3r& v ); ! /// Returns a positive angle between 0 and 180 degrees. ! inline real angleBetween( const Vec3r& u, const Vec3r& v ); ! /// Given that the vectors 'u' and 'v' are already normalized, returns ! /// a positive angle between 0 and 180 degrees. ! inline real angleBetweenPreNorm( const Vec3r& u, const Vec3r& v ); ! /// Returns true if the two vectors are roughly collinear. ! bool areCollinear( const Vec3r& u, const Vec3r& v ); ! /// Prints the Vec3r to the given output stream. ! inline std::ostream& operator<<( std::ostream& o, const Vec3r& v ); ! class Vec3r ! { ! public: ! /// x-coordinate ! real x; ! /// y-coordinate ! real y; ! /// z-coordinate ! real z; ! /// default - (0,0,0) ! Vec3r(); ! Vec3r( const Vec3r & src ); ! Vec3r( real xx, real yy, real zz ); ! Vec3r( const real * data ); ! void set( real xx, real yy, real zz ); ! void set( real * data ); ! real & operator[] ( unsigned int i ); ! const real & operator[] ( unsigned int i ) const; ! real lengthSquared() const; ! real length() const; ! void normalize(); ! Vec3r unit() const; ! void operator+=( const Vec3r & v ); ! void operator-=( const Vec3r & v ); ! void operator*=( const Vec3r & v ); ! void operator*=( real scalar ); ! void operator/=( real scalar ); ! void operator/=( const Vec3r & v ); ! bool operator==( const Vec3r & v ); ! bool operator!=( const Vec3r & v ); ! void operator=( const Vec3r & v ); ! }; ! inline Vec3r operator+( const Vec3r &u, const Vec3r &v ) ! { ! return Vec3r( u.x + v.x, u.y + v.y, u.z + v.z ); ! } ! inline Vec3r operator-( const Vec3r &u, const Vec3r &v ) ! { ! return Vec3r( u.x - v.x, u.y - v.y, u.z - v.z ); ! } ! inline Vec3r operator*( const Vec3r &v, real scalar ) ! { ! return Vec3r( scalar * v.x, scalar * v.y, scalar * v.z ); ! } ! inline Vec3r operator*( real scalar, const Vec3r &v ) ! { ! return Vec3r( scalar * v.x, scalar * v.y, scalar * v.z ); ! } ! inline Vec3r operator/( const Vec3r &v, real scalar ) ! { ! return Vec3r( v.x / scalar, v.y / scalar, v.z / scalar ); ! } ! inline Vec3r operator%( const Vec3r & a, const Vec3r & b ) ! { ! return Vec3r( ( a.y * b.z ) - ( a.z * b.y ), ( a.z * b.x ) - ( a.x * b.z ), ! ( a.x * b.y ) - ( a.y * b.x ) ); ! } ! inline real dot( const Vec3r & u, const Vec3r & v ) ! { ! return u.x * v.x + u.y * v.y + u.z * v.z; ! } ! inline Vec3r cross( const Vec3r & u, const Vec3r & v ) ! { ! return u % v; ! } ! inline Vec3r operator-( const Vec3r &v ) ! { ! return v * -1; ! } ! inline Vec3r project( const Vec3r& u, const Vec3r& v ) ! { ! Vec3r u2 = u; ! u2.normalize(); ! return projectPreNorm( u2, v ); ! } ! inline Vec3r projectPreNorm( const Vec3r& u, const Vec3r& v ) ! { ! return dot( u, v ) * u; ! } ! inline real angleBetween( const Vec3r& u, const Vec3r& v ) ! { ! Vec3r u2 = u; ! u2.normalize(); ! Vec3r v2 = v; ! v2.normalize(); ! return angleBetweenPreNorm( u2, v2 ); ! } ! inline real angleBetweenPreNorm( const Vec3r& u, const Vec3r& v ) ! { ! real val = dot( u, v ); ! // Clamp to avoid rounding errors; acos will puke with values outside ! // this range. ! if ( val < -1 ) ! { ! val = -1; ! } ! else if ( val > 1 ) ! { ! val = 1; ! } ! return radToDeg( acos( val ) ); ! } ! ! inline std::ostream& operator<<( std::ostream& o, const Vec3r& v ) ! { ! return o << "[" << v.x << " " << v.y << " " << v.z << "]"; ! } } Index: Defines.h =================================================================== RCS file: /cvsroot/opal/opal/src/Defines.h,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** Defines.h 19 Apr 2005 14:20:35 -0000 1.77 --- Defines.h 30 Nov 2005 06:28:12 -0000 1.78 *************** *** 43,46 **** --- 43,48 ---- #include "Portability.h" #include "Logger.h" + #include "Vec3r.h" + #include "Point3r.h" /// The main namespace that contains everything in OPAL. *************** *** 50,95 **** class Joint; ! /// Types of Forces. Used when creating a Force struct to designate /// how the Forces should be applied to a Solid. enum ForceType { ! /// Apply a force in a direction relative to the Solid's local /// coordinate system. LOCAL_FORCE, ! /// Apply a force in a direction relative to the global /// coordinate system. GLOBAL_FORCE, ! /// Apply a torque with the axis specified relative to the Solid's /// local coordinate system. LOCAL_TORQUE, ! /// Apply a torque with the axis specified relative to global /// coordinate system. GLOBAL_TORQUE, ! /// Apply a force at a position relative to the Solid's local ! /// coordinate system in a direction relative to the Solid's local /// coordinate system. LOCAL_FORCE_AT_LOCAL_POS, ! /// Apply a force at a position relative to the global ! /// coordinate system in a direction relative to the Solid's local /// coordinate system. LOCAL_FORCE_AT_GLOBAL_POS, ! /// Apply a force at a position relative to the Solid's local ! /// coordinate system in a direction relative to the global /// coordinate system. GLOBAL_FORCE_AT_LOCAL_POS, ! /// Apply a force at a position relative to the global ! /// coordinate system in a direction relative to the global /// coordinate system. GLOBAL_FORCE_AT_GLOBAL_POS }; ! /// Data structure containing all necessary info for applying a /// force/torque to a Solid. struct Force --- 52,97 ---- class Joint; ! /// Types of Forces. Used when creating a Force struct to designate /// how the Forces should be applied to a Solid. enum ForceType { ! /// Apply a force in a direction relative to the Solid's local /// coordinate system. LOCAL_FORCE, ! /// Apply a force in a direction relative to the global /// coordinate system. GLOBAL_FORCE, ! /// Apply a torque with the axis specified relative to the Solid's /// local coordinate system. LOCAL_TORQUE, ! /// Apply a torque with the axis specified relative to global /// coordinate system. GLOBAL_TORQUE, ! /// Apply a force at a position relative to the Solid's local ! /// coordinate system in a direction relative to the Solid's local /// coordinate system. LOCAL_FORCE_AT_LOCAL_POS, ! /// Apply a force at a position relative to the global ! /// coordinate system in a direction relative to the Solid's local /// coordinate system. LOCAL_FORCE_AT_GLOBAL_POS, ! /// Apply a force at a position relative to the Solid's local ! /// coordinate system in a direction relative to the global /// coordinate system. GLOBAL_FORCE_AT_LOCAL_POS, ! /// Apply a force at a position relative to the global ! /// coordinate system in a direction relative to the global /// coordinate system. GLOBAL_FORCE_AT_GLOBAL_POS }; ! /// Data structure containing all necessary info for applying a /// force/torque to a Solid. struct Force *************** *** 107,130 **** ForceType type; ! /// Specifies how long to apply to force. This makes it easy to ! /// apply forces independent of the step size. This will be ignored /// if "singleStep" is true. real duration; ! /// This is mainly used internally by OPAL. It specifies that ! /// the force will be applied across a single time step. If this /// parameter is true, "duration" will be ignored. bool singleStep; ! /// The force direction or torque axis. This parameter encodes the /// magnitude of the force or torque. Vec3r vec; ! /// Only used when the force is applied at an offset (i.e. not /// the center of mass). Point3r pos; }; ! /// Data structure describing material properties. These properties /// determine the collision response when two Solids collide. struct Material --- 109,132 ---- ForceType type; ! /// Specifies how long to apply to force. This makes it easy to ! /// apply forces independent of the step size. This will be ignored /// if "singleStep" is true. real duration; ! /// This is mainly used internally by OPAL. It specifies that ! /// the force will be applied across a single time step. If this /// parameter is true, "duration" will be ignored. bool singleStep; ! /// The force direction or torque axis. This parameter encodes the /// magnitude of the force or torque. Vec3r vec; ! /// Only used when the force is applied at an offset (i.e. not /// the center of mass). Point3r pos; }; ! /// Data structure describing material properties. These properties /// determine the collision response when two Solids collide. struct Material *************** *** 151,155 **** } ! /// Determines how far Solids can interpenetrate. This must /// be between 0 and 1. real hardness; --- 153,157 ---- } ! /// Determines how far Solids can interpenetrate. This must /// be between 0 and 1. real hardness; *************** *** 158,175 **** real friction; ! /// Bounciness (i.e. restitution) determines how elastic the ! /// collisions will be between this Material and another. In other ! /// words, the more bounciness, the farther the Solids will bounce ! /// when they collide (and, in real life, the less energy is lost /// due to heat and sound). This must be between 0 and 1. real bounciness; ! /// Density combined with the volume of a Solid's shapes determine /// the Solid's mass. This must be >= 0. real density; }; ! /// Solver accuracy levels determine how the physics engine constraint ! /// solver is used (e.g. the number of iterations in an iterative /// solver). enum SolverAccuracyLevel --- 160,177 ---- real friction; ! /// Bounciness (i.e. restitution) determines how elastic the ! /// collisions will be between this Material and another. In other ! /// words, the more bounciness, the farther the Solids will bounce ! /// when they collide (and, in real life, the less energy is lost /// due to heat and sound). This must be between 0 and 1. real bounciness; ! /// Density combined with the volume of a Solid's shapes determine /// the Solid's mass. This must be >= 0. real density; }; ! /// Solver accuracy levels determine how the physics engine constraint ! /// solver is used (e.g. the number of iterations in an iterative /// solver). enum SolverAccuracyLevel *************** *** 182,186 **** }; ! /// Joints use different break modes to determine how they are damaged /// from stress. enum JointBreakMode --- 184,188 ---- }; ! /// Joints use different break modes to determine how they are damaged /// from stress. enum JointBreakMode *************** *** 239,243 **** namespace globals { ! /// The highest value that can be used for the Simulator's /// max contacts parameter. const int maxMaxContacts=(int)128; --- 241,245 ---- namespace globals { ! /// The highest value that can be used for the Simulator's /// max contacts parameter. const int maxMaxContacts=(int)128; *************** *** 266,276 **** // Global materials ! const Material metalM... [truncated message content] |