opal-commits Mailing List for Open Physics Abstraction Layer (Page 4)
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: Olex <ole...@us...> - 2005-12-15 05:09:15
|
Update of /cvsroot/opal/opal/scripts/kdevelop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13249/scripts/kdevelop Modified Files: opal.kdevelop Log Message: Added unit tests for VolumeSensor and Joint. Found a bug with CCylinder+VolumeSensor+MeshSolid. Extra asserts in ODESimulator. Index: opal.kdevelop =================================================================== RCS file: /cvsroot/opal/opal/scripts/kdevelop/opal.kdevelop,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** opal.kdevelop 10 Dec 2005 22:41:06 -0000 1.3 --- opal.kdevelop 15 Dec 2005 05:08:58 -0000 1.4 *************** *** 3,7 **** <general> <author>Oleksandr Lozitskiy</author> ! <email/> <version>0.4.0</version> <projectmanagement>KDevAutoProject</projectmanagement> --- 3,7 ---- <general> <author>Oleksandr Lozitskiy</author> ! <email></email> <version>0.4.0</version> <projectmanagement>KDevAutoProject</projectmanagement> *************** *** 14,18 **** <projectdirectory>.</projectdirectory> <absoluteprojectpath>false</absoluteprojectpath> ! <description/> <versioncontrol/> </general> --- 14,18 ---- <projectdirectory>.</projectdirectory> <absoluteprojectpath>false</absoluteprojectpath> ! <description></description> <versioncontrol/> </general> *************** *** 52,63 **** <envvar value="ccache g++" name="CXX" /> </envvars> ! <topsourcedir/> <cppflags>-DOPAL_USE_DOUBLE</cppflags> <ldflags>-lode</ldflags> ! <ccompilerbinary/> ! <cxxcompilerbinary/> ! <f77compilerbinary/> ! <cflags/> ! <f77flags/> </debug> </configurations> --- 52,63 ---- <envvar value="ccache g++" name="CXX" /> </envvars> ! <topsourcedir></topsourcedir> <cppflags>-DOPAL_USE_DOUBLE</cppflags> <ldflags>-lode</ldflags> ! <ccompilerbinary></ccompilerbinary> ! <cxxcompilerbinary></cxxcompilerbinary> ! <f77compilerbinary></f77compilerbinary> ! <cflags></cflags> ! <f77flags></f77flags> </debug> </configurations> *************** *** 174,178 **** </codecompletion> <creategettersetter> ! <prefixGet/> <prefixSet>set</prefixSet> <prefixVariable>m_,_</prefixVariable> --- 174,178 ---- </codecompletion> <creategettersetter> ! <prefixGet></prefixGet> <prefixSet>set</prefixSet> <prefixVariable>m_,_</prefixVariable> *************** *** 195,204 **** <kdevdebugger> <general> ! <programargs/> ! <gdbpath/> ! <dbgshell/> ! <configGdbScript/> ! <runShellScript/> ! <runGdbScript/> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> --- 195,204 ---- <kdevdebugger> <general> ! <programargs></programargs> ! <gdbpath></gdbpath> ! <dbgshell></dbgshell> ! <configGdbScript></configGdbScript> ! <runShellScript></runShellScript> ! <runGdbScript></runGdbScript> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> |
From: Olex <ole...@us...> - 2005-12-15 05:09:14
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13249/src Modified Files: Makefile.am Makefile.in testJoint.cpp testopal.cpp Log Message: Added unit tests for VolumeSensor and Joint. Found a bug with CCylinder+VolumeSensor+MeshSolid. Extra asserts in ODESimulator. Index: Makefile.in =================================================================== RCS file: /cvsroot/opal/opal/src/Makefile.in,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile.in 10 Dec 2005 22:41:06 -0000 1.11 --- Makefile.in 15 Dec 2005 05:08:59 -0000 1.12 *************** *** 74,78 **** testMatrix44r.$(OBJEXT) testBlueprint.$(OBJEXT) \ testMath.$(OBJEXT) testVelocityMotor.$(OBJEXT) \ ! testFixedJoint.$(OBJEXT) testJoint.$(OBJEXT) test_opal_OBJECTS = $(am_test_opal_OBJECTS) test_opal_DEPENDENCIES = \ --- 74,79 ---- testMatrix44r.$(OBJEXT) testBlueprint.$(OBJEXT) \ testMath.$(OBJEXT) testVelocityMotor.$(OBJEXT) \ ! testFixedJoint.$(OBJEXT) testJoint.$(OBJEXT) \ ! testVolumeSensor.$(OBJEXT) test_opal_OBJECTS = $(am_test_opal_OBJECTS) test_opal_DEPENDENCIES = \ *************** *** 216,222 **** test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.cpp testMath.cpp testVelocityMotor.cpp testFixedJoint.cpp \ ! testJoint.cpp test_opal_LDADD = $(top_builddir)/src/external/tinyxml/libtinyxml.a \ --- 217,223 ---- test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.cpp testMath.cpp testVelocityMotor.cpp testFixedJoint.cpp \ ! testJoint.cpp testVolumeSensor.cpp test_opal_LDADD = $(top_builddir)/src/external/tinyxml/libtinyxml.a \ *************** *** 338,341 **** --- 339,343 ---- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testVec3r.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testVelocityMotor.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testVolumeSensor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsolid.Po@am__quote@ Index: Makefile.am =================================================================== RCS file: /cvsroot/opal/opal/src/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile.am 10 Dec 2005 22:41:06 -0000 1.11 --- Makefile.am 15 Dec 2005 05:08:59 -0000 1.12 *************** *** 15,21 **** bin_PROGRAMS = test_opal test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.cpp testMath.cpp testVelocityMotor.cpp testFixedJoint.cpp \ ! testJoint.cpp test_opal_LDADD = $(top_builddir)/src/external/tinyxml/libtinyxml.a \ $(top_builddir)/src/ODE/libodeimpl.a $(top_builddir)/src/libopalode.a -lode --- 15,21 ---- bin_PROGRAMS = test_opal test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.cpp testMath.cpp testVelocityMotor.cpp testFixedJoint.cpp \ ! testJoint.cpp testVolumeSensor.cpp test_opal_LDADD = $(top_builddir)/src/external/tinyxml/libtinyxml.a \ $(top_builddir)/src/ODE/libodeimpl.a $(top_builddir)/src/libopalode.a -lode Index: testJoint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/testJoint.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testJoint.cpp 12 Dec 2005 00:35:13 -0000 1.2 --- testJoint.cpp 15 Dec 2005 05:08:59 -0000 1.3 *************** *** 38,57 **** namespace testJoint { ! QT_TEST( setContacts ) ! { ! Simulator * sim = createSimulator(); Joint * j = sim->createJoint(); JointData data; ! data.contactsEnabled = false; j->init( data ); ! QT_CHECK_EQUAL( j->areContactsEnabled(), false ); ! data.contactsEnabled = true; ! j->init( data ); ! QT_CHECK_EQUAL( j->areContactsEnabled(), true ); sim->destroy(); ! } QT_TEST( break_settings ) --- 38,141 ---- namespace testJoint { ! class TwoSpheresFixture ! { ! public: ! TwoSpheresFixture() ! { ! sim = createSimulator(); ! sim->createSolid(); ! s0 = sim->createSolid(); ! s1 = sim->createSolid(); ! { ! SphereShapeData data; ! data.radius = 1; ! s0->addShape( data ); ! s1->addShape( data ); ! } ! ! s0->setPosition( 0, 0, 0 ); ! s1->setPosition( 0, 0, 10 ); ! ! j = sim->createJoint(); ! { ! JointData data; ! data.setType( FIXED_JOINT ); ! data.solid0 = s0; ! data.solid1 = s1; ! j->init( data ); ! } ! } ! ! ~TwoSpheresFixture() ! { ! sim->destroyJoint( j ); ! sim->destroySolid( s0 ); ! sim->destroySolid( s1 ); ! sim->destroy(); ! } ! ! Simulator * sim; ! Solid * s0; ! Solid * s1; ! Joint * j; ! }; ! ! QT_TEST( wakeSolids ) ! { ! TwoSpheresFixture f; ! ! f.s0->setStatic( false ); ! f.s1->setStatic( false ); ! f.s0->setSleeping( true ); ! f.s1->setSleeping( true ); ! ! f.j->wakeSolids(); ! QT_CHECK_EQUAL( f.s0->isSleeping(), false ); ! QT_CHECK_EQUAL( f.s1->isSleeping(), false ); ! ! f.s0->setStatic( true ); ! f.s1->setStatic( false ); ! f.s0->setSleeping( true ); ! f.s1->setSleeping( true ); ! ! f.j->wakeSolids(); ! QT_CHECK_EQUAL( f.s0->isSleeping(), true ); ! QT_CHECK_EQUAL( f.s1->isSleeping(), false ); ! ! f.s0->setStatic( false ); ! f.s1->setStatic( true ); ! f.s0->setSleeping( true ); ! f.s1->setSleeping( true ); ! ! f.j->wakeSolids(); ! QT_CHECK_EQUAL( f.s0->isSleeping(), false ); ! QT_CHECK_EQUAL( f.s1->isSleeping(), true ); ! ! f.s0->setStatic( true ); ! f.s1->setStatic( true ); ! f.s0->setSleeping( true ); ! f.s1->setSleeping( true ); ! ! f.j->wakeSolids(); ! QT_CHECK_EQUAL( f.s0->isSleeping(), true ); ! QT_CHECK_EQUAL( f.s1->isSleeping(), true ); ! } ! ! QT_TEST( setContacts ) ! { ! Simulator * sim = createSimulator(); Joint * j = sim->createJoint(); JointData data; ! data.contactsEnabled = false; j->init( data ); ! QT_CHECK_EQUAL( j->areContactsEnabled(), false ); ! data.contactsEnabled = true; ! j->init( data ); ! QT_CHECK_EQUAL( j->areContactsEnabled(), true ); sim->destroy(); ! } QT_TEST( break_settings ) *************** *** 70,74 **** { Simulator * sim = createSimulator(); ! Solid * s0 = sim->createSolid(); s0->setPosition( 0, 0, 0 ); --- 154,158 ---- { Simulator * sim = createSimulator(); ! Solid * s0 = sim->createSolid(); s0->setPosition( 0, 0, 0 ); Index: testopal.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/testopal.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testopal.cpp 12 Dec 2005 00:35:13 -0000 1.2 --- testopal.cpp 15 Dec 2005 05:08:59 -0000 1.3 *************** *** 37,44 **** { QT_RUN_TESTS; - - cout << "Type any letter and then Enter to quit." << endl; - - string temp; - cin >> temp; } --- 37,39 ---- |
From: Olex <ole...@us...> - 2005-12-15 05:09:14
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13249/src/ODE Modified Files: ODESimulator.cpp ODESolid.cpp Log Message: Added unit tests for VolumeSensor and Joint. Found a bug with CCylinder+VolumeSensor+MeshSolid. Extra asserts in ODESimulator. Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** ODESimulator.cpp 12 Dec 2005 06:13:25 -0000 1.110 --- ODESimulator.cpp 15 Dec 2005 05:08:59 -0000 1.111 *************** *** 855,860 **** // Get pointers to the two geoms' GeomData structure. Both // of these should always be non-NULL. ! GeomData* geomData0 = ( ( GeomData* ) dGeomGetData( o0 ) ); ! GeomData* geomData1 = ( ( GeomData* ) dGeomGetData( o1 ) ); // Get pointers to the geoms' ShapeData structures. --- 855,862 ---- // Get pointers to the two geoms' GeomData structure. Both // of these should always be non-NULL. ! const GeomData* geomData0 = ( ( GeomData* ) dGeomGetData( o0 ) ); ! const GeomData* geomData1 = ( ( GeomData* ) dGeomGetData( o1 ) ); ! assert( geomData0 != NULL ); ! assert( geomData1 != NULL ); // Get pointers to the geoms' ShapeData structures. Index: ODESolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESolid.cpp,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** ODESolid.cpp 1 Dec 2005 02:04:54 -0000 1.93 --- ODESolid.cpp 15 Dec 2005 05:08:59 -0000 1.94 *************** *** 80,83 **** --- 80,84 ---- destroyGeoms(); resetAABB(); + mData.destroyShapes(); } |
From: Olex <ole...@us...> - 2005-12-15 05:09:12
|
Update of /cvsroot/opal/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13249 Modified Files: changelog.txt Log Message: Added unit tests for VolumeSensor and Joint. Found a bug with CCylinder+VolumeSensor+MeshSolid. Extra asserts in ODESimulator. Index: changelog.txt =================================================================== RCS file: /cvsroot/opal/opal/changelog.txt,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** changelog.txt 12 Dec 2005 06:13:25 -0000 1.65 --- changelog.txt 15 Dec 2005 05:08:57 -0000 1.66 *************** *** 15,18 **** --- 15,21 ---- ------------------------------------------ + * 12-15-05: Added unit tests for VolumeSensor and Joint. Found a bug with + CCylinder+VolumeSensor+MeshSolid. (Oleksandr Lozitskiy) + * 12-12-05: Rolled back incorrect changes in ODESimulator. (Oleksandr Lozitskiy) |
From: Olex <ole...@us...> - 2005-12-12 06:13:33
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19257/src/ODE Modified Files: ODESimulator.cpp Log Message: Rolled back incorrect changes in ODESimulator. Adjusted unit tests for this case. Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** ODESimulator.cpp 11 Dec 2005 21:03:49 -0000 1.109 --- ODESimulator.cpp 12 Dec 2005 06:13:25 -0000 1.110 *************** *** 435,443 **** shape0->contactGroup, shape1->contactGroup ); - if ( !makeContacts ) - { - return; - } - // Find out whether the Simulator has static-to-sleeping // contacts disabled. --- 435,438 ---- |
From: Olex <ole...@us...> - 2005-12-12 06:13:33
|
Update of /cvsroot/opal/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19257 Modified Files: changelog.txt Log Message: Rolled back incorrect changes in ODESimulator. Adjusted unit tests for this case. Index: changelog.txt =================================================================== RCS file: /cvsroot/opal/opal/changelog.txt,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** changelog.txt 12 Dec 2005 00:35:13 -0000 1.64 --- changelog.txt 12 Dec 2005 06:13:25 -0000 1.65 *************** *** 15,18 **** --- 15,20 ---- ------------------------------------------ + * 12-12-05: Rolled back incorrect changes in ODESimulator. (Oleksandr Lozitskiy) + * 12-11-05: Enhancing BlueprintInstance. Added new unit tests. (Oleksandr Lozitskiy) |
From: Olex <ole...@us...> - 2005-12-12 06:13:33
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19257/src Modified Files: testsolid.cpp Log Message: Rolled back incorrect changes in ODESimulator. Adjusted unit tests for this case. Index: testsolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/testsolid.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** testsolid.cpp 12 Dec 2005 00:35:13 -0000 1.9 --- testsolid.cpp 12 Dec 2005 06:13:25 -0000 1.10 *************** *** 251,338 **** } ! class TwoSolidFixture ! { ! public: ! TwoSolidFixture() ! { ! sim = createSimulator(); ! s0 = sim->createSolid(); ! s1 = sim->createSolid(); ! } ! ~TwoSolidFixture() ! { ! sim->destroy(); ! } ! Simulator * sim; ! Solid * s0; ! Solid * s1; ! }; ! class MockCollision : public CollisionEventHandler ! { ! public: ! MockCollision() ! { ! calls = 0; ! } ! void OPAL_CALL handleCollisionEvent( const CollisionEvent & e ) ! { ! ++calls; ! } ! int calls; ! }; ! QT_TEST( same_contact_group_no_collision ) ! { ! TwoSolidFixture f; ! { ! SphereShapeData data; ! data.radius = 1; ! data.contactGroup = 1; ! f.s0->addShape( data ); ! f.s1->addShape( data ); ! } ! MockCollision * c = new MockCollision( ); ! f.s0->setCollisionEventHandler( c ); ! f.s1->setCollisionEventHandler( c ); ! f.s0->setPosition( 0, 0, 0 ); ! f.s1->setPosition( 0, 0, 0 ); ! f.sim->setupContactGroups( 1, 1, false ); ! c->calls = 0; ! f.sim->simulate( 1 ); ! QT_CHECK_EQUAL( c->calls, 0 ); ! } ! QT_TEST( same_contact_group_with_collision ) ! { ! TwoSolidFixture f; ! { ! SphereShapeData data; ! data.radius = 1; ! data.contactGroup = 1; ! f.s0->addShape( data ); ! f.s1->addShape( data ); ! } ! MockCollision * c = new MockCollision( ); ! f.s0->setCollisionEventHandler( c ); ! f.s1->setCollisionEventHandler( c ); ! f.s0->setPosition( 0, 0, 0 ); ! f.s1->setPosition( 0, 0, 0 ); ! f.sim->setupContactGroups( 1, 1, true ); ! c->calls = 0; ! f.sim->simulate( 1 ); ! QT_CHECK_GREATER( c->calls, 0 ); ! } } --- 251,344 ---- } ! class TwoSolidFixture ! { ! public: ! TwoSolidFixture() ! { ! sim = createSimulator(); ! s0 = sim->createSolid(); ! s1 = sim->createSolid(); ! } ! ~TwoSolidFixture() ! { ! sim->destroy(); ! } ! Simulator * sim; ! Solid * s0; ! Solid * s1; ! }; ! class MockCollision : public CollisionEventHandler ! { ! public: ! MockCollision() ! { ! calls = 0; ! } ! void OPAL_CALL handleCollisionEvent( const CollisionEvent & e ) ! { ! ++calls; ! } ! int calls; ! }; ! QT_TEST( same_contact_group_no_collision_but_events ) ! { ! TwoSolidFixture f; ! { ! SphereShapeData data; ! data.radius = 1; ! data.contactGroup = 1; ! f.s0->addShape( data ); ! f.s1->addShape( data ); ! } ! MockCollision * c = new MockCollision( ); ! f.s0->setCollisionEventHandler( c ); ! f.s1->setCollisionEventHandler( c ); ! f.s0->setPosition( 0, 0, 0 ); ! f.s1->setPosition( 0, 0, 0 ); ! f.sim->setupContactGroups( 1, 1, false ); ! c->calls = 0; ! f.sim->simulate( 1 ); ! QT_CHECK_EQUAL( f.s0->getPosition(), Point3r( 0, 0, 0 ) ); ! QT_CHECK_EQUAL( f.s1->getPosition(), Point3r( 0, 0, 0 ) ); ! QT_CHECK_GREATER( c->calls, 0 ); ! } ! QT_TEST( same_contact_group_with_collision_and_events ) ! { ! TwoSolidFixture f; ! { ! SphereShapeData data; ! data.radius = 1; ! data.contactGroup = 1; ! f.s0->addShape( data ); ! f.s1->addShape( data ); ! } ! MockCollision * c = new MockCollision( ); ! f.s0->setCollisionEventHandler( c ); ! f.s1->setCollisionEventHandler( c ); ! f.s0->setPosition( 0, 0, 0 ); ! f.s1->setPosition( 0, 0, 0 ); ! f.sim->setupContactGroups( 1, 1, true ); ! c->calls = 0; ! f.sim->simulate( 1 ); ! ! QT_CHECK_NOT_EQUAL( f.s0->getPosition(), Point3r( 0, 0, 0 ) ); ! QT_CHECK_NOT_EQUAL( f.s1->getPosition(), Point3r( 0, 0, 0 ) ); ! ! QT_CHECK_GREATER( c->calls, 0 ); ! } } |
From: Olex <ole...@us...> - 2005-12-12 00:35:21
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26526/src Modified Files: BlueprintInstance.cpp BlueprintInstance.h testBlueprint.cpp testJoint.cpp testopal.cpp testsolid.cpp Log Message: Enhancing BlueprintInstance. Added new unit tests. Index: testBlueprint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/testBlueprint.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testBlueprint.cpp 11 Dec 2005 04:43:05 -0000 1.2 --- testBlueprint.cpp 12 Dec 2005 00:35:13 -0000 1.3 *************** *** 38,41 **** --- 38,58 ---- namespace testBlueprint { + QT_TEST( manual_addition_solid ) + { + // solidmap seems to be corrups sometimes, let's test this + Simulator * sim = createSimulator(); + Solid * s = sim->createSolid(); + s->setName( "baba" ); + BlueprintInstance * b = new BlueprintInstance(); + b->internal_addSolid( s ); + + QT_CHECK_EQUAL( b->getSolid( "baba" ), s ); + QT_CHECK_EQUAL( b->getSolid( 0 ), s ); + + delete b; + + sim->destroy(); + } + QT_TEST( create_and_delete ) { *************** *** 58,69 **** { // Instantiate the Blueprint. ! BlueprintInstance instance; ! sim->instantiateBlueprint( instance, bp ); QT_CHECK_EQUAL( sim->getNumSolids(), 1 ); ! unsigned int nsolids = instance.getNumSolids(); for ( unsigned int i = 0; i < nsolids; ++i ) { ! sim->destroySolid( instance.getSolid( i ) ); } } --- 75,89 ---- { // Instantiate the Blueprint. ! BlueprintInstance * instance = new BlueprintInstance(); ! sim->instantiateBlueprint( *instance, bp ); QT_CHECK_EQUAL( sim->getNumSolids(), 1 ); ! unsigned int nsolids = instance->getNumSolids(); for ( unsigned int i = 0; i < nsolids; ++i ) { ! Solid * tobedetached = instance->getSolid( i ); ! sim->destroySolid( instance->detachSolid( tobedetached->getName() ) ); } + + delete instance; } Index: testopal.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/testopal.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testopal.cpp 6 Nov 2005 17:41:20 -0000 1.1 --- testopal.cpp 12 Dec 2005 00:35:13 -0000 1.2 *************** *** 28,35 **** --- 28,44 ---- // system headers + #include <iostream> #include <quicktest.h> + #include <string> + + using namespace std; int main( int argc, char* argv[] ) { QT_RUN_TESTS; + + cout << "Type any letter and then Enter to quit." << endl; + + string temp; + cin >> temp; } Index: testJoint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/testJoint.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testJoint.cpp 10 Dec 2005 22:41:06 -0000 1.1 --- testJoint.cpp 12 Dec 2005 00:35:13 -0000 1.2 *************** *** 38,41 **** --- 38,58 ---- namespace testJoint { + QT_TEST( setContacts ) + { + Simulator * sim = createSimulator(); + Joint * j = sim->createJoint(); + JointData data; + data.contactsEnabled = false; + + j->init( data ); + QT_CHECK_EQUAL( j->areContactsEnabled(), false ); + + data.contactsEnabled = true; + j->init( data ); + QT_CHECK_EQUAL( j->areContactsEnabled(), true ); + + sim->destroy(); + } + QT_TEST( break_settings ) { Index: testsolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/testsolid.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** testsolid.cpp 10 Dec 2005 22:41:06 -0000 1.8 --- testsolid.cpp 12 Dec 2005 00:35:13 -0000 1.9 *************** *** 250,252 **** --- 250,338 ---- f.sim->simulate( 1 ); } + + class TwoSolidFixture + { + public: + TwoSolidFixture() + { + sim = createSimulator(); + s0 = sim->createSolid(); + s1 = sim->createSolid(); + } + + ~TwoSolidFixture() + { + sim->destroy(); + } + + Simulator * sim; + Solid * s0; + Solid * s1; + }; + + class MockCollision : public CollisionEventHandler + { + public: + MockCollision() + { + calls = 0; + } + + void OPAL_CALL handleCollisionEvent( const CollisionEvent & e ) + { + ++calls; + } + + int calls; + }; + + QT_TEST( same_contact_group_no_collision ) + { + TwoSolidFixture f; + { + SphereShapeData data; + data.radius = 1; + data.contactGroup = 1; + f.s0->addShape( data ); + f.s1->addShape( data ); + } + MockCollision * c = new MockCollision( ); + f.s0->setCollisionEventHandler( c ); + f.s1->setCollisionEventHandler( c ); + + f.s0->setPosition( 0, 0, 0 ); + f.s1->setPosition( 0, 0, 0 ); + + f.sim->setupContactGroups( 1, 1, false ); + + c->calls = 0; + f.sim->simulate( 1 ); + + QT_CHECK_EQUAL( c->calls, 0 ); + } + + QT_TEST( same_contact_group_with_collision ) + { + TwoSolidFixture f; + { + SphereShapeData data; + data.radius = 1; + data.contactGroup = 1; + f.s0->addShape( data ); + f.s1->addShape( data ); + } + MockCollision * c = new MockCollision( ); + f.s0->setCollisionEventHandler( c ); + f.s1->setCollisionEventHandler( c ); + + f.s0->setPosition( 0, 0, 0 ); + f.s1->setPosition( 0, 0, 0 ); + + f.sim->setupContactGroups( 1, 1, true ); + + c->calls = 0; + f.sim->simulate( 1 ); + + QT_CHECK_GREATER( c->calls, 0 ); + } } Index: BlueprintInstance.h =================================================================== RCS file: /cvsroot/opal/opal/src/BlueprintInstance.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BlueprintInstance.h 31 Mar 2005 08:47:02 -0000 1.4 --- BlueprintInstance.h 12 Dec 2005 00:35:13 -0000 1.5 *************** *** 94,97 **** --- 94,118 ---- OPAL_DECL virtual Sensor* OPAL_CALL getSensor(unsigned int i)const; + //! Removes but does not delete the solid. + /*! + * @note make sure i is in the range of solid list + */ + OPAL_DECL virtual Solid * OPAL_CALL detachSolid( unsigned int i ); + + /// Detachs a Joint by index and returns its pointer. + OPAL_DECL virtual Joint* OPAL_CALL detachJoint(unsigned int i); + + /// Detachs a Motor by index and returns its pointer. + OPAL_DECL virtual Motor* OPAL_CALL detachMotor(unsigned int i); + + /// Detachs a Sensor by index and returns its pointer. + OPAL_DECL virtual Sensor* OPAL_CALL detachSensor(unsigned int i); + + //! Removes but does not delete the solid. + /*! + * @note make sure solid is stored here + */ + OPAL_DECL virtual Solid * OPAL_CALL detachSolid( const std::string & name ); + /// Adds a new Solid pointer to the list. If the pointer is /// non-NULL and the object's name is not an empty string, this Index: BlueprintInstance.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/BlueprintInstance.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BlueprintInstance.cpp 31 Mar 2005 08:47:02 -0000 1.4 --- BlueprintInstance.cpp 12 Dec 2005 00:35:13 -0000 1.5 *************** *** 26,30 **** --- 26,33 ---- *************************************************************************/ + // class headers #include "BlueprintInstance.h" + + // project headers #include "Solid.h" #include "Joint.h" *************** *** 32,39 **** --- 35,49 ---- #include "Sensor.h" + // system headers + #include <map> + #include <vector> + + using namespace std; + namespace opal { BlueprintInstance::BlueprintInstance() { + // nothing to do } *************** *** 51,57 **** } ! Solid* BlueprintInstance::getSolid(const std::string& name)const { ! std::map<std::string, Solid*>::const_iterator iter = mSolidMap.find(name); if (mSolidMap.end() == iter) --- 61,156 ---- } ! Solid * BlueprintInstance::detachSolid(unsigned int i) { ! assert( i < mSolidList.size() ); ! Solid * detached = mSolidList[i]; ! ! // detach from list ! mSolidList.erase( mSolidList.begin() + i ); ! ! // detach from map ! map<string, Solid*>::iterator iter = ! mSolidMap.find( detached->getName() ); ! mSolidMap.erase( iter ); ! ! return detached; ! } ! ! Joint * BlueprintInstance::detachJoint(unsigned int i) ! { ! assert( i < mJointList.size() ); ! Joint * detached = mJointList[i]; ! ! // detach from list ! mJointList.erase( mJointList.begin() + i ); ! ! // detach from map ! map<string, Joint*>::iterator iter = ! mJointMap.find( detached->getName() ); ! mJointMap.erase( iter ); ! ! return detached; ! } ! ! Sensor * BlueprintInstance::detachSensor(unsigned int i) ! { ! assert( i < mSensorList.size() ); ! Sensor * detached = mSensorList[i]; ! ! // detach from list ! mSensorList.erase( mSensorList.begin() + i ); ! ! // detach from map ! map<string, Sensor*>::iterator iter = ! mSensorMap.find( detached->getName() ); ! mSensorMap.erase( iter ); ! ! return detached; ! } ! ! Motor * BlueprintInstance::detachMotor(unsigned int i) ! { ! assert( i < mMotorList.size() ); ! Motor * detached = mMotorList[i]; ! ! // detach from list ! mMotorList.erase( mMotorList.begin() + i ); ! ! // detach from map ! map<string, Motor*>::iterator iter = ! mMotorMap.find( detached->getName() ); ! mMotorMap.erase( iter ); ! ! return detached; ! } ! ! Solid * BlueprintInstance::detachSolid( const string & name ) ! { ! map<string, Solid*>::iterator iter = ! mSolidMap.find( name ); ! Solid * detached = iter->second; ! ! // detach from list ! vector<Solid *>::iterator listIter; ! for ( listIter = mSolidList.begin(); ! listIter != mSolidList.end(); ! ++listIter ) ! { ! if ( ( *listIter )->getName() == name ) ! { ! mSolidList.erase( listIter ); ! break; ! } ! } ! ! // detach from map ! mSolidMap.erase( iter ); ! ! return detached; ! } ! ! Solid* BlueprintInstance::getSolid(const string& name)const ! { ! map<string, Solid*>::const_iterator iter = mSolidMap.find(name); if (mSolidMap.end() == iter) *************** *** 65,71 **** } ! Joint* BlueprintInstance::getJoint(const std::string& name)const { ! std::map<std::string, Joint*>::const_iterator iter = mJointMap.find(name); if (mJointMap.end() == iter) --- 164,170 ---- } ! Joint* BlueprintInstance::getJoint(const string& name)const { ! map<string, Joint*>::const_iterator iter = mJointMap.find(name); if (mJointMap.end() == iter) *************** *** 79,85 **** } ! Motor* BlueprintInstance::getMotor(const std::string& name)const { ! std::map<std::string, Motor*>::const_iterator iter = mMotorMap.find(name); if (mMotorMap.end() == iter) --- 178,184 ---- } ! Motor* BlueprintInstance::getMotor(const string& name)const { ! map<string, Motor*>::const_iterator iter = mMotorMap.find(name); if (mMotorMap.end() == iter) *************** *** 93,99 **** } ! Sensor* BlueprintInstance::getSensor(const std::string& name)const { ! std::map<std::string, Sensor*>::const_iterator iter = mSensorMap.find(name); if (mSensorMap.end() == iter) --- 192,198 ---- } ! Sensor* BlueprintInstance::getSensor(const string& name)const { ! map<string, Sensor*>::const_iterator iter = mSensorMap.find(name); if (mSensorMap.end() == iter) *************** *** 156,160 **** } ! std::string name = s->getName(); if (name.empty()) --- 255,259 ---- } ! string name = s->getName(); if (name.empty()) *************** *** 175,179 **** } ! std::string name = j->getName(); if (name.empty()) --- 274,278 ---- } ! string name = j->getName(); if (name.empty()) *************** *** 194,198 **** } ! std::string name = m->getName(); if (name.empty()) --- 293,297 ---- } ! string name = m->getName(); if (name.empty()) *************** *** 213,217 **** } ! std::string name = s->getName(); if (name.empty()) --- 312,316 ---- } ! string name = s->getName(); if (name.empty()) |
From: Olex <ole...@us...> - 2005-12-12 00:35:20
|
Update of /cvsroot/opal/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26526 Modified Files: changelog.txt Log Message: Enhancing BlueprintInstance. Added new unit tests. Index: changelog.txt =================================================================== RCS file: /cvsroot/opal/opal/changelog.txt,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** changelog.txt 11 Dec 2005 21:03:49 -0000 1.63 --- changelog.txt 12 Dec 2005 00:35:13 -0000 1.64 *************** *** 15,18 **** --- 15,20 ---- ------------------------------------------ + * 12-11-05: Enhancing BlueprintInstance. Added new unit tests. (Oleksandr Lozitskiy) + * 12-11-05: Fix in ODESimulator for contact groups. (Oleksandr Lozitskiy) |
From: Olex <ole...@us...> - 2005-12-11 21:03:57
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12260/src/ODE Modified Files: ODESimulator.cpp Log Message: Fix in ODESimulator for contact groups. Index: ODESimulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODESimulator.cpp,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** ODESimulator.cpp 26 Nov 2005 22:40:18 -0000 1.108 --- ODESimulator.cpp 11 Dec 2005 21:03:49 -0000 1.109 *************** *** 435,438 **** --- 435,443 ---- shape0->contactGroup, shape1->contactGroup ); + if ( !makeContacts ) + { + return; + } + // Find out whether the Simulator has static-to-sleeping // contacts disabled. |
From: Olex <ole...@us...> - 2005-12-11 21:03:57
|
Update of /cvsroot/opal/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12260 Modified Files: changelog.txt Log Message: Fix in ODESimulator for contact groups. Index: changelog.txt =================================================================== RCS file: /cvsroot/opal/opal/changelog.txt,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** changelog.txt 10 Dec 2005 22:41:06 -0000 1.62 --- changelog.txt 11 Dec 2005 21:03:49 -0000 1.63 *************** *** 15,18 **** --- 15,20 ---- ------------------------------------------ + * 12-11-05: Fix in ODESimulator for contact groups. (Oleksandr Lozitskiy) + * 12-10-05: Implemented features to track Joint damage. (Oleksandr Lozitskiy) |
From: Olex <ole...@us...> - 2005-12-11 05:17:36
|
Update of /cvsroot/opal/opal/scripts/vc71 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9354/scripts/vc71 Modified Files: opal-ode.vcproj opal.sln Log Message: Updated vc71 and vc8 project files. Index: opal-ode.vcproj =================================================================== RCS file: /cvsroot/opal/opal/scripts/vc71/opal-ode.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** opal-ode.vcproj 9 Dec 2005 17:52:35 -0000 1.1 --- opal-ode.vcproj 11 Dec 2005 05:17:27 -0000 1.2 *************** *** 14,18 **** <Configuration Name="Debug|Win32" ! OutputDirectory="..\build\win32\Debug" IntermediateDirectory="$(OutDir)" ConfigurationType="2" --- 14,18 ---- <Configuration Name="Debug|Win32" ! OutputDirectory="..\..\build\win32\Debug" IntermediateDirectory="$(OutDir)" ConfigurationType="2" *************** *** 26,30 **** FavorSizeOrSpeed="0" AdditionalIncludeDirectories="" ! PreprocessorDefinitions="WIN32;_DEBUG;_LIB;OPAL_DLL_EXPORTING" MinimalRebuild="TRUE" BasicRuntimeChecks="0" --- 26,30 ---- FavorSizeOrSpeed="0" AdditionalIncludeDirectories="" ! PreprocessorDefinitions="WIN32;_DEBUG;_LIB;OPAL_DLL_EXPORTING;OPAL_USE_DOUBLE" MinimalRebuild="TRUE" BasicRuntimeChecks="0" *************** *** 38,43 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="ode_d.lib" OutputFile="$(OutDir)/opal-ode_d.dll" IgnoreDefaultLibraryNames="libcd" GenerateDebugInformation="TRUE"/> --- 38,44 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="oded.lib OPCODE_D.lib" OutputFile="$(OutDir)/opal-ode_d.dll" + AdditionalLibraryDirectories="" IgnoreDefaultLibraryNames="libcd" GenerateDebugInformation="TRUE"/> *************** *** 65,69 **** <Configuration Name="Release|Win32" ! OutputDirectory="..\build\win32\Release" IntermediateDirectory="$(OutDir)" ConfigurationType="2" --- 66,70 ---- <Configuration Name="Release|Win32" ! OutputDirectory="..\..\build\win32\Release" IntermediateDirectory="$(OutDir)" ConfigurationType="2" *************** *** 76,80 **** FavorSizeOrSpeed="1" AdditionalIncludeDirectories="" ! PreprocessorDefinitions="WIN32;NDEBUG;_LIB;OPAL_DLL_EXPORTING" RuntimeLibrary="2" UsePrecompiledHeader="0" --- 77,81 ---- FavorSizeOrSpeed="1" AdditionalIncludeDirectories="" ! PreprocessorDefinitions="WIN32;NDEBUG;_LIB;OPAL_DLL_EXPORTING;OPAL_USE_DOUBLE" RuntimeLibrary="2" UsePrecompiledHeader="0" *************** *** 86,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="ode.lib" OutputFile="$(OutDir)/opal-ode.dll" IgnoreDefaultLibraryNames="libc" OptimizeReferences="2" --- 87,93 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="ode.lib OPCODE.lib" OutputFile="$(OutDir)/opal-ode.dll" + AdditionalLibraryDirectories="" IgnoreDefaultLibraryNames="libc" OptimizeReferences="2" *************** *** 120,184 **** Filter=""> <File ! RelativePath="..\src\AccelerationSensor.cpp"> </File> <File ! RelativePath="..\src\AttractorMotor.cpp"> </File> <File ! RelativePath="..\src\Blueprint.cpp"> </File> <File ! RelativePath="..\src\BlueprintInstance.cpp"> </File> <File ! RelativePath="..\src\BlueprintManager.cpp"> </File> <File ! RelativePath="..\src\CollisionEventHandler.cpp"> </File> <File ! RelativePath="..\src\GearedMotor.cpp"> </File> <File ! RelativePath="..\src\InclineSensor.cpp"> </File> <File ! RelativePath="..\src\Joint.cpp"> </File> <File ! RelativePath="..\src\Logger.cpp"> </File> <File ! RelativePath="..\src\Motor.cpp"> </File> <File ! RelativePath="..\src\RaycastSensor.cpp"> </File> <File ! RelativePath="..\src\Sensor.cpp"> </File> <File ! RelativePath="..\src\ServoMotor.cpp"> </File> <File ! RelativePath="..\src\Simulator.cpp"> </File> <File ! RelativePath="..\src\Solid.cpp"> </File> <File ! RelativePath="..\src\SolidData.cpp"> </File> <File ! RelativePath="..\src\Space.cpp"> </File> <File ! RelativePath="..\src\SpringMotor.cpp"> </File> <File ! RelativePath="..\src\ThrusterMotor.cpp"> </File> <File ! RelativePath="..\src\VolumeSensor.cpp"> </File> </Filter> --- 122,198 ---- Filter=""> <File ! RelativePath="..\..\src\AccelerationSensor.cpp"> </File> <File ! RelativePath="..\..\src\AttractorMotor.cpp"> </File> <File ! RelativePath="..\..\src\Blueprint.cpp"> </File> <File ! RelativePath="..\..\src\BlueprintInstance.cpp"> </File> <File ! RelativePath="..\..\src\BlueprintManager.cpp"> </File> <File ! RelativePath="..\..\src\CollisionEventHandler.cpp"> </File> <File ! RelativePath="..\..\src\GearedMotor.cpp"> </File> <File ! RelativePath="..\..\src\InclineSensor.cpp"> </File> <File ! RelativePath="..\..\src\Joint.cpp"> </File> <File ! RelativePath="..\..\src\Logger.cpp"> </File> <File ! RelativePath="..\..\src\Motor.cpp"> </File> <File ! RelativePath="..\..\src\Point3r.cpp"> </File> <File ! RelativePath="..\..\src\Quaternion.cpp"> </File> <File ! RelativePath="..\..\src\RaycastSensor.cpp"> </File> <File ! RelativePath="..\..\src\Sensor.cpp"> </File> <File ! RelativePath="..\..\src\ServoMotor.cpp"> </File> <File ! RelativePath="..\..\src\Simulator.cpp"> </File> <File ! RelativePath="..\..\src\Solid.cpp"> </File> <File ! RelativePath="..\..\src\SolidData.cpp"> </File> <File ! RelativePath="..\..\src\Space.cpp"> </File> <File ! RelativePath="..\..\src\SpringMotor.cpp"> ! </File> ! <File ! RelativePath="..\..\src\ThrusterMotor.cpp"> ! </File> ! <File ! RelativePath="..\..\src\Vec3r.cpp"> ! </File> ! <File ! RelativePath="..\..\src\VelocityMotor.cpp"> ! </File> ! <File ! RelativePath="..\..\src\VolumeSensor.cpp"> </File> </Filter> *************** *** 187,326 **** Filter=""> <File ! RelativePath="..\src\AccelerationSensor.h"> </File> <File ! RelativePath="..\src\AccelerationSensorData.h"> </File> <File ! RelativePath="..\src\AttractorMotor.h"> </File> <File ! RelativePath="..\src\AttractorMotorData.h"> </File> <File ! RelativePath="..\src\Blueprint.h"> </File> <File ! RelativePath="..\src\BlueprintInstance.h"> </File> <File ! RelativePath="..\src\BlueprintManager.h"> </File> <File ! RelativePath="..\src\BoxShapeData.h"> </File> <File ! RelativePath="..\src\CapsuleShapeData.h"> </File> <File ! RelativePath="..\src\CollisionEventHandler.h"> </File> <File ! RelativePath="..\src\Defines.h"> </File> <File ! RelativePath="..\src\EventHandler.h"> </File> <File ! RelativePath="..\src\GearedMotor.h"> </File> <File ! RelativePath="..\src\GearedMotorData.h"> </File> <File ! RelativePath="..\src\InclineSensor.h"> </File> <File ! RelativePath="..\src\InclineSensorData.h"> </File> <File ! RelativePath="..\src\Joint.h"> </File> <File ! RelativePath="..\src\JointBreakEventHandler.h"> </File> <File ! RelativePath="..\src\JointData.h"> </File> <File ! RelativePath="..\src\Logger.h"> </File> <File ! RelativePath="..\src\MeshShapeData.h"> </File> <File ! RelativePath="..\src\Motor.h"> </File> <File ! RelativePath="..\src\MotorData.h"> </File> <File ! RelativePath="..\src\opal.h"> </File> <File ! RelativePath="..\src\PlaneShapeData.h"> </File> <File ! RelativePath="..\src\Portability.h"> </File> <File ! RelativePath="..\src\PostStepEventHandler.h"> </File> <File ! RelativePath="..\src\RaycastSensor.h"> </File> <File ! RelativePath="..\src\RaycastSensorData.h"> </File> <File ! RelativePath="..\src\Sensor.h"> </File> <File ! RelativePath="..\src\SensorData.h"> </File> <File ! RelativePath="..\src\ServoMotor.h"> </File> <File ! RelativePath="..\src\ServoMotorData.h"> </File> <File ! RelativePath="..\src\ShapeData.h"> </File> <File ! RelativePath="..\src\Simulator.h"> </File> <File ! RelativePath="..\src\Singleton.h"> </File> <File ! RelativePath="..\src\Solid.h"> </File> <File ! RelativePath="..\src\SolidData.h"> </File> <File ! RelativePath="..\src\Space.h"> </File> <File ! RelativePath="..\src\SphereShapeData.h"> </File> <File ! RelativePath="..\src\SpringMotor.h"> </File> <File ! RelativePath="..\src\SpringMotorData.h"> </File> <File ! RelativePath="..\src\ThrusterMotor.h"> </File> <File ! RelativePath="..\src\ThrusterMotorData.h"> </File> <File ! RelativePath="..\src\VolumeSensor.h"> </File> <File ! RelativePath="..\src\VolumeSensorData.h"> </File> </Filter> --- 201,349 ---- Filter=""> <File ! RelativePath="..\..\src\AccelerationSensor.h"> </File> <File ! RelativePath="..\..\src\AccelerationSensorData.h"> </File> <File ! RelativePath="..\..\src\AttractorMotor.h"> </File> <File ! RelativePath="..\..\src\AttractorMotorData.h"> </File> <File ! RelativePath="..\..\src\Blueprint.h"> </File> <File ! RelativePath="..\..\src\BlueprintInstance.h"> </File> <File ! RelativePath="..\..\src\BlueprintManager.h"> </File> <File ! RelativePath="..\..\src\BoxShapeData.h"> </File> <File ! RelativePath="..\..\src\CapsuleShapeData.h"> </File> <File ! RelativePath="..\..\src\CollisionEventHandler.h"> </File> <File ! RelativePath="..\..\src\Defines.h"> </File> <File ! RelativePath="..\..\src\EventHandler.h"> </File> <File ! RelativePath="..\..\src\GearedMotor.h"> </File> <File ! RelativePath="..\..\src\GearedMotorData.h"> </File> <File ! RelativePath="..\..\src\InclineSensor.h"> </File> <File ! RelativePath="..\..\src\InclineSensorData.h"> </File> <File ! RelativePath="..\..\src\Joint.h"> </File> <File ! RelativePath="..\..\src\JointBreakEventHandler.h"> </File> <File ! RelativePath="..\..\src\JointData.h"> </File> <File ! RelativePath="..\..\src\Logger.h"> </File> <File ! RelativePath="..\..\src\Mass.h"> </File> <File ! RelativePath="..\..\src\MeshShapeData.h"> </File> <File ! RelativePath="..\..\src\Motor.h"> </File> <File ! RelativePath="..\..\src\MotorData.h"> </File> <File ! RelativePath="..\..\src\opal.h"> </File> <File ! RelativePath="..\..\src\PlaneShapeData.h"> </File> <File ! RelativePath="..\..\src\Portability.h"> </File> <File ! RelativePath="..\..\src\PostStepEventHandler.h"> </File> <File ! RelativePath="..\..\src\RaycastSensor.h"> </File> <File ! RelativePath="..\..\src\RaycastSensorData.h"> </File> <File ! RelativePath="..\..\src\Sensor.h"> </File> <File ! RelativePath="..\..\src\SensorData.h"> </File> <File ! RelativePath="..\..\src\ServoMotor.h"> </File> <File ! RelativePath="..\..\src\ServoMotorData.h"> </File> <File ! RelativePath="..\..\src\ShapeData.h"> </File> <File ! RelativePath="..\..\src\Simulator.h"> </File> <File ! RelativePath="..\..\src\Singleton.h"> </File> <File ! RelativePath="..\..\src\Solid.h"> </File> <File ! RelativePath="..\..\src\SolidData.h"> </File> <File ! RelativePath="..\..\src\Space.h"> </File> <File ! RelativePath="..\..\src\SphereShapeData.h"> </File> <File ! RelativePath="..\..\src\SpringMotor.h"> </File> <File ! RelativePath="..\..\src\SpringMotorData.h"> </File> <File ! RelativePath="..\..\src\ThrusterMotor.h"> </File> <File ! RelativePath="..\..\src\ThrusterMotorData.h"> </File> <File ! RelativePath="..\..\src\VelocityMotor.h"> ! </File> ! <File ! RelativePath="..\..\src\VelocityMotorData.h"> ! </File> ! <File ! RelativePath="..\..\src\VolumeSensor.h"> ! </File> ! <File ! RelativePath="..\..\src\VolumeSensorData.h"> </File> </Filter> *************** *** 332,345 **** Filter=""> <File ! RelativePath="..\src\Ode\ODEJoint.cpp"> </File> <File ! RelativePath="..\src\Ode\ODESimulator.cpp"> </File> <File ! RelativePath="..\src\Ode\ODESolid.cpp"> </File> <File ! RelativePath="..\src\Ode\ODESpace.cpp"> </File> </Filter> --- 355,368 ---- Filter=""> <File ! RelativePath="..\..\src\Ode\ODEJoint.cpp"> </File> <File ! RelativePath="..\..\src\Ode\ODESimulator.cpp"> </File> <File ! RelativePath="..\..\src\Ode\ODESolid.cpp"> </File> <File ! RelativePath="..\..\src\Ode\ODESpace.cpp"> </File> </Filter> *************** *** 348,361 **** Filter=""> <File ! RelativePath="..\src\Ode\ODEJoint.h"> </File> <File ! RelativePath="..\src\Ode\ODESimulator.h"> </File> <File ! RelativePath="..\src\Ode\ODESolid.h"> </File> <File ! RelativePath="..\src\Ode\ODESpace.h"> </File> </Filter> --- 371,387 ---- Filter=""> <File ! RelativePath="..\..\src\Ode\ODEJoint.h"> </File> <File ! RelativePath="..\..\src\Ode\ODESimulator.h"> </File> <File ! RelativePath="..\..\src\Ode\ODESolid.h"> </File> <File ! RelativePath="..\..\src\Ode\ODESpace.h"> ! </File> ! <File ! RelativePath="..\..\src\Ode\ODETools.h"> </File> </Filter> *************** *** 365,384 **** Filter=""> <File ! RelativePath="..\src\Matrix44r.h"> </File> <File ! RelativePath="..\src\OpalMath.h"> </File> <File ! RelativePath="..\src\Point3r.h"> </File> <File ! RelativePath="..\src\Quaternion.h"> </File> <File ! RelativePath="..\src\Rayr.h"> </File> <File ! RelativePath="..\src\Vec3r.h"> </File> </Filter> --- 391,410 ---- Filter=""> <File ! RelativePath="..\..\src\Matrix44r.h"> </File> <File ! RelativePath="..\..\src\OpalMath.h"> </File> <File ! RelativePath="..\..\src\Point3r.h"> </File> <File ! RelativePath="..\..\src\Quaternion.h"> </File> <File ! RelativePath="..\..\src\Rayr.h"> </File> <File ! RelativePath="..\..\src\Vec3r.h"> </File> </Filter> *************** *** 390,403 **** Filter=""> <File ! RelativePath="..\src\external\tinyxml\tinystr.cpp"> </File> <File ! RelativePath="..\src\external\tinyxml\tinyxml.cpp"> </File> <File ! RelativePath="..\src\external\tinyxml\tinyxmlerror.cpp"> </File> <File ! RelativePath="..\src\external\tinyxml\tinyxmlparser.cpp"> </File> </Filter> --- 416,429 ---- Filter=""> <File ! RelativePath="..\..\src\external\tinyxml\tinystr.cpp"> </File> <File ! RelativePath="..\..\src\external\tinyxml\tinyxml.cpp"> </File> <File ! RelativePath="..\..\src\external\tinyxml\tinyxmlerror.cpp"> </File> <File ! RelativePath="..\..\src\external\tinyxml\tinyxmlparser.cpp"> </File> </Filter> *************** *** 406,416 **** Filter=""> <File ! RelativePath="..\src\external\tinyxml\tinystr.h"> </File> <File ! RelativePath="..\src\external\tinyxml\tinyxml.h"> </File> </Filter> </Filter> </Files> <Globals> --- 432,449 ---- Filter=""> <File ! RelativePath="..\..\src\external\tinyxml\tinystr.h"> </File> <File ! RelativePath="..\..\src\external\tinyxml\tinyxml.h"> </File> </Filter> </Filter> + <Filter + Name="QuickTest" + Filter=""> + <File + RelativePath="..\..\src\external\quicktest\quicktest.h"> + </File> + </Filter> </Files> <Globals> Index: opal.sln =================================================================== RCS file: /cvsroot/opal/opal/scripts/vc71/opal.sln,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** opal.sln 9 Dec 2005 17:52:35 -0000 1.1 --- opal.sln 11 Dec 2005 05:17:27 -0000 1.2 *************** *** 4,7 **** --- 4,12 ---- EndProjectSection EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unittests", "..\unittests\unittests.vcproj", "{B0076F5D-FC54-4928-BAA1-961BC651EAC1}" + ProjectSection(ProjectDependencies) = postProject + {312196D4-105B-4444-A33A-2ECE3C7D6D64} = {312196D4-105B-4444-A33A-2ECE3C7D6D64} + EndProjectSection + EndProject Global GlobalSection(SolutionConfiguration) = preSolution *************** *** 14,17 **** --- 19,26 ---- {312196D4-105B-4444-A33A-2ECE3C7D6D64}.Release.ActiveCfg = Release|Win32 {312196D4-105B-4444-A33A-2ECE3C7D6D64}.Release.Build.0 = Release|Win32 + {B0076F5D-FC54-4928-BAA1-961BC651EAC1}.Debug.ActiveCfg = Debug|Win32 + {B0076F5D-FC54-4928-BAA1-961BC651EAC1}.Debug.Build.0 = Debug|Win32 + {B0076F5D-FC54-4928-BAA1-961BC651EAC1}.Release.ActiveCfg = Release|Win32 + {B0076F5D-FC54-4928-BAA1-961BC651EAC1}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution |
From: Olex <ole...@us...> - 2005-12-11 05:17:36
|
Update of /cvsroot/opal/opal/scripts/vc8 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9354/scripts/vc8 Modified Files: opal-ode.vcproj Log Message: Updated vc71 and vc8 project files. Index: opal-ode.vcproj =================================================================== RCS file: /cvsroot/opal/opal/scripts/vc8/opal-ode.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** opal-ode.vcproj 11 Dec 2005 04:43:05 -0000 1.2 --- opal-ode.vcproj 11 Dec 2005 05:17:27 -0000 1.3 *************** *** 18,22 **** <Configuration Name="Debug|Win32" ! OutputDirectory="..\build\win32\Debug" IntermediateDirectory="$(OutDir)" ConfigurationType="2" --- 18,22 ---- <Configuration Name="Debug|Win32" ! OutputDirectory="..\..\build\win32\Debug" IntermediateDirectory="$(OutDir)" ConfigurationType="2" *************** *** 100,104 **** <Configuration Name="Release|Win32" ! OutputDirectory="..\build\win32\Release" IntermediateDirectory="$(OutDir)" ConfigurationType="2" --- 100,104 ---- <Configuration Name="Release|Win32" ! OutputDirectory="..\..\build\win32\Release" IntermediateDirectory="$(OutDir)" ConfigurationType="2" |
From: Olex <ole...@us...> - 2005-12-11 04:43:13
|
Update of /cvsroot/opal/opal/scripts/vc8 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4690/scripts/vc8 Modified Files: opal-ode.vcproj opal.sln Log Message: Fixes for Windows linking. Index: opal-ode.vcproj =================================================================== RCS file: /cvsroot/opal/opal/scripts/vc8/opal-ode.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** opal-ode.vcproj 9 Dec 2005 17:52:50 -0000 1.1 --- opal-ode.vcproj 11 Dec 2005 04:43:05 -0000 1.2 *************** *** 50,53 **** --- 50,54 ---- BasicRuntimeChecks="0" RuntimeLibrary="3" + FloatingPointModel="2" UsePrecompiledHeader="0" WarningLevel="3" *************** *** 68,72 **** AdditionalDependencies="oded.lib OPCODE_d.lib" OutputFile="$(OutDir)/opal-ode_d.dll" ! AdditionalLibraryDirectories="C:\Olex\work\ode-0.5\lib" IgnoreDefaultLibraryNames="libcmt" GenerateDebugInformation="true" --- 69,73 ---- AdditionalDependencies="oded.lib OPCODE_d.lib" OutputFile="$(OutDir)/opal-ode_d.dll" ! AdditionalLibraryDirectories="" IgnoreDefaultLibraryNames="libcmt" GenerateDebugInformation="true" *************** *** 128,131 **** --- 129,133 ---- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;OPAL_DLL_EXPORTING;OPAL_USE_DOUBLE" RuntimeLibrary="2" + FloatingPointModel="2" UsePrecompiledHeader="0" WarningLevel="3" *************** *** 146,150 **** AdditionalDependencies="ode.lib OPCODE.lib" OutputFile="$(OutDir)/opal-ode.dll" ! AdditionalLibraryDirectories=""C:\Olex\work\ode-0.5\lib"" IgnoreDefaultLibraryNames="libcmt" OptimizeReferences="2" --- 148,152 ---- AdditionalDependencies="ode.lib OPCODE.lib" OutputFile="$(OutDir)/opal-ode.dll" ! AdditionalLibraryDirectories="" IgnoreDefaultLibraryNames="libcmt" OptimizeReferences="2" *************** *** 184,280 **** > <File ! RelativePath="..\src\AccelerationSensor.cpp" > </File> <File ! RelativePath="..\src\AttractorMotor.cpp" > </File> <File ! RelativePath="..\src\Blueprint.cpp" > </File> <File ! RelativePath="..\src\BlueprintInstance.cpp" > </File> <File ! RelativePath="..\src\BlueprintManager.cpp" > </File> <File ! RelativePath="..\src\CollisionEventHandler.cpp" > </File> <File ! RelativePath="..\src\GearedMotor.cpp" > </File> <File ! RelativePath="..\src\InclineSensor.cpp" > </File> <File ! RelativePath="..\src\Joint.cpp" > </File> <File ! RelativePath="..\src\Logger.cpp" > </File> <File ! RelativePath="..\src\Motor.cpp" > </File> <File ! RelativePath="..\src\Point3r.cpp" > </File> <File ! RelativePath="..\src\Quaternion.cpp" > </File> <File ! RelativePath="..\src\RaycastSensor.cpp" > </File> <File ! RelativePath="..\src\Sensor.cpp" > </File> <File ! RelativePath="..\src\ServoMotor.cpp" > </File> <File ! RelativePath="..\src\Simulator.cpp" > </File> <File ! RelativePath="..\src\Solid.cpp" > </File> <File ! RelativePath="..\src\SolidData.cpp" > </File> <File ! RelativePath="..\src\Space.cpp" > </File> <File ! RelativePath="..\src\SpringMotor.cpp" > </File> <File ! RelativePath="..\src\ThrusterMotor.cpp" > </File> <File ! RelativePath="..\src\Vec3r.cpp" > </File> <File ! RelativePath="..\src\VolumeSensor.cpp" > </File> --- 186,286 ---- > <File ! RelativePath="..\..\src\AccelerationSensor.cpp" > </File> <File ! RelativePath="..\..\src\AttractorMotor.cpp" > </File> <File ! RelativePath="..\..\src\Blueprint.cpp" > </File> <File ! RelativePath="..\..\src\BlueprintInstance.cpp" > </File> <File ! RelativePath="..\..\src\BlueprintManager.cpp" > </File> <File ! RelativePath="..\..\src\CollisionEventHandler.cpp" > </File> <File ! RelativePath="..\..\src\GearedMotor.cpp" > </File> <File ! RelativePath="..\..\src\InclineSensor.cpp" > </File> <File ! RelativePath="..\..\src\Joint.cpp" > </File> <File ! RelativePath="..\..\src\Logger.cpp" > </File> <File ! RelativePath="..\..\src\Motor.cpp" > </File> <File ! RelativePath="..\..\src\Point3r.cpp" > </File> <File ! RelativePath="..\..\src\Quaternion.cpp" > </File> <File ! RelativePath="..\..\src\RaycastSensor.cpp" > </File> <File ! RelativePath="..\..\src\Sensor.cpp" > </File> <File ! RelativePath="..\..\src\ServoMotor.cpp" > </File> <File ! RelativePath="..\..\src\Simulator.cpp" > </File> <File ! RelativePath="..\..\src\Solid.cpp" > </File> <File ! RelativePath="..\..\src\SolidData.cpp" > </File> <File ! RelativePath="..\..\src\Space.cpp" > </File> <File ! RelativePath="..\..\src\SpringMotor.cpp" > </File> <File ! RelativePath="..\..\src\ThrusterMotor.cpp" > </File> <File ! RelativePath="..\..\src\Vec3r.cpp" > </File> <File ! RelativePath="..\..\src\VelocityMotor.cpp" ! > ! </File> ! <File ! RelativePath="..\..\src\VolumeSensor.cpp" > </File> *************** *** 284,472 **** > <File ! RelativePath="..\src\AccelerationSensor.h" > </File> <File ! RelativePath="..\src\AccelerationSensorData.h" > </File> <File ! RelativePath="..\src\AttractorMotor.h" > </File> <File ! RelativePath="..\src\AttractorMotorData.h" > </File> <File ! RelativePath="..\src\Blueprint.h" > </File> <File ! RelativePath="..\src\BlueprintInstance.h" > </File> <File ! RelativePath="..\src\BlueprintManager.h" > </File> <File ! RelativePath="..\src\BoxShapeData.h" > </File> <File ! RelativePath="..\src\CapsuleShapeData.h" > </File> <File ! RelativePath="..\src\CollisionEventHandler.h" > </File> <File ! RelativePath="..\src\Defines.h" > </File> <File ! RelativePath="..\src\EventHandler.h" > </File> <File ! RelativePath="..\src\GearedMotor.h" > </File> <File ! RelativePath="..\src\GearedMotorData.h" > </File> <File ! RelativePath="..\src\InclineSensor.h" > </File> <File ! RelativePath="..\src\InclineSensorData.h" > </File> <File ! RelativePath="..\src\Joint.h" > </File> <File ! RelativePath="..\src\JointBreakEventHandler.h" > </File> <File ! RelativePath="..\src\JointData.h" > </File> <File ! RelativePath="..\src\Logger.h" > </File> <File ! RelativePath="..\src\Mass.h" > </File> <File ! RelativePath="..\src\MeshShapeData.h" > </File> <File ! RelativePath="..\src\Motor.h" > </File> <File ! RelativePath="..\src\MotorData.h" > </File> <File ! RelativePath="..\src\opal.h" > </File> <File ! RelativePath="..\src\PlaneShapeData.h" > </File> <File ! RelativePath="..\src\Portability.h" > </File> <File ! RelativePath="..\src\PostStepEventHandler.h" > </File> <File ! RelativePath="..\src\RaycastSensor.h" > </File> <File ! RelativePath="..\src\RaycastSensorData.h" > </File> <File ! RelativePath="..\src\Sensor.h" > </File> <File ! RelativePath="..\src\SensorData.h" > </File> <File ! RelativePath="..\src\ServoMotor.h" > </File> <File ! RelativePath="..\src\ServoMotorData.h" > </File> <File ! RelativePath="..\src\ShapeData.h" > </File> <File ! RelativePath="..\src\Simulator.h" > </File> <File ! RelativePath="..\src\Singleton.h" > </File> <File ! RelativePath="..\src\Solid.h" > </File> <File ! RelativePath="..\src\SolidData.h" > </File> <File ! RelativePath="..\src\Space.h" > </File> <File ! RelativePath="..\src\SphereShapeData.h" > </File> <File ! RelativePath="..\src\SpringMotor.h" > </File> <File ! RelativePath="..\src\SpringMotorData.h" > </File> <File ! RelativePath="..\src\ThrusterMotor.h" > </File> <File ! RelativePath="..\src\ThrusterMotorData.h" > </File> <File ! RelativePath="..\src\VolumeSensor.h" > </File> <File ! RelativePath="..\src\VolumeSensorData.h" > </File> --- 290,486 ---- > <File ! RelativePath="..\..\src\AccelerationSensor.h" > </File> <File ! RelativePath="..\..\src\AccelerationSensorData.h" > </File> <File ! RelativePath="..\..\src\AttractorMotor.h" > </File> <File ! RelativePath="..\..\src\AttractorMotorData.h" > </File> <File ! RelativePath="..\..\src\Blueprint.h" > </File> <File ! RelativePath="..\..\src\BlueprintInstance.h" > </File> <File ! RelativePath="..\..\src\BlueprintManager.h" > </File> <File ! RelativePath="..\..\src\BoxShapeData.h" > </File> <File ! RelativePath="..\..\src\CapsuleShapeData.h" > </File> <File ! RelativePath="..\..\src\CollisionEventHandler.h" > </File> <File ! RelativePath="..\..\src\Defines.h" > </File> <File ! RelativePath="..\..\src\EventHandler.h" > </File> <File ! RelativePath="..\..\src\GearedMotor.h" > </File> <File ! RelativePath="..\..\src\GearedMotorData.h" > </File> <File ! RelativePath="..\..\src\InclineSensor.h" > </File> <File ! RelativePath="..\..\src\InclineSensorData.h" > </File> <File ! RelativePath="..\..\src\Joint.h" > </File> <File ! RelativePath="..\..\src\JointBreakEventHandler.h" > </File> <File ! RelativePath="..\..\src\JointData.h" > </File> <File ! RelativePath="..\..\src\Logger.h" > </File> <File ! RelativePath="..\..\src\Mass.h" > </File> <File ! RelativePath="..\..\src\MeshShapeData.h" > </File> <File ! RelativePath="..\..\src\Motor.h" > </File> <File ! RelativePath="..\..\src\MotorData.h" > </File> <File ! RelativePath="..\..\src\opal.h" > </File> <File ! RelativePath="..\..\src\PlaneShapeData.h" > </File> <File ! RelativePath="..\..\src\Portability.h" > </File> <File ! RelativePath="..\..\src\PostStepEventHandler.h" > </File> <File ! RelativePath="..\..\src\RaycastSensor.h" > </File> <File ! RelativePath="..\..\src\RaycastSensorData.h" > </File> <File ! RelativePath="..\..\src\Sensor.h" > </File> <File ! RelativePath="..\..\src\SensorData.h" > </File> <File ! RelativePath="..\..\src\ServoMotor.h" > </File> <File ! RelativePath="..\..\src\ServoMotorData.h" > </File> <File ! RelativePath="..\..\src\ShapeData.h" > </File> <File ! RelativePath="..\..\src\Simulator.h" > </File> <File ! RelativePath="..\..\src\Singleton.h" > </File> <File ! RelativePath="..\..\src\Solid.h" > </File> <File ! RelativePath="..\..\src\SolidData.h" > </File> <File ! RelativePath="..\..\src\Space.h" > </File> <File ! RelativePath="..\..\src\SphereShapeData.h" > </File> <File ! RelativePath="..\..\src\SpringMotor.h" > </File> <File ! RelativePath="..\..\src\SpringMotorData.h" > </File> <File ! RelativePath="..\..\src\ThrusterMotor.h" > </File> <File ! RelativePath="..\..\src\ThrusterMotorData.h" > </File> <File ! RelativePath="..\..\src\VelocityMotor.h" > </File> <File ! RelativePath="..\..\src\VelocityMotorData.h" ! > ! </File> ! <File ! RelativePath="..\..\src\VolumeSensor.h" ! > ! </File> ! <File ! RelativePath="..\..\src\VolumeSensorData.h" > </File> *************** *** 479,495 **** > <File ! RelativePath="..\src\Ode\ODEJoint.cpp" > </File> <File ! RelativePath="..\src\Ode\ODESimulator.cpp" > </File> <File ! RelativePath="..\src\Ode\ODESolid.cpp" > </File> <File ! RelativePath="..\src\Ode\ODESpace.cpp" > </File> --- 493,509 ---- > <File ! RelativePath="..\..\src\Ode\ODEJoint.cpp" > </File> <File ! RelativePath="..\..\src\Ode\ODESimulator.cpp" > </File> <File ! RelativePath="..\..\src\Ode\ODESolid.cpp" > </File> <File ! RelativePath="..\..\src\Ode\ODESpace.cpp" > </File> *************** *** 499,515 **** > <File ! RelativePath="..\src\Ode\ODEJoint.h" > </File> <File ! RelativePath="..\src\Ode\ODESimulator.h" > </File> <File ! RelativePath="..\src\Ode\ODESolid.h" > </File> <File ! RelativePath="..\src\Ode\ODESpace.h" > </File> --- 513,529 ---- > <File ! RelativePath="..\..\src\Ode\ODEJoint.h" > </File> <File ! RelativePath="..\..\src\Ode\ODESimulator.h" > </File> <File ! RelativePath="..\..\src\Ode\ODESolid.h" > </File> <File ! RelativePath="..\..\src\Ode\ODESpace.h" > </File> *************** *** 520,544 **** > <File ! RelativePath="..\src\Matrix44r.h" > </File> <File ! RelativePath="..\src\OpalMath.h" > </File> <File ! RelativePath="..\src\Point3r.h" > </File> <File ! RelativePath="..\src\Quaternion.h" > </File> <File ! RelativePath="..\src\Rayr.h" > </File> <File ! RelativePath="..\src\Vec3r.h" > </File> --- 534,558 ---- > <File ! RelativePath="..\..\src\Matrix44r.h" > </File> <File ! RelativePath="..\..\src\OpalMath.h" > </File> <File ! RelativePath="..\..\src\Point3r.h" > </File> <File ! RelativePath="..\..\src\Quaternion.h" > </File> <File ! RelativePath="..\..\src\Rayr.h" > </File> <File ! RelativePath="..\..\src\Vec3r.h" > </File> *************** *** 551,567 **** > <File ! RelativePath="..\src\external\tinyxml\tinystr.cpp" > </File> <File ! RelativePath="..\src\external\tinyxml\tinyxml.cpp" > </File> <File ! RelativePath="..\src\external\tinyxml\tinyxmlerror.cpp" > </File> <File ! RelativePath="..\src\external\tinyxml\tinyxmlparser.cpp" > </File> --- 565,581 ---- > <File ! RelativePath="..\..\src\external\tinyxml\tinystr.cpp" > </File> <File ! RelativePath="..\..\src\external\tinyxml\tinyxml.cpp" > </File> <File ! RelativePath="..\..\src\external\tinyxml\tinyxmlerror.cpp" > </File> <File ! RelativePath="..\..\src\external\tinyxml\tinyxmlparser.cpp" > </File> *************** *** 571,579 **** > <File ! RelativePath="..\src\external\tinyxml\tinystr.h" > </File> <File ! RelativePath="..\src\external\tinyxml\tinyxml.h" > </File> --- 585,593 ---- > <File ! RelativePath="..\..\src\external\tinyxml\tinystr.h" > </File> <File ! RelativePath="..\..\src\external\tinyxml\tinyxml.h" > </File> Index: opal.sln =================================================================== RCS file: /cvsroot/opal/opal/scripts/vc8/opal.sln,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** opal.sln 9 Dec 2005 17:52:50 -0000 1.1 --- opal.sln 11 Dec 2005 04:43:05 -0000 1.2 *************** *** 3,7 **** Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opal-ode", "opal-ode.vcproj", "{312196D4-105B-4444-A33A-2ECE3C7D6D64}" EndProject ! Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unittests", "..\unittests\unittests.vcproj", "{A211B4F7-11A8-4392-9934-ABAE5B31BDA8}" ProjectSection(ProjectDependencies) = postProject {312196D4-105B-4444-A33A-2ECE3C7D6D64} = {312196D4-105B-4444-A33A-2ECE3C7D6D64} --- 3,7 ---- Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opal-ode", "opal-ode.vcproj", "{312196D4-105B-4444-A33A-2ECE3C7D6D64}" EndProject ! Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unittests", "unittests\unittests.vcproj", "{6C9403A9-2A58-4E15-B33F-31299A4A2377}" ProjectSection(ProjectDependencies) = postProject {312196D4-105B-4444-A33A-2ECE3C7D6D64} = {312196D4-105B-4444-A33A-2ECE3C7D6D64} *************** *** 18,25 **** {312196D4-105B-4444-A33A-2ECE3C7D6D64}.Release|Win32.ActiveCfg = Release|Win32 {312196D4-105B-4444-A33A-2ECE3C7D6D64}.Release|Win32.Build.0 = Release|Win32 ! {A211B4F7-11A8-4392-9934-ABAE5B31BDA8}.Debug|Win32.ActiveCfg = Debug|Win32 ! {A211B4F7-11A8-4392-9934-ABAE5B31BDA8}.Debug|Win32.Build.0 = Debug|Win32 ! {A211B4F7-11A8-4392-9934-ABAE5B31BDA8}.Release|Win32.ActiveCfg = Release|Win32 ! {A211B4F7-11A8-4392-9934-ABAE5B31BDA8}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution --- 18,25 ---- {312196D4-105B-4444-A33A-2ECE3C7D6D64}.Release|Win32.ActiveCfg = Release|Win32 {312196D4-105B-4444-A33A-2ECE3C7D6D64}.Release|Win32.Build.0 = Release|Win32 ! {6C9403A9-2A58-4E15-B33F-31299A4A2377}.Debug|Win32.ActiveCfg = Debug|Win32 ! {6C9403A9-2A58-4E15-B33F-31299A4A2377}.Debug|Win32.Build.0 = Debug|Win32 ! {6C9403A9-2A58-4E15-B33F-31299A4A2377}.Release|Win32.ActiveCfg = Release|Win32 ! {6C9403A9-2A58-4E15-B33F-31299A4A2377}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution |
From: Olex <ole...@us...> - 2005-12-11 04:43:13
|
Update of /cvsroot/opal/opal/src/external/quicktest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4690/src/external/quicktest Modified Files: quicktest.h Log Message: Fixes for Windows linking. Index: quicktest.h =================================================================== RCS file: /cvsroot/opal/opal/src/external/quicktest/quicktest.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** quicktest.h 10 Dec 2005 05:18:35 -0000 1.8 --- quicktest.h 11 Dec 2005 04:43:05 -0000 1.9 *************** *** 24,29 **** *************************************************************************/ - - // Credits: // Thanks to Noel Llopis for his helpful comparison of various C++ unit --- 24,27 ---- *************** *** 45,461 **** - // ----------------------------------------------------------------------- - // Design Notes - // ----------------------------------------------------------------------- - // * Each test automatically registers itself by accessing the TestManager - // singleton. - // - // * There are no formal fixtures. Fixtures are simply user-defined - // objects. setup and teardown occur in the user-defined object's - // constructor and destructor. Tests that need fixtures should staticly - // allocate one of these objects at the beginning of the test. This method - // is flexible and conceptually simple. - - namespace quicktest - { - typedef std::vector<std::string> TestResult; - - class Test - { - public: - Test( const std::string& testGroup, const std::string& testName ) - { - mTestName = testName; - mTestGroup = testGroup; - } - - virtual ~Test() {} - - const std::string & getGroup() { return mTestGroup; } - - virtual void run( TestResult& result ) = 0; - - protected: - void recordFailure( TestResult& result, const std::string& file, - unsigned long int line, const std::string& message ) - { - // If the full filename is too long, only use the last part. - std::string fileStr = file; - size_t maxLength = 40; - size_t fileLength = file.size(); - if ( fileLength > maxLength ) - { - // Get the last maxLength characters - 3 (leave room for - // three ellipses at the beginning). - fileStr = "..."; - fileStr += file.substr( fileLength - maxLength + 3, - fileLength - 1 ); - } - - std::ostringstream oss; - oss << fileStr << "(" << line << "): '" << mTestName - << "' FAILED: " << message; - result.push_back( oss.str() ); - } - - /// The unique name of this test. - std::string mTestName; - - /// The group name of this test - std::string mTestGroup; - - /// helper method - static bool areEqual(double x, double y) - { - const double EPSILON = 0.00001; - double maxVal = 1; - - if (fabs(static_cast<double>(x)) > maxVal) - { - maxVal = fabs(x); - } - - if (fabs(static_cast<double>(y)) > maxVal) - { - maxVal = fabs(static_cast<double>(y)); - } - - if (fabs(static_cast<double>(x - y)) <= EPSILON * maxVal) - { - return true; - } - else - { - return false; - } - } - }; - - class TestManager - { - public: - static TestManager& instance() - { - static TestManager self; - return self; - } - - void addTest( Test* test ) - { - mTests.push_back( test ); - } - - void setOutputStream( std::ostream* stream ) - { - mOutputStream = stream; - } - - std::ostream* getOutputStream() - { - return mOutputStream; - } - - void runTests() - { - unsigned int numFailures = 0; - - *getOutputStream() - << "[---------------- RUNNING TESTS ----------------]" - << std::endl; - - unsigned int numLocalFailures = 0; - unsigned int numLocalSuccesses = 0; - - std::string currentGroup; - std::vector<Test*>::iterator iter; - for ( iter = mTests.begin(); iter != mTests.end(); ++iter ) - { - if ( currentGroup != ( *iter ) ->getGroup() ) - { - if ( !currentGroup.empty() ) - { - *getOutputStream() << "Group results: " - << numLocalSuccesses << " succeeded, " - << numLocalFailures << " failed" - << std::endl; - } - - currentGroup = ( *iter ) ->getGroup(); - - *getOutputStream() << - "Group: " << ( *iter ) ->getGroup() - << std::endl; - - numLocalFailures = 0; - numLocalSuccesses = 0; - } - - ( *iter ) ->run( mResult ); - - bool testFailed = false; - - size_t size = mResult.size(); - for ( size_t i = 0; i < size; ++i ) - { - *getOutputStream() << mResult.at( i ) << std::endl; - testFailed = true; - } - mResult.clear(); - - if ( testFailed ) - { - ++numFailures; - ++numLocalFailures; - } - else - { - ++numLocalSuccesses; - } - } - - if ( !currentGroup.empty() ) - { - *getOutputStream() << "Group results: " - << numLocalSuccesses << " succeeded, " - << numLocalFailures << " failed" - << std::endl; - } - - *getOutputStream() << "Overall results: " << ( unsigned int ) mTests.size() - - numFailures << " succeeded, " << numFailures << " failed" - << std::endl; - - *getOutputStream() - << "[---------------- TESTS FINISHED ---------------]" - << std::endl; - } - - private: - TestManager() - { - mOutputStream = &std::cout; - } - - ~TestManager() - {} - - /// List of pointers to Tests. All tests are staticly allocated, - /// so we don't need to destroy them manually. - std::vector<Test*> mTests; - - std::ostream* mOutputStream; - - TestResult mResult; - }; - } - - /// Macro to define a single test without using a fixture. - #define QT_TEST(testName)\ class testName##Test : public quicktest::Test\ --- 43,252 ---- *************** *** 473,477 **** /// Macro that runs all tests. - #define QT_RUN_TESTS quicktest::TestManager::instance().runTests() --- 264,267 ---- *************** *** 479,490 **** /// Macro that sets the output stream to use. - #define QT_SET_OUTPUT(stream)\ quicktest::TestManager::instance().setOutputStream(stream) - /// Checks whether the given condition is true. - #define QT_CHECK(condition)\ {\ --- 269,277 ---- *************** *** 499,503 **** /// Checks whether the first parameter is equal to the second. - #define QT_CHECK_EQUAL(value1, value2)\ {\ --- 286,289 ---- *************** *** 514,520 **** - /// Checks whether the first parameter is not equal to the second. - #define QT_CHECK_NOT_EQUAL(value1, value2)\ {\ --- 300,304 ---- *************** *** 530,540 **** - /// Checks whether the first parameter is within the given tolerance from - /// the second parameter. This is useful for comparing floating point - /// values. - #define QT_CHECK_CLOSE(value1, value2)\ {\ --- 314,320 ---- *************** *** 554,558 **** #define QT_CHECK_CLOSE_CUSTOM(value1, value2, tolerance)\ {\ ! if (abs((value1)-(value2)) > tolerance)\ {\ std::ostringstream oss;\ --- 334,338 ---- #define QT_CHECK_CLOSE_CUSTOM(value1, value2, tolerance)\ {\ ! if (fabs((value1)-(value2)) > tolerance)\ {\ std::ostringstream oss;\ *************** *** 565,569 **** /// Checks whether the first parameter is less than the second. - #define QT_CHECK_LESS(value1, value2)\ {\ --- 345,348 ---- *************** *** 579,585 **** - /// Checks whether the first parameter is less than or equal to the second. - #define QT_CHECK_LESS_OR_EQUAL(value1, value2)\ {\ --- 358,362 ---- *************** *** 594,601 **** } - - /// Checks whether the first parameter is greater than the second. - #define QT_CHECK_GREATER(value1, value2)\ {\ --- 371,375 ---- *************** *** 611,619 **** - /// Checks whether the first parameter is greater than or equal to the - /// second. - #define QT_CHECK_GREATER_OR_EQUAL(value1, value2)\ {\ --- 385,390 ---- *************** *** 628,635 **** } - - /// Fails unconditionally and prints the given message. - #define QT_FAIL(message)\ {\ --- 399,403 ---- *************** *** 638,645 **** }\ - - /// Prints the given message, followed by a carriage return. - #define QT_PRINT(message)\ {\ --- 406,410 ---- *************** *** 648,652 **** }\ - #endif - --- 413,415 ---- |
From: Olex <ole...@us...> - 2005-12-11 04:43:13
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4690/src Modified Files: Portability.h VelocityMotor.h testBlueprint.cpp Log Message: Fixes for Windows linking. Index: testBlueprint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/testBlueprint.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testBlueprint.cpp 10 Dec 2005 05:18:35 -0000 1.1 --- testBlueprint.cpp 11 Dec 2005 04:43:05 -0000 1.2 *************** *** 77,81 **** MockCollisionHandler() {} ! void handleCollisionEvent( const CollisionEvent & e ) { // nothing --- 77,81 ---- MockCollisionHandler() {} ! void OPAL_CALL handleCollisionEvent( const CollisionEvent & e ) { // nothing Index: VelocityMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/VelocityMotor.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VelocityMotor.h 10 Dec 2005 05:32:48 -0000 1.2 --- VelocityMotor.h 11 Dec 2005 04:43:05 -0000 1.3 *************** *** 57,92 **** //! destructor ! ~VelocityMotor(); /// Initializes the Motor with the given data structure. ! void OPAL_CALL init( const VelocityMotorData & data ); /// Sets whether the Motor has any effect. ! void OPAL_CALL setEnabled( bool e ); /// Returns true if the Motor is enabled. ! bool OPAL_CALL isEnabled() const; /// Returns the Motor type. ! MotorType OPAL_CALL getType() const; /// Sets the Motor's name. ! void OPAL_CALL setName( const std::string & name ); /// Returns the Motor's name. ! const std::string & OPAL_CALL getName() const; /// Set target velocity. ! void OPAL_CALL setVelocity( const Vec3r & velocity ); /// Return target velocity. ! const Vec3r & OPAL_CALL getVelocity() const; /// Called regularly to update the Motor. This does nothing if the /// Motor is disabled. ! void OPAL_CALL internal_update(); //! Returns true if motors controls this solid. ! bool OPAL_CALL internal_dependsOnSolid( Solid * s ) const; //! against gravity or not? --- 57,92 ---- //! destructor ! virtual ~VelocityMotor(); /// Initializes the Motor with the given data structure. ! virtual void OPAL_CALL init( const VelocityMotorData & data ); /// Sets whether the Motor has any effect. ! virtual void OPAL_CALL setEnabled( bool e ); /// Returns true if the Motor is enabled. ! virtual bool OPAL_CALL isEnabled() const; /// Returns the Motor type. ! virtual MotorType OPAL_CALL getType() const; /// Sets the Motor's name. ! virtual void OPAL_CALL setName( const std::string & name ); /// Returns the Motor's name. ! virtual const std::string & OPAL_CALL getName() const; /// Set target velocity. ! virtual void OPAL_CALL setVelocity( const Vec3r & velocity ); /// Return target velocity. ! virtual const Vec3r & OPAL_CALL getVelocity() const; /// Called regularly to update the Motor. This does nothing if the /// Motor is disabled. ! virtual void OPAL_CALL internal_update(); //! Returns true if motors controls this solid. ! virtual bool OPAL_CALL internal_dependsOnSolid( Solid * s ) const; //! against gravity or not? *************** *** 95,108 **** * so solid will be affected by gravity */ ! void OPAL_CALL letGravityAffectSolid( bool affect ); //! Returns true if gravity is being ignored by the motor ! bool OPAL_CALL doesGravityAffectSolid() const; //! Maximum allowed force for the motor to use. ! void OPAL_CALL setMaximumForce( real maxForce ); //! What is the maximum allowed force for this motor? ! real OPAL_CALL getMaximumForce() const; protected: --- 95,108 ---- * so solid will be affected by gravity */ ! virtual void OPAL_CALL letGravityAffectSolid( bool affect ); //! Returns true if gravity is being ignored by the motor ! virtual bool OPAL_CALL doesGravityAffectSolid() const; //! Maximum allowed force for the motor to use. ! virtual void OPAL_CALL setMaximumForce( real maxForce ); //! What is the maximum allowed force for this motor? ! virtual real OPAL_CALL getMaximumForce() const; protected: Index: Portability.h =================================================================== RCS file: /cvsroot/opal/opal/src/Portability.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Portability.h 24 Jun 2005 17:50:48 -0000 1.9 --- Portability.h 11 Dec 2005 04:43:05 -0000 1.10 *************** *** 40,53 **** // DLL import/export macro. #ifndef OPAL_DECL ! #if defined(WIN32) || defined(_WIN32) ! #ifdef OPAL_DLL_EXPORTING ! #define OPAL_DECL __declspec(dllexport) ! #else ! #define OPAL_DECL __declspec(dllimport) ! #endif ! #else ! #define OPAL_DECL ! #endif ! #endif /// Macro for exporting functions that keeps function names from being --- 40,57 ---- // DLL import/export macro. #ifndef OPAL_DECL ! #if (defined(WIN32) || defined(_WIN32)) ! #ifdef OPAL_DLL_EXPORTING ! #define OPAL_DECL __declspec(dllexport) ! #else ! #if !defined(__MINGW32__) && !defined(__CYGWIN__) ! #define OPAL_DECL __declspec(dllimport) ! #else ! #define OPAL_DECL ! #endif ! #endif ! #else ! #define OPAL_DECL ! #endif ! #endif /// Macro for exporting functions that keeps function names from being |
From: Olex <ole...@us...> - 2005-12-10 23:39:04
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16582/src Modified Files: SConscript Log Message: Updated scons script. Index: SConscript =================================================================== RCS file: /cvsroot/opal/opal/src/SConscript,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** SConscript 2 Dec 2005 01:47:16 -0000 1.23 --- SConscript 10 Dec 2005 23:38:50 -0000 1.24 *************** *** 54,57 **** --- 54,59 ---- ThrusterMotorData.h Vec3r.h + VelocityMotor.h + VelocityMotorData.h VolumeSensor.h VolumeSensorData.h *************** *** 83,86 **** --- 85,89 ---- VolumeSensor.cpp Vec3r.cpp + VelocityMotor.cpp """) |
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3972/src Modified Files: Joint.cpp Joint.h JointData.h Makefile.am Makefile.in Quaternion.h testsolid.cpp Added Files: testFixedJoint.cpp testJoint.cpp Log Message: Implemented features to track Joint damage. --- NEW FILE: testFixedJoint.cpp --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * Oleksandr Lozitskiy mr....@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. * * * *************************************************************************/ // system headers #include <quicktest.h> // project headers #include "opal.h" using namespace opal; namespace testFixedJoint { class Fixture { public: Fixture() { sim = createSimulator(); sim->setGravity( Vec3r( 0, 0, 0 ) ); s1 = sim->createSolid(); s2 = sim->createSolid(); s1->setPosition( Point3r( 0, 0, 0 ) ); s2->setPosition( Point3r( 0, 10, 0 ) ); j = sim->createJoint(); } ~Fixture() { sim->destroy(); } Simulator * sim; Solid * s1; Solid * s2; Joint * j; }; QT_TEST( no_shapes ) { Fixture f; JointData jdata; jdata.setType( FIXED_JOINT ); jdata.solid0 = f.s1; jdata.solid1 = f.s2; f.j->init( jdata ); f.sim->simulate( 1 ); QT_CHECK_CLOSE( f.s1->getPosition().x, 0 ); QT_CHECK_CLOSE( f.s1->getPosition().y, 0 ); QT_CHECK_CLOSE( f.s1->getPosition().z, 0 ); QT_CHECK_CLOSE( f.s2->getPosition().x, 0 ); QT_CHECK_CLOSE( f.s2->getPosition().y, 10 ); QT_CHECK_CLOSE( f.s2->getPosition().z, 0 ); } QT_TEST( with_shapes ) { Fixture f; SphereShapeData data; data.radius = 1; f.s1->addShape( data ); f.s2->addShape( data ); JointData jdata; jdata.setType( FIXED_JOINT ); jdata.solid0 = f.s1; jdata.solid1 = f.s2; f.j->init( jdata ); f.sim->simulate( 1 ); QT_CHECK_CLOSE( f.s1->getPosition().x, 0 ); QT_CHECK_CLOSE( f.s1->getPosition().y, 0 ); QT_CHECK_CLOSE( f.s1->getPosition().z, 0 ); QT_CHECK_CLOSE( f.s2->getPosition().x, 0 ); QT_CHECK_CLOSE( f.s2->getPosition().y, 10 ); QT_CHECK_CLOSE( f.s2->getPosition().z, 0 ); } } Index: Makefile.in =================================================================== RCS file: /cvsroot/opal/opal/src/Makefile.in,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile.in 10 Dec 2005 05:18:35 -0000 1.10 --- Makefile.in 10 Dec 2005 22:41:06 -0000 1.11 *************** *** 73,77 **** testPoint3r.$(OBJEXT) testQuaternion.$(OBJEXT) \ testMatrix44r.$(OBJEXT) testBlueprint.$(OBJEXT) \ ! testMath.$(OBJEXT) testVelocityMotor.$(OBJEXT) test_opal_OBJECTS = $(am_test_opal_OBJECTS) test_opal_DEPENDENCIES = \ --- 73,78 ---- testPoint3r.$(OBJEXT) testQuaternion.$(OBJEXT) \ testMatrix44r.$(OBJEXT) testBlueprint.$(OBJEXT) \ ! testMath.$(OBJEXT) testVelocityMotor.$(OBJEXT) \ ! testFixedJoint.$(OBJEXT) testJoint.$(OBJEXT) test_opal_OBJECTS = $(am_test_opal_OBJECTS) test_opal_DEPENDENCIES = \ *************** *** 215,220 **** test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.cpp testMath.cpp testVelocityMotor.cpp test_opal_LDADD = $(top_builddir)/src/external/tinyxml/libtinyxml.a \ --- 216,222 ---- test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.cpp testMath.cpp testVelocityMotor.cpp testFixedJoint.cpp \ ! testJoint.cpp test_opal_LDADD = $(top_builddir)/src/external/tinyxml/libtinyxml.a \ *************** *** 326,329 **** --- 328,333 ---- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testAccelerationSensor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testBlueprint.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFixedJoint.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testJoint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMatrix44r.Po@am__quote@ --- NEW FILE: testJoint.cpp --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * Oleksandr Lozitskiy mr....@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. * * * *************************************************************************/ // system headers #include <quicktest.h> // project headers #include "opal.h" using namespace opal; //! Testing generic Joint stuff namespace testJoint { QT_TEST( break_settings ) { Simulator * sim = createSimulator(); Joint * j = sim->createJoint(); JointData data; j->init( data ); QT_CHECK_EQUAL( j->getBreakingMode(), UNBREAKABLE_MODE ); sim->destroy(); } QT_TEST( breaking_threshhold ) { Simulator * sim = createSimulator(); Solid * s0 = sim->createSolid(); s0->setPosition( 0, 0, 0 ); Solid * s1 = sim->createSolid(); s1->setPosition( 0, 0, 10 ); { SphereShapeData data; data.radius = 1; s0->addShape( data ); s1->addShape( data ); } Joint * j = sim->createJoint(); { JointData data; data.setType( FIXED_JOINT ); data.breakMode = THRESHOLD_MODE; data.breakThresh = 100; data.solid0 = s0; data.solid1 = s1; j->init( data ); } sim->simulate( 1 ); QT_CHECK_EQUAL( j->isBroken(), false ); // apply a force that breaks the joint { Force f; f.type = GLOBAL_FORCE; f.duration = 1; f.singleStep = false; f.pos = Point3r( 0, 0, 0 ); f.vec = Vec3r( 0, 0, 100 ); s1->addForce( f ); } sim->simulate( 1 ); QT_CHECK_EQUAL( j->isBroken(), true ); sim->destroy(); } } Index: testsolid.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/testsolid.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testsolid.cpp 1 Dec 2005 23:55:21 -0000 1.7 --- testsolid.cpp 10 Dec 2005 22:41:06 -0000 1.8 *************** *** 231,241 **** QT_CHECK_EQUAL( q, f.s->getQuaternion() ); ! q.set( 1, 0, 0, 0 ); ! f.s->setQuaternion( q ); ! QT_CHECK_EQUAL( q, f.s->getQuaternion() ); ! q.set( 0, 0, 0, 1 ); ! f.s->setQuaternion( q ); ! QT_CHECK_EQUAL( q, f.s->getQuaternion() ); } } --- 231,252 ---- QT_CHECK_EQUAL( q, f.s->getQuaternion() ); ! q.set( 1, 0, 0, 0 ); ! f.s->setQuaternion( q ); ! QT_CHECK_EQUAL( q, f.s->getQuaternion() ); ! q.set( 0, 0, 0, 1 ); ! f.s->setQuaternion( q ); ! QT_CHECK_EQUAL( q, f.s->getQuaternion() ); ! } ! ! QT_TEST( capsule_ODE_crash ) ! { ! SolidFixture f; ! CapsuleShapeData data; ! data.length = 70; ! data.radius = 10; ! f.s->addShape( data ); ! ! f.sim->simulate( 1 ); } } Index: Makefile.am =================================================================== RCS file: /cvsroot/opal/opal/src/Makefile.am,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile.am 10 Dec 2005 05:18:35 -0000 1.10 --- Makefile.am 10 Dec 2005 22:41:06 -0000 1.11 *************** *** 15,20 **** bin_PROGRAMS = test_opal test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.cpp testMath.cpp testVelocityMotor.cpp test_opal_LDADD = $(top_builddir)/src/external/tinyxml/libtinyxml.a \ $(top_builddir)/src/ODE/libodeimpl.a $(top_builddir)/src/libopalode.a -lode --- 15,21 ---- bin_PROGRAMS = test_opal test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.cpp testMath.cpp testVelocityMotor.cpp testFixedJoint.cpp \ ! testJoint.cpp test_opal_LDADD = $(top_builddir)/src/external/tinyxml/libtinyxml.a \ $(top_builddir)/src/ODE/libodeimpl.a $(top_builddir)/src/libopalode.a -lode Index: Joint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Joint.cpp 4 May 2005 21:04:00 -0000 1.32 --- Joint.cpp 10 Dec 2005 22:41:06 -0000 1.33 *************** *** 1,28 **** /************************************************************************* ! * * ! * 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 "Joint.h" --- 1,28 ---- /************************************************************************* ! * * ! * 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 "Joint.h" *************** *** 31,393 **** namespace opal { ! Joint::Joint() ! { ! // "mData" is initialized in its own constructor. ! setJointBreakEventHandler(NULL); ! setUserData(NULL); ! mInitCalled = false; ! mNumAxes = 0; ! mAxisRotational[0] = false; ! mAxisRotational[1] = false; ! mAxisRotational[2] = false; ! } ! Joint::~Joint() ! { ! } ! void Joint::internal_destroy() ! { ! delete this; ! } ! void Joint::init(const JointData& data) ! { ! mData = data; ! } ! const JointData& Joint::getData() ! { ! // Update parameters that don't get updated automatically. ! for (int i=0; i<mNumAxes; ++i) ! { ! mData.axis[i] = getAxis(i); ! } ! mData.anchor = getAnchor(); ! return mData; ! } ! void Joint::setName(const std::string& name) ! { ! mData.name = name; ! } ! const std::string& Joint::getName()const ! { ! return mData.name; ! } ! void Joint::setContactsEnabled(bool e) ! { ! mData.contactsEnabled = e; ! } ! bool Joint::areContactsEnabled()const ! { ! return mData.contactsEnabled; ! } ! JointType Joint::getType()const ! { ! return mData.getType(); ! } ! void Joint::setBreakParams(JointBreakMode mode, real breakThresh, ! real accumThresh) ! { ! mData.breakMode = mode; ! mData.breakThresh = breakThresh; ! mData.accumThresh = accumThresh; ! } ! void Joint::repairAccumDamage() ! { ! mData.accumDamage = 0; ! //mIsBroken = false; ! } ! //bool Joint::internal_isBroken() ! //{ ! // return mIsBroken; ! //} ! void Joint::setJointBreakEventHandler( ! JointBreakEventHandler* eventHandler) ! { ! mJointBreakEventHandler = eventHandler; ! } ! JointBreakEventHandler* Joint::getJointBreakEventHandler()const ! { ! return mJointBreakEventHandler; ! } ! void Joint::setLimitsEnabled(int axisNum, bool e) ! { ! assert(axisNum >= 0 && axisNum < mNumAxes); ! mData.axis[axisNum].limitsEnabled = e; ! } ! bool Joint::areLimitsEnabled(int axisNum) ! { ! assert(axisNum >= 0 && axisNum < mNumAxes); ! return mData.axis[axisNum].limitsEnabled; ! } ! //void Joint::setLimits(int axisNum, JointLimits l) ! //{ ! // assert(axisNum >= 0 && axisNum < mNumAxes); ! // assert(l.bounciness >= 0 && l.bounciness <= 1); ! // assert(l.hardness >= 0 && l.hardness <= 1); ! // mData.axis[axisNum].limits = l; ! //} ! //const Joint::JointLimits& getLimits(int axisNum)const ! //{ ! // assert(axisNum >= 0 && axisNum < mNumAxes); ! // return mData.axis[axisNum].limits; ! //} ! void Joint::setLimitRange(int axisNum, real low, real high) ! { ! assert(high >= low); ! assert(axisNum >= 0 && axisNum < mNumAxes); ! mData.axis[axisNum].limits.low = low; ! mData.axis[axisNum].limits.high = high; ! } ! real Joint::getLowLimit(int axisNum)const ! { ! assert(axisNum >= 0 && axisNum < mNumAxes); ! return mData.axis[axisNum].limits.low; ! } ! real Joint::getHighLimit(int axisNum)const ! { ! assert(axisNum >= 0 && axisNum < mNumAxes); ! return mData.axis[axisNum].limits.high; ! } ! void Joint::setLimitHardness(int axisNum, real h) ! { ! assert(h >= 0 && h <= 1); ! assert(axisNum >= 0 && axisNum < mNumAxes); ! mData.axis[axisNum].limits.hardness = h; ! } ! real Joint::getLimitHardness(int axisNum)const ! { ! assert(axisNum >= 0 && axisNum < mNumAxes); ! return mData.axis[axisNum].limits.hardness; ! } ! void Joint::setLimitBounciness(int axisNum, real b) ! { ! assert(b >= 0 && b <= 1); ! assert(axisNum >= 0 && axisNum < mNumAxes); ! mData.axis[axisNum].limits.bounciness = b; ! } ! real Joint::getLimitBounciness(int axisNum)const ! { ! assert(axisNum >= 0 && axisNum < mNumAxes); ! return mData.axis[axisNum].limits.bounciness; ! } ! void Joint::addForce(int axisNum, real magnitude, real duration, ! bool singleStep) ! { ! assert(axisNum >= 0 && axisNum < mNumAxes); ! if (mData.enabled) ! { ! Force f; ! f.singleStep = singleStep; ! // We only care about the duration if this is not a single-step ! // force. ! if (!f.singleStep) ! { ! f.duration = duration; ! } ! f.type = LOCAL_FORCE; ! Vec3r direction = mData.axis[axisNum].direction; ! f.vec = magnitude * direction; ! if (mData.solid0) ! { ! mData.solid0->addForce(f); ! } ! f.vec *= (real)-1.0; ! if (mData.solid1) ! { ! mData.solid1->addForce(f); ! } ! } ! } ! void Joint::addTorque(int axisNum, real magnitude, real duration, ! bool singleStep) ! { ! assert(axisNum >= 0 && axisNum < mNumAxes); ! if (mData.enabled) ! { ! Force f; ! f.singleStep = singleStep; ! // We only care about the duration if this is not a single-step ! // force. ! if (!f.singleStep) ! { ! f.duration = duration; ! } ! f.type = LOCAL_TORQUE; ! Vec3r axis = mData.axis[axisNum].direction; ! f.vec = magnitude * axis; ! if (mData.solid0) ! { ! mData.solid0->addForce(f); ! } ! f.vec *= (real)-1.0; ! if (mData.solid1) ! { ! mData.solid1->addForce(f); ! } ! } ! } ! void Joint::wakeSolids() ! { ! mData.solid0->setSleeping(false); ! mData.solid1->setSleeping(false); ! } ! void Joint::setSolids(Solid* s0, Solid* s1) ! { ! mData.solid0 = s0; ! mData.solid1 = s1; ! } ! Solid* Joint::getSolid0()const ! { ! return mData.solid0; ! } ! Solid* Joint::getSolid1()const ! { ! return mData.solid1; ! } ! void Joint::setAxis(int axisNum, const JointAxis& axis) ! { ! assert(axisNum >= 0 && axisNum < mNumAxes); ! mData.axis[axisNum] = axis; ! } ! int Joint::getNumAxes()const ! { ! return mNumAxes; ! } ! void Joint::setAnchor(const Point3r& anchor) ! { ! mData.anchor = anchor; ! } ! bool Joint::isEnabled()const ! { ! return mData.enabled; ! } ! void Joint::setEnabled(bool e) ! { ! if (!mInitCalled) ! { ! return; ! } ! mData.enabled = e; ! } ! bool Joint::isRotational(int axisNum)const ! { ! assert(axisNum >= 0 && axisNum < mNumAxes); ! return mAxisRotational[axisNum]; ! } ! void Joint::setUserData(void* data) ! { ! mUserData = data; ! } ! void* Joint::getUserData() ! { ! return mUserData; ! } ! bool Joint::internal_dependsOnSolid(Solid* s) ! { ! if (s == mData.solid0 || s == mData.solid1) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! void Joint::updateDamage(real currentStress) ! { ! bool isBroken = false; ! switch(mData.breakMode) ! { ! case UNBREAKABLE_MODE: ! //nothing to do ! break; ! case THRESHOLD_MODE: ! { ! if (currentStress >= mData.breakThresh) ! { ! isBroken = true; ! } ! break; ! } ! case ACCUMULATED_MODE: ! { ! if (currentStress >= mData.accumThresh) ! { ! mData.accumDamage += currentStress; ! } ! if (mData.accumDamage >= mData.breakThresh) ! { ! isBroken = true; ! } ! break; ! } ! default: ! assert(false); ! } ! if (isBroken) ! { ! setEnabled(false); ! if (mJointBreakEventHandler) ! { ! mJointBreakEventHandler->handleJointBreakEvent(this); ! } ! } ! } } --- 31,415 ---- namespace opal { ! Joint::Joint() ! { ! // "mData" is initialized in its own constructor. ! setJointBreakEventHandler( NULL ); ! setUserData( NULL ); ! mInitCalled = false; ! mNumAxes = 0; ! mAxisRotational[ 0 ] = false; ! mAxisRotational[ 1 ] = false; ! mAxisRotational[ 2 ] = false; ! } ! Joint::~Joint() ! {} ! void Joint::internal_destroy() ! { ! delete this; ! } ! void Joint::init( const JointData& data ) ! { ! mData = data; ! } ! const JointData& Joint::getData() ! { ! // Update parameters that don't get updated automatically. ! for ( int i = 0; i < mNumAxes; ++i ) ! { ! mData.axis[ i ] = getAxis( i ); ! } ! mData.anchor = getAnchor(); ! return mData; ! } ! void Joint::setName( const std::string& name ) ! { ! mData.name = name; ! } ! const std::string& Joint::getName() const ! { ! return mData.name; ! } ! void Joint::setContactsEnabled( bool e ) ! { ! mData.contactsEnabled = e; ! } ! bool Joint::areContactsEnabled() const ! { ! return mData.contactsEnabled; ! } ! JointType Joint::getType() const ! { ! return mData.getType(); ! } ! void Joint::setBreakParams( JointBreakMode mode, real breakThresh, ! real accumThresh ) ! { ! mData.breakMode = mode; ! mData.breakThresh = breakThresh; ! mData.accumThresh = accumThresh; ! } ! bool Joint::isBroken() const ! { ! return mData.isBroken; ! } ! JointBreakMode Joint::getBreakingMode() const ! { ! return mData.breakMode; ! } ! real Joint::getBreakThresh() const ! { ! return mData.breakThresh; ! } ! real Joint::getAccumulatedDamage() const ! { ! return mData.accumDamage; ! } ! real Joint::getAccumulatedThresh() const ! { ! return mData.accumThresh; ! } ! void Joint::repairAccumDamage() ! { ! mData.accumDamage = 0; ! //mIsBroken = false; ! } ! //bool Joint::internal_isBroken() ! //{ ! // return mIsBroken; ! //} ! void Joint::setJointBreakEventHandler( ! JointBreakEventHandler* eventHandler ) ! { ! mJointBreakEventHandler = eventHandler; ! } ! JointBreakEventHandler* Joint::getJointBreakEventHandler() const ! { ! return mJointBreakEventHandler; ! } ! void Joint::setLimitsEnabled( int axisNum, bool e ) ! { ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! mData.axis[ axisNum ].limitsEnabled = e; ! } ! bool Joint::areLimitsEnabled( int axisNum ) ! { ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! return mData.axis[ axisNum ].limitsEnabled; ! } ! //void Joint::setLimits(int axisNum, JointLimits l) ! //{ ! // assert(axisNum >= 0 && axisNum < mNumAxes); ! // assert(l.bounciness >= 0 && l.bounciness <= 1); ! // assert(l.hardness >= 0 && l.hardness <= 1); ! // mData.axis[axisNum].limits = l; ! //} ! //const Joint::JointLimits& getLimits(int axisNum)const ! //{ ! // assert(axisNum >= 0 && axisNum < mNumAxes); ! // return mData.axis[axisNum].limits; ! //} ! void Joint::setLimitRange( int axisNum, real low, real high ) ! { ! assert( high >= low ); ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! mData.axis[ axisNum ].limits.low = low; ! mData.axis[ axisNum ].limits.high = high; ! } ! real Joint::getLowLimit( int axisNum ) const ! { ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! return mData.axis[ axisNum ].limits.low; ! } ! real Joint::getHighLimit( int axisNum ) const ! { ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! return mData.axis[ axisNum ].limits.high; ! } ! void Joint::setLimitHardness( int axisNum, real h ) ! { ! assert( h >= 0 && h <= 1 ); ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! mData.axis[ axisNum ].limits.hardness = h; ! } ! real Joint::getLimitHardness( int axisNum ) const ! { ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! return mData.axis[ axisNum ].limits.hardness; ! } ! void Joint::setLimitBounciness( int axisNum, real b ) ! { ! assert( b >= 0 && b <= 1 ); ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! mData.axis[ axisNum ].limits.bounciness = b; ! } ! real Joint::getLimitBounciness( int axisNum ) const ! { ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! return mData.axis[ axisNum ].limits.bounciness; ! } ! void Joint::addForce( int axisNum, real magnitude, real duration, ! bool singleStep ) ! { ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! if ( mData.enabled ) ! { ! Force f; ! f.singleStep = singleStep; ! // We only care about the duration if this is not a single-step ! // force. ! if ( !f.singleStep ) ! { ! f.duration = duration; ! } ! f.type = LOCAL_FORCE; ! Vec3r direction = mData.axis[ axisNum ].direction; ! f.vec = magnitude * direction; ! if ( mData.solid0 ) ! { ! mData.solid0->addForce( f ); ! } ! f.vec *= ( real ) - 1.0; ! if ( mData.solid1 ) ! { ! mData.solid1->addForce( f ); ! } ! } ! } ! void Joint::addTorque( int axisNum, real magnitude, real duration, ! bool singleStep ) ! { ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! if ( mData.enabled ) ! { ! Force f; ! f.singleStep = singleStep; ! // We only care about the duration if this is not a single-step ! // force. ! if ( !f.singleStep ) ! { ! f.duration = duration; ! } ! f.type = LOCAL_TORQUE; ! Vec3r axis = mData.axis[ axisNum ].direction; ! f.vec = magnitude * axis; ! if ( mData.solid0 ) ! { ! mData.solid0->addForce( f ); ! } ! f.vec *= ( real ) - 1.0; ! if ( mData.solid1 ) ! { ! mData.solid1->addForce( f ); ! } ! } ! } ! void Joint::wakeSolids() ! { ! mData.solid0->setSleeping( false ); ! mData.solid1->setSleeping( false ); ! } ! void Joint::setSolids( Solid* s0, Solid* s1 ) ! { ! mData.solid0 = s0; ! mData.solid1 = s1; ! } ! Solid* Joint::getSolid0() const ! { ! return mData.solid0; ! } ! Solid* Joint::getSolid1() const ! { ! return mData.solid1; ! } ! void Joint::setAxis( int axisNum, const JointAxis& axis ) ! { ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! mData.axis[ axisNum ] = axis; ! } ! int Joint::getNumAxes() const ! { ! return mNumAxes; ! } ! void Joint::setAnchor( const Point3r& anchor ) ! { ! mData.anchor = anchor; ! } ! bool Joint::isEnabled() const ! { ! return mData.enabled; ! } ! void Joint::setEnabled( bool e ) ! { ! if ( !mInitCalled ) ! { ! return ; ! } ! mData.enabled = e; ! } ! bool Joint::isRotational( int axisNum ) const ! { ! assert( axisNum >= 0 && axisNum < mNumAxes ); ! return mAxisRotational[ axisNum ]; ! } ! void Joint::setUserData( void* data ) ! { ! mUserData = data; ! } ! void* Joint::getUserData() ! { ! return mUserData; ! } ! ! bool Joint::internal_dependsOnSolid( Solid* s ) ! { ! if ( s == mData.solid0 || s == mData.solid1 ) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! void Joint::updateDamage( real currentStress ) ! { ! switch ( mData.breakMode ) ! { ! case UNBREAKABLE_MODE: ! //nothing to do ! break; ! case THRESHOLD_MODE: ! { ! if ( currentStress >= mData.breakThresh ) ! { ! mData.isBroken = true; ! } ! break; ! } ! case ACCUMULATED_MODE: ! { ! if ( currentStress >= mData.accumThresh ) ! { ! mData.accumDamage += currentStress; ! } ! ! if ( mData.accumDamage >= mData.breakThresh ) ! { ! mData.isBroken = true; ! } ! break; ! } ! default: ! assert( false ); ! } ! ! if ( mData.isBroken ) ! { ! setEnabled( false ); ! if ( mJointBreakEventHandler ) ! { ! mJointBreakEventHandler->handleJointBreakEvent( this ); ! } ! } ! } } Index: Quaternion.h =================================================================== RCS file: /cvsroot/opal/opal/src/Quaternion.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Quaternion.h 4 Dec 2005 03:27:11 -0000 1.13 --- Quaternion.h 10 Dec 2005 22:41:06 -0000 1.14 *************** *** 60,66 **** OPAL_DECL real OPAL_CALL length() const; OPAL_DECL void OPAL_CALL normalize(); ! OPAL_DECL void OPAL_CALL getAngleAxis( real& angle, Vec3r& axis ) const; OPAL_DECL real OPAL_CALL getRoll() const; --- 60,74 ---- OPAL_DECL real OPAL_CALL length() const; + //! Length will be one. OPAL_DECL void OPAL_CALL normalize(); ! //! Returns the equivalent rotation. ! /*! ! * @param angle in degrees ! * @param axis axis of rotation ! * ! * @note Quaternion needs to be normalized first ! */ ! OPAL_DECL void OPAL_CALL getAngleAxis( real & angle, Vec3r & axis ) const; OPAL_DECL real OPAL_CALL getRoll() const; Index: Joint.h =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.h,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Joint.h 4 May 2005 21:04:00 -0000 1.70 --- Joint.h 10 Dec 2005 22:41:06 -0000 1.71 *************** *** 1,28 **** /************************************************************************* ! * * ! * Open Physics Abstraction Layer * ! * Copyright (C) 2004-2005 * ! * Alan Fischer ala...@gm... * ! * Andres Reinot an...@re... * ! * Tyler Streeter tyl...@gm... * ! * All rights reserved. * ! * Web: opal.sourceforge.net * ! * * ! * This library is free software; you can redistribute it and/or * ! * modify it under the terms of EITHER: * ! * (1) The GNU Lesser General Public License as published by the Free * ! * Software Foundation; either version 2.1 of the License, or (at * ! * your option) any later version. The text of the GNU Lesser * ! * General Public License is included with this library in the * ! * file license-LGPL.txt. * ! * (2) The BSD-style license that is included with this library in * ! * the file license-BSD.txt. * ! * * ! * This library is distributed in the hope that it will be useful, * ! * but WITHOUT ANY WARRANTY; without even the implied warranty of * ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * ! * license-LGPL.txt and license-BSD.txt for more details. * ! * * ! *************************************************************************/ #ifndef OPAL_JOINT_H --- 1,28 ---- /************************************************************************* ! * * ! * Open Physics Abstraction Layer * ! * Copyright (C) 2004-2005 * ! * Alan Fischer ala...@gm... * ! * Andres Reinot an...@re... * ! * Tyler Streeter tyl...@gm... * ! * All rights reserved. * ! * Web: opal.sourceforge.net * ! * * ! * This library is free software; you can redistribute it and/or * ! * modify it under the terms of EITHER: * ! * (1) The GNU Lesser General Public License as published by the Free * ! * Software Foundation; either version 2.1 of the License, or (at * ! * your option) any later version. The text of the GNU Lesser * ! * General Public License is included with this library in the * ! * file license-LGPL.txt. * ! * (2) The BSD-style license that is included with this library in * ! * the file license-BSD.txt. * ! * * ! * This library is distributed in the hope that it will be useful, * ! * but WITHOUT ANY WARRANTY; without even the implied warranty of * ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * ! * license-LGPL.txt and license-BSD.txt for more details. * ! * * ! *************************************************************************/ #ifndef OPAL_JOINT_H *************** *** 35,275 **** namespace opal { ! /// A constraint between two Solids or between a Solid and the static ! /// environment. There is a variety of Joint types, each constraining ! /// Solid motion in different ways. There are 6 degrees of freedom ! /// for a Solid that can be constrained: 3 rotational and 3 linear. ! /// Each Joint type constrains a different subset of these 6. When ! /// specifying the two Solids ! /// affected by the Joint, if at least one Solid ! /// is non-NULL, the Joint will be enabled. If both Solids are ! /// NULL, the Joint will be disabled. If only one Solid is NULL, ! /// the Joint will attach the other Solid to the static environment. ! /// If both Solids are the same, the Joint's Solids will both be set ! /// to NULL and the Joint will be disabled. If either Solid is static, ! /// both will be set to NULL, and the Joint will be disabled. ! /// Note that some Joint types ! /// do not use all of the anchor and axis parameters. An unused anchor ! /// or axis will be ignored (see the JointType description for more ! /// details). Joints remain ineffective until they are initialized. ! class Joint ! { ! public: ! Joint(); ! /// Initializes the Joint with the given data structure. Calling ! /// this more than once will automatically detach the Joint from ! /// its old Solids first. ! virtual void OPAL_CALL init(const JointData& data); ! /// Returns all data describing the Joint. ! virtual const JointData& OPAL_CALL getData(); ! /// Sets the Joint's name. ! virtual void OPAL_CALL setName(const std::string& name); ! /// Returns the Joint's name. ! virtual const std::string& OPAL_CALL getName()const; ! /// Sets whether the Joint's two Solids are constrained by ! /// physical contacts. ! virtual void OPAL_CALL setContactsEnabled(bool e); ! /// Returns whether the Joint's two Solids are constrained by ! /// physical contacts. ! virtual bool OPAL_CALL areContactsEnabled()const; ! /// Returns the Joint type. ! virtual JointType OPAL_CALL getType()const; ! /// Sets the parameters that determine how this Joint will break, if ! /// at all. ! virtual void OPAL_CALL setBreakParams(JointBreakMode mode, ! real breakThresh, real accumThresh=0); ! /// Repairs accumulated damage to breakable Joints in accumulated ! /// damage mode. This does not reenable the Joint. ! virtual void OPAL_CALL repairAccumDamage(); ! /// Sets the Joint's break event handler. ! virtual void OPAL_CALL setJointBreakEventHandler( ! JointBreakEventHandler* eventHandler); ! /// Returns the Joint's break event handler. If this returns ! /// NULL, the Joint is not using one. ! virtual JointBreakEventHandler* OPAL_CALL ! getJointBreakEventHandler()const; ! /// Enables or disables the given Joint axis' limits. ! virtual void OPAL_CALL setLimitsEnabled(int axisNum, bool e); ! /// Returns true if the given Joint axis' limits are enabled. ! virtual bool OPAL_CALL areLimitsEnabled(int axisNum); ! /// Sets the Joint's limit angles (in degrees for rotational axes, ! /// distance for translational axes). ! /// No limits are applied ! /// if this is not called. The Wheel Joint does not ! /// use limits for axis 1, so setting this will do nothing. ! virtual void OPAL_CALL setLimitRange(int axisNum, real low, ! real high); ! /// Returns the low limit for a given axis (angle in degrees for ! /// rotational axes, distance for translational axes). ! virtual real OPAL_CALL getLowLimit(int axisNum)const; ! /// Returns the high limit for a given axis (angle in degrees for ! /// rotational axes, distance for translational axes). ! virtual real OPAL_CALL getHighLimit(int axisNum)const; ! /// Sets the hardness for the given axis' limits. Hardness ! /// represents how "squishy" the limit is. Hardness must be ! /// between 0 and 1, inclusive. Setting the hardness for axis 1 ! /// of the Wheel Joint will adjust its suspension. ! virtual void OPAL_CALL setLimitHardness(int axisNum, real h); ! /// Returns the hardness for the given axis' limits. ! virtual real OPAL_CALL getLimitHardness(int axisNum)const; ! /// Sets the bounciness for the given axis' limits. Bounciness ! /// (i.e. restitution) represents how much the Joint will bounce ! /// when it hits a limit. Bounciness must be between 0 and 1, ! /// inclusive. ! virtual void OPAL_CALL setLimitBounciness(int axisNum, real b); ! /// Returns the bounciness for the given axis' limits. ! virtual real OPAL_CALL getLimitBounciness(int axisNum)const; ! /// For rotational axes, returns the current angle in degrees ! /// measured from the initial Joint configuration. For translational ! /// axes, simply returns 0. ! virtual real OPAL_CALL getAngle(int axisNum)const = 0; ! /// For translational axes, returns the distance from the initial ! /// Joint configuration. For rotational axes, simply returns 0. ! virtual real OPAL_CALL getDistance(int axisNum)const = 0; ! /// Returns the current rate (degrees per second for rotational ! /// axes, distance units per second for translational axes) for a ! /// given axis. ! virtual real OPAL_CALL getVelocity(int axisNum)const = 0; ! /// Applies a force to this Joint's Solid(s). To be used for ! /// translational axes. This does nothing if the Joint is disabled. ! virtual void OPAL_CALL addForce(int axisNum, real magnitude, ! real duration, bool singleStep=false); ! /// Applies a torque to this Joint's Solid(s). To be used for ! /// rotational Joints. This does nothing if the Joint is disabled. ! virtual void OPAL_CALL addTorque(int axisNum, real magnitude, ! real duration, bool singleStep=false); ! /// Wakes up this Joint's two Solids. ! virtual void OPAL_CALL wakeSolids(); ! /// Returns a pointer to Solid0. ! virtual Solid* OPAL_CALL getSolid0()const; ! /// Returns a pointer to Solid1. ! virtual Solid* OPAL_CALL getSolid1()const; ! /// Returns the current specified axis in global coordinates. ! /// Passing in an invalid axis number will return invalid data. ! virtual JointAxis OPAL_CALL getAxis(int axisNum)const = 0; ! /// Returns the current anchor point in global coordinates. ! /// Passing in an invalid axis number will return invalid data. ! virtual Point3r OPAL_CALL getAnchor()const = 0; ! /// Returns the number of axes used by this Joint. ! virtual int OPAL_CALL getNumAxes()const; ! /// Returns true if the Joint is enabled. ! virtual bool OPAL_CALL isEnabled()const; ! /// Set whether the Joint can affect its Solids. If both Solids are ! /// NULL, this will remain disabled. If the Joint has not yet ! /// been initialized, this will have no effect. ! virtual void OPAL_CALL setEnabled(bool e); ! /// Returns true if the given Joint axis is rotational, false if it ! /// is linear. ! virtual bool OPAL_CALL isRotational(int axisNum)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 Joint 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(); ! /// Various things could be updated here, including damage values. ! /// If the Joint breaks during this update, it will automatically ! /// be disabled, and the event handler will be notified. ! virtual void OPAL_CALL internal_update() = 0; ! /// Set the desired linear or angular velocity for this Joint. ! /// This is to be used internally by Motors. ! virtual void OPAL_CALL internal_setDesiredVel(int axisNum, ! real value) = 0; ! /// Set the max force this Joint can use to attain its desired ! /// velocity. This is to be used internally by Motors. ! virtual void OPAL_CALL internal_setMaxTorque(int axisNum, ! real value) = 0; ! //virtual bool OPAL_CALL internal_isBroken(); ! /// Returns true if this Joint depends on the given Solid. ! virtual bool OPAL_CALL internal_dependsOnSolid(Solid* s); ! /// Internal function used to destroy this object. ! virtual void OPAL_CALL internal_destroy(); ! protected: ! virtual ~Joint(); ! /// Sets the Solids constrained by this Joint. ! void setSolids(Solid* s0, Solid* s1); ! /// Sets the anchor point for this Joint. Both Solids must be ! /// valid (non-NULL) before this is called for it to affect anything. ! /// This Joint's Solids must be positioned and attached ! /// before calling this function. ! virtual void setAnchor(const Point3r& anchor); ! /// Specifies the given axis for this Joint. Invalid axes numbers ! /// will be silently ignored. The axis direction vector will be ! /// normalized. This Joint's Solids must be positioned and ! /// attached before calling this function. ! virtual void setAxis(int axisNum, const JointAxis& axis); ! /// Updates this Joint's current damage status based on the current ! /// amount of stress. ! void updateDamage(real currentStress); ! /// Stores data describing the Joint. ! JointData mData; ! /// A pointer to the Joint's break event handler. ! JointBreakEventHandler* mJointBreakEventHandler; ! /// Pointer to user data. This is totally user-managed (i.e. OPAL ! /// will never delete it). ! void* mUserData; ! /// This is set to true when the Joint is initialized. ! bool mInitCalled; ! /// The number of axes used by the Joint. ! int mNumAxes; ! // This data stores which axes are rotational, as opposed to ! // translational, degrees of freedom. ! bool mAxisRotational[3]; ! private: ! }; } --- 35,293 ---- namespace opal { ! /// A constraint between two Solids or between a Solid and the static ! /// environment. There is a variety of Joint types, each constraining ! /// Solid motion in different ways. There are 6 degrees of freedom ! /// for a Solid that can be constrained: 3 rotational and 3 linear. ! /// Each Joint type constrains a different subset of these 6. When ! /// specifying the two Solids ! /// affected by the Joint, if at least one Solid ! /// is non-NULL, the Joint will be enabled. If both Solids are ! /// NULL, the Joint will be disabled. If only one Solid is NULL, ! /// the Joint will attach the other Solid to the static environment. ! /// If both Solids are the same, the Joint's Solids will both be set ! /// to NULL and the Joint will be disabled. If either Solid is static, ! /// both will be set to NULL, and the Joint will be disabled. ! /// Note that some Joint types ! /// do not use all of the anchor and axis parameters. An unused anchor ! /// or axis will be ignored (see the JointType description for more ! /// details). Joints remain ineffective until they are initialized. ! class Joint ! { ! public: ! Joint(); ! /// Initializes the Joint with the given data structure. Calling ! /// this more than once will automatically detach the Joint from ! /// its old Solids first. ! virtual void OPAL_CALL init( const JointData& data ); ! /// Returns all data describing the Joint. ! virtual const JointData& OPAL_CALL getData(); ! /// Sets the Joint's name. ! virtual void OPAL_CALL setName( const std::string& name ); ! /// Returns the Joint's name. ! virtual const std::string& OPAL_CALL getName() const; ! /// Sets whether the Joint's two Solids are constrained by ! /// physical contacts. ! virtual void OPAL_CALL setContactsEnabled( bool e ); ! /// Returns whether the Joint's two Solids are constrained by ! /// physical contacts. ! virtual bool OPAL_CALL areContactsEnabled() const; ! /// Returns the Joint type. ! virtual JointType OPAL_CALL getType() const; ! /// Sets the parameters that determine how this Joint will break, if ! /// at all. ! virtual void OPAL_CALL setBreakParams( JointBreakMode mode, ! real breakThresh, real accumThresh = 0 ); ! //! What is the mode of breaking? ! virtual JointBreakMode OPAL_CALL getBreakingMode() const; ! //! How much damage can a Joint take? ! virtual real OPAL_CALL getBreakThresh() const; ! //! How much damage has a Joint taken so far? ! virtual real OPAL_CALL getAccumulatedDamage() const; ! //! What is minimum amount of damage that will be recorded? ! /*! ! * @note if the damaga is lower than this value, that damage will be ignored ! */ ! virtual real OPAL_CALL getAccumulatedThresh() const; ! //! Returns true if the Joint has been broken ! virtual bool OPAL_CALL isBroken() const; ! /// Repairs accumulated damage to breakable Joints in accumulated ! /// damage mode. This does not reenable the Joint. ! virtual void OPAL_CALL repairAccumDamage(); ! /// Sets the Joint's break event handler. ! virtual void OPAL_CALL setJointBreakEventHandler( ! JointBreakEventHandler* eventHandler ); ! /// Returns the Joint's break event handler. If this returns ! /// NULL, the Joint is not using one. ! virtual JointBreakEventHandler* OPAL_CALL ! getJointBreakEventHandler() const; ! /// Enables or disables the given Joint axis' limits. ! virtual void OPAL_CALL setLimitsEnabled( int axisNum, bool e ); ! /// Returns true if the given Joint axis' limits are enabled. ! virtual bool OPAL_CALL areLimitsEnabled( int axisNum ); ! /// Sets the Joint's limit angles (in degrees for rotational axes, ! /// distance for translational axes). ! /// No limits are applied ! /// if this is not called. The Wheel Joint does not ! /// use limits for axis 1, so setting this will do nothing. ! virtual void OPAL_CALL setLimitRange( int axisNum, real low, ! real high ); ! /// Returns the low limit for a given axis (angle in degrees for ! /// rotational axes, distance for translational axes). ! virtual real OPAL_CALL getLowLimit( int axisNum ) const; ! /// Returns the high limit for a given axis (angle in degrees for ! /// rotational axes, distance for translational axes). ! virtual real OPAL_CALL getHighLimit( int axisNum ) const; ! /// Sets the hardness for the given axis' limits. Hardness ! /// represents how "squishy" the limit is. Hardness must be ! /// between 0 and 1, inclusive. Setting the hardness for axis 1 ! /// of the Wheel Joint will adjust its suspension. ! virtual void OPAL_CALL setLimitHardness( int axisNum, real h ); ! /// Returns the hardness for the given axis' limits. ! virtual real OPAL_CALL getLimitHardness( int axisNum ) const; ! /// Sets the bounciness for the given axis' limits. Bounciness ! /// (i.e. restitution) represents how much the Joint will bounce ! /// when it hits a limit. Bounciness must be between 0 and 1, ! /// inclusive. ! virtual void OPAL_CALL setLimitBounciness( int axisNum, real b ); ! /// Returns the bounciness for the given axis' limits. ! virtual real OPAL_CALL getLimitBounciness( int axisNum ) const; ! /// For rotational axes, returns the current angle in degrees ! /// measured from the initial Joint configuration. For translational ! /// axes, simply returns 0. ! virtual real OPAL_CALL getAngle( int axisNum ) const = 0; ! /// For translational axes, returns the distance from the initial ! /// Joint configuration. For rotational axes, simply returns 0. ! virtual real OPAL_CALL getDistance( int axisNum ) const = 0; ! /// Returns the current rate (degrees per second for rotational ! /// axes, distance units per second for translational axes) for a ! /// given axis. ! virtual real OPAL_CALL getVelocity( int axisNum ) const = 0; ! /// Applies a force to this Joint's Solid(s). To be used for ! /// translational axes. This does nothing if the Joint is disabled. ! virtual void OPAL_CALL addForce( int axisNum, real magnitude, ! real duration, bool singleStep = false ); ! /// Applies a torque to this Joint's Solid(s). To be used for ! /// rotational Joints. This does nothing if the Joint is disabled. ! virtual void OPAL_CALL addTorque( int axisNum, real magnitude, ! real duration, bool singleStep = false ); ! /// Wakes up this Joint's two Solids. ! virtual void OPAL_CALL wakeSolids(); ! /// Returns a pointer to Solid0. ! virtual Solid* OPAL_CALL getSolid0() const; ! /// Returns a pointer to Solid1. ! virtual Solid* OPAL_CALL getSolid1() const; ! /// Returns the current specified axis in global coordinates. ! /// Passing in an invalid axis number will return invalid data. ! virtual JointAxis OPAL_CALL getAxis( int axisNum ) const = 0; ! /// Returns the current anchor point in global coordinates. ! /// Passing in an invalid axis number will return invalid data. ! virtual Point3r OPAL_CALL getAnchor() const = 0; ! /// Returns the number of axes used by this Joint. ! virtual int OPAL_CALL getNumAxes() const; ! /// Returns true if the Joint is enabled. ! virtual bool OPAL_CALL isEnabled() const; ! /// Set whether the Joint can affect its Solids. If both Solids are ! /// NULL, this will remain disabled. If the Joint has not yet ! /// been initialized, this will have no effect. ! virtual void OPAL_CALL setEnabled( bool e ); ! /// Returns true if the given Joint axis is rotational, false if it ! /// is linear. ! virtual bool OPAL_CALL isRotational( int axisNum ) 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 Joint 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(); ! /// Various things could be updated here, including damage values. ! /// If the Joint breaks during this update, it will automatically ! /// be disabled, and the event handler will be notified. ! virtual void OPAL_CALL internal_update() = 0; ! /// Set the desired linear or angular velocity for this Joint. ! /// This is to be used internally by Motors. ! virtual void OPAL_CALL internal_setDesiredVel( int axisNum, ! real value ) = 0; ! /// Set the max force this Joint can use to attain its desired ! /// velocity. This is to be used internally by Motors. ! virtual void OPAL_CALL internal_setMaxTorque( int axisNum, ! real value ) = 0; ! //virtual bool OPAL_CALL internal_isBroken(); ! /// Returns true if this Joint depends on the given Solid. ! virtual bool OPAL_CALL internal_dependsOnSolid( Solid* s ); ! /// Internal function used to destroy this object. ! virtual void OPAL_CALL internal_destroy(); ! protected: ! virtual ~Joint(); ! /// Sets the Solids constrained by this Joint. ! void setSolids( Solid* s0, Solid* s1 ); ! /// Sets the anchor point for this Joint. Both Solids must be ! /// valid (non-NULL) before this is called for it to affect anything. ! /// This Joint's Solids must be positioned and attached ! /// before calling this function. ! virtual void setAnchor( const Point3r& anchor ); ! /// Specifies the given axis for this Joint. Invalid axes numbers ! /// will ... [truncated message content] |
From: Olex <ole...@us...> - 2005-12-10 22:41:14
|
Update of /cvsroot/opal/opal/src/ODE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3972/src/ODE Modified Files: ODEJoint.cpp Log Message: Implemented features to track Joint damage. Index: ODEJoint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/ODE/ODEJoint.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ODEJoint.cpp 19 Nov 2005 18:09:01 -0000 1.32 --- ODEJoint.cpp 10 Dec 2005 22:41:06 -0000 1.33 *************** *** 1,1048 **** /************************************************************************* ! * * ! * 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 * ! * * [...2070 lines suppressed...] ! { ! dJointAttach( mJointID, solid0->internal_getBodyID(), ! solid1->internal_getBodyID() ); ! if ( BALL_JOINT == mData.getType() ) ! { ! dJointAttach( mAMotorID, solid0->internal_getBodyID(), ! solid1->internal_getBodyID() ); ! } ! } ! ! // Special call for fixed Joints so they remember the current ! // relationship between the Solids or between a Solid and the ! // static environment. ! if ( FIXED_JOINT == mData.getType() ) ! { ! dJointSetFixed( mJointID ); ! } ! } ! } } |
From: Olex <ole...@us...> - 2005-12-10 22:41:13
|
Update of /cvsroot/opal/opal/scripts/kdevelop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3972/scripts/kdevelop Modified Files: opal.kdevelop Log Message: Implemented features to track Joint damage. Index: opal.kdevelop =================================================================== RCS file: /cvsroot/opal/opal/scripts/kdevelop/opal.kdevelop,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** opal.kdevelop 10 Dec 2005 05:57:18 -0000 1.2 --- opal.kdevelop 10 Dec 2005 22:41:06 -0000 1.3 *************** *** 3,7 **** <general> <author>Oleksandr Lozitskiy</author> ! <email></email> <version>0.4.0</version> <projectmanagement>KDevAutoProject</projectmanagement> --- 3,7 ---- <general> <author>Oleksandr Lozitskiy</author> ! <email/> <version>0.4.0</version> <projectmanagement>KDevAutoProject</projectmanagement> *************** *** 14,19 **** <projectdirectory>.</projectdirectory> <absoluteprojectpath>false</absoluteprojectpath> ! <description></description> ! <versioncontrol></versioncontrol> </general> <kdevautoproject> --- 14,19 ---- <projectdirectory>.</projectdirectory> <absoluteprojectpath>false</absoluteprojectpath> ! <description/> ! <versioncontrol/> </general> <kdevautoproject> *************** *** 174,178 **** </codecompletion> <creategettersetter> ! <prefixGet></prefixGet> <prefixSet>set</prefixSet> <prefixVariable>m_,_</prefixVariable> --- 174,178 ---- </codecompletion> <creategettersetter> ! <prefixGet/> <prefixSet>set</prefixSet> <prefixVariable>m_,_</prefixVariable> *************** *** 195,204 **** <kdevdebugger> <general> ! <programargs></programargs> ! <gdbpath></gdbpath> ! <dbgshell></dbgshell> ! <configGdbScript></configGdbScript> ! <runShellScript></runShellScript> ! <runGdbScript></runGdbScript> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> --- 195,204 ---- <kdevdebugger> <general> ! <programargs/> ! <gdbpath/> ! <dbgshell/> ! <configGdbScript/> ! <runShellScript/> ! <runGdbScript/> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> |
From: Olex <ole...@us...> - 2005-12-10 22:41:13
|
Update of /cvsroot/opal/opal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3972 Modified Files: changelog.txt Log Message: Implemented features to track Joint damage. Index: changelog.txt =================================================================== RCS file: /cvsroot/opal/opal/changelog.txt,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** changelog.txt 10 Dec 2005 05:18:35 -0000 1.61 --- changelog.txt 10 Dec 2005 22:41:06 -0000 1.62 *************** *** 15,18 **** --- 15,20 ---- ------------------------------------------ + * 12-10-05: Implemented features to track Joint damage. (Oleksandr Lozitskiy) + * 12-9-05: Implemented VelocityMotor and its unit test. Adjusted QuickTest. Added opal::normalizeDegrees(). (Oleksandr Lozitskiy) |
From: Olex <ole...@us...> - 2005-12-10 05:57:26
|
Update of /cvsroot/opal/opal/scripts/kdevelop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16958/scripts/kdevelop Modified Files: opal.kdevelop Log Message: Updated KDevelop files. Index: opal.kdevelop =================================================================== RCS file: /cvsroot/opal/opal/scripts/kdevelop/opal.kdevelop,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** opal.kdevelop 9 Dec 2005 17:44:28 -0000 1.1 --- opal.kdevelop 10 Dec 2005 05:57:18 -0000 1.2 *************** *** 3,8 **** <general> <author>Oleksandr Lozitskiy</author> ! <email>mr.olexander@gmail</email> ! <version>0.3.2</version> <projectmanagement>KDevAutoProject</projectmanagement> <primarylanguage>C++</primarylanguage> --- 3,8 ---- <general> <author>Oleksandr Lozitskiy</author> ! <email></email> ! <version>0.4.0</version> <projectmanagement>KDevAutoProject</projectmanagement> <primarylanguage>C++</primarylanguage> *************** *** 14,19 **** <projectdirectory>.</projectdirectory> <absoluteprojectpath>false</absoluteprojectpath> ! <description/> ! <versioncontrol/> </general> <kdevautoproject> --- 14,19 ---- <projectdirectory>.</projectdirectory> <absoluteprojectpath>false</absoluteprojectpath> ! <description></description> ! <versioncontrol></versioncontrol> </general> <kdevautoproject> *************** *** 121,124 **** --- 121,125 ---- </kdevdoctreeview> <kdevfilecreate> + <filetypes/> <useglobaltypes> <type ext="cpp" /> *************** *** 173,177 **** </codecompletion> <creategettersetter> ! <prefixGet/> <prefixSet>set</prefixSet> <prefixVariable>m_,_</prefixVariable> --- 174,178 ---- </codecompletion> <creategettersetter> ! <prefixGet></prefixGet> <prefixSet>set</prefixSet> <prefixVariable>m_,_</prefixVariable> *************** *** 194,203 **** <kdevdebugger> <general> ! <programargs/> ! <gdbpath/> ! <dbgshell/> ! <configGdbScript/> ! <runShellScript/> ! <runGdbScript/> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> --- 195,204 ---- <kdevdebugger> <general> ! <programargs></programargs> ! <gdbpath></gdbpath> ! <dbgshell></dbgshell> ! <configGdbScript></configGdbScript> ! <runShellScript></runShellScript> ! <runGdbScript></runGdbScript> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> |
From: Olex <ole...@us...> - 2005-12-10 05:32:58
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13503/src Modified Files: VelocityMotor.h Log Message: Doxygen fix. Index: VelocityMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/VelocityMotor.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VelocityMotor.h 10 Dec 2005 05:18:35 -0000 1.1 --- VelocityMotor.h 10 Dec 2005 05:32:48 -0000 1.2 *************** *** 45,49 **** * Tries to achieve given velocity in one time step of the simulation. * ! * @author Oleksandr Lozitskiy <mr.olexander@gmail> */ class VelocityMotor : public Motor --- 45,49 ---- * Tries to achieve given velocity in one time step of the simulation. * ! * @author Oleksandr Lozitskiy */ class VelocityMotor : public Motor |
From: Olex <ole...@us...> - 2005-12-10 05:18:45
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11266/src Modified Files: Makefile.am Makefile.in Matrix44r.h MotorData.h OpalMath.h Simulator.cpp Simulator.h opal.h testMatrix44r.cpp Added Files: VelocityMotor.cpp VelocityMotor.h VelocityMotorData.h testBlueprint.cpp testMath.cpp testVelocityMotor.cpp Log Message: Implemented VelocityMotor and its unit test. Adjusted QuickTest. Added opal::normalizeDegrees(). --- NEW FILE: VelocityMotorData.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_MOTOR_DATA_H #define OPAL_VELOCITY_MOTOR_DATA_H // class headers #include "MotorData.h" // project headers #include "Defines.h" namespace opal { /// A data structure describing a VelocityMotor. class VelocityMotorData : public MotorData { public: OPAL_DECL VelocityMotorData() : MotorData() { mType = VELOCITY_MOTOR; solid = NULL; internal_solidIndex = 0; solidBlueprintRefName = ""; velocity = Vec3r( 0, 0, 0 ); maxForce = 1; letGravityAffectSolid = false; } /// Copy constructor. OPAL_DECL VelocityMotorData( const VelocityMotorData& data ) { ( *this ) = data; } OPAL_DECL virtual ~VelocityMotorData() {} /// Makes a deep copy. OPAL_DECL virtual void OPAL_CALL operator=( const VelocityMotorData& data ) { mType = data.mType; enabled = data.enabled; name = data.name; solid = data.solid; internal_solidIndex = data.internal_solidIndex; solidBlueprintRefName = data.solidBlueprintRefName; velocity = data.velocity; maxForce = data.maxForce; letGravityAffectSolid = data.letGravityAffectSolid; } /// Pointer to the Solid. Solid* solid; /// Maximum force that can be used to achieve target velocity. real maxForce; /// if true, the solid will be affected by gravity bool letGravityAffectSolid; /// Internal data used for Blueprint instantiation. int internal_solidIndex; /// String used for for intra-Blueprint references. std::string solidBlueprintRefName; /// The velocity that is to be achieved every frame Vec3r velocity; protected: private: }; } #endif Index: opal.h =================================================================== RCS file: /cvsroot/opal/opal/src/opal.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** opal.h 1 Dec 2005 02:04:54 -0000 1.30 --- opal.h 10 Dec 2005 05:18:35 -0000 1.31 *************** *** 49,52 **** --- 49,54 ---- #include "ThrusterMotor.h" #include "ThrusterMotorData.h" + #include "VelocityMotor.h" + #include "VelocityMotorData.h" #include "SpringMotor.h" #include "SpringMotorData.h" Index: Makefile.in =================================================================== RCS file: /cvsroot/opal/opal/src/Makefile.in,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.in 9 Dec 2005 18:11:23 -0000 1.9 --- Makefile.in 10 Dec 2005 05:18:35 -0000 1.10 *************** *** 63,67 **** SolidData.$(OBJEXT) Space.$(OBJEXT) SpringMotor.$(OBJEXT) \ ThrusterMotor.$(OBJEXT) VolumeSensor.$(OBJEXT) Vec3r.$(OBJEXT) \ ! Quaternion.$(OBJEXT) libopalode_a_OBJECTS = $(am_libopalode_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" --- 63,67 ---- SolidData.$(OBJEXT) Space.$(OBJEXT) SpringMotor.$(OBJEXT) \ ThrusterMotor.$(OBJEXT) VolumeSensor.$(OBJEXT) Vec3r.$(OBJEXT) \ ! Quaternion.$(OBJEXT) VelocityMotor.$(OBJEXT) libopalode_a_OBJECTS = $(am_libopalode_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" *************** *** 72,76 **** testSimulator.$(OBJEXT) testVec3r.$(OBJEXT) \ testPoint3r.$(OBJEXT) testQuaternion.$(OBJEXT) \ ! testMatrix44r.$(OBJEXT) testBlueprint.$(OBJEXT) test_opal_OBJECTS = $(am_test_opal_OBJECTS) test_opal_DEPENDENCIES = \ --- 72,77 ---- testSimulator.$(OBJEXT) testVec3r.$(OBJEXT) \ testPoint3r.$(OBJEXT) testQuaternion.$(OBJEXT) \ ! testMatrix44r.$(OBJEXT) testBlueprint.$(OBJEXT) \ ! testMath.$(OBJEXT) testVelocityMotor.$(OBJEXT) test_opal_OBJECTS = $(am_test_opal_OBJECTS) test_opal_DEPENDENCIES = \ *************** *** 208,224 **** 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 Quaternion.cpp test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.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 all: all-recursive --- 209,225 ---- 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 Quaternion.cpp VelocityMotor.cpp test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.cpp testMath.cpp testVelocityMotor.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 VelocityMotor.h VelocityMotorData.h all: all-recursive *************** *** 321,327 **** --- 322,330 ---- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ThrusterMotor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Vec3r.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VelocityMotor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VolumeSensor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testAccelerationSensor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testBlueprint.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMatrix44r.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testPoint3r.Po@am__quote@ *************** *** 330,333 **** --- 333,337 ---- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testSimulator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testVec3r.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testVelocityMotor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testopal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsolid.Po@am__quote@ --- NEW FILE: testVelocityMotor.cpp --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * Oleksandr Lozitskiy mr....@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. * * * *************************************************************************/ // system headers #include <quicktest.h> // project headers #include "opal.h" using namespace opal; namespace testVelocityMotor { QT_TEST( constructor ) { Simulator * sim = createSimulator(); VelocityMotor * motor = sim->createVelocityMotor(); sim->destroyMotor( motor ); sim->destroy(); } class Fixture { public: Fixture() { sim = createSimulator(); sim->setGravity( Vec3r( 0, -9.81, 0 ) ); solid = sim->createSolid(); SphereShapeData data; data.radius = 1; data.material.density = 1; solid->addShape( data ); motor = sim->createVelocityMotor(); VelocityMotorData vdata; vdata.solid = solid; vdata.maxForce = 1000; motor->init( vdata ); } ~Fixture() { sim->destroyMotor( motor ); sim->destroySolid( solid ); sim->destroy(); } Simulator * sim; Solid * solid; VelocityMotor * motor; }; QT_TEST( check_default ) { Fixture f; f.sim->simulate( 0.2 ); QT_CHECK_CLOSE( f.solid->getGlobalLinearVel().x + f.solid->getGlobalLinearVel().z, 0 ); } QT_TEST( check_movement ) { Fixture f; f.motor->setVelocity( Vec3r( 1, 0, 0 ) ); f.sim->simulate( 0.2 ); QT_CHECK( f.solid->getGlobalLinearVel().length() > 0 ); } QT_TEST( check_achieving_velocity ) { Fixture f; f.motor->setVelocity( Vec3r( 1, 0, 0 ) ); for ( int i = 0; i < 5; ++i ) f.sim->simulate( 0.2 ); QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().x, 1, 0.01 ); // don't care about .y here QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().z, 0, 0.01 ); } QT_TEST( check_achieving_velocity_after_changing_it ) { Fixture f; f.motor->setVelocity( Vec3r( 1, 0, 0 ) ); for ( int i = 0; i < 5; ++i ) f.sim->simulate( 0.2 ); f.motor->setVelocity( Vec3r( 0, 0, 1 ) ); for ( int i = 0; i < 5; ++i ) f.sim->simulate( 0.2 ); QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().x, 0, 0.01 ); // don't care about .y here QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().z, 1, 0.01 ); } QT_TEST( check_achieving_velocity_upward ) { Fixture f; f.motor->setVelocity( Vec3r( 0, 1, 0 ) ); f.motor->letGravityAffectSolid( false ); for ( int i = 0; i < 50; ++i ) f.sim->simulate( 0.2 ); QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().x, 0, 0.01 ); QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().y, 1, 0.01 ); QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().z, 0, 0.01 ); } QT_TEST( check_achieving_velocity_downward ) { Fixture f; f.motor->setVelocity( Vec3r( 0, -1, 0 ) ); f.motor->letGravityAffectSolid( false ); for ( int i = 0; i < 5; ++i ) f.sim->simulate( 0.2 ); QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().x, 0, 0.01 ); QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().y, -1, 0.01 ); QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().z, 0, 0.01 ); } QT_TEST( check_achieving_velocity_while_allowing_gravity ) { Fixture f; f.motor->setVelocity( Vec3r( 1, 0, 0 ) ); f.motor->letGravityAffectSolid( true ); for ( int i = 0; i < 5; ++i ) f.sim->simulate( 0.2 ); QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().x, 1, 0.01 ); QT_CHECK_LESS( f.solid->getGlobalLinearVel().y, -0.1 ); QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().z, 0, 0.01 ); } QT_TEST( enable_disable ) { Fixture f; f.motor->setVelocity( Vec3r( 0, 1, 0 ) ); f.motor->setEnabled( true ); f.sim->simulate( 0.2 ); QT_CHECK_GREATER( f.solid->getGlobalLinearVel().y, 0 ); real y = f.solid->getGlobalLinearVel().y; f.motor->setEnabled( false ); f.sim->simulate( 0.2 ); QT_CHECK_LESS( f.solid->getGlobalLinearVel().y, y ); y = f.solid->getGlobalLinearVel().y; f.motor->setEnabled( true ); f.sim->simulate( 0.2 ); QT_CHECK_GREATER( f.solid->getGlobalLinearVel().y, y ); } QT_TEST( not_enough_force ) { Fixture f; f.motor->setVelocity( Vec3r( 0, 1, 0 ) ); f.motor->setMaximumForce( 1 ); f.sim->simulate( 0.2 ); QT_CHECK_LESS( f.solid->getGlobalLinearVel().y, 0.5 ); f.motor->setMaximumForce( 1000 ); f.sim->simulate( 0.2 ); QT_CHECK_CLOSE_CUSTOM( f.solid->getGlobalLinearVel().y, 1, 0.01 ); } } Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Simulator.cpp 1 Dec 2005 02:04:54 -0000 1.68 --- Simulator.cpp 10 Dec 2005 05:18:35 -0000 1.69 *************** *** 26,30 **** --- 26,33 ---- *************************************************************************/ + // class headers #include "Simulator.h" + + // project headers #include "BlueprintInstance.h" #include "BoxShapeData.h" *************** *** 42,45 **** --- 45,49 ---- #include "VolumeSensor.h" #include "PostStepEventHandler.h" + #include "VelocityMotor.h" namespace opal *************** *** 793,796 **** --- 797,807 ---- } + VelocityMotor* Simulator::createVelocityMotor() + { + VelocityMotor * newMotor = new VelocityMotor( this ); + addMotor( newMotor ); + return newMotor; + } + GearedMotor* Simulator::createGearedMotor() { Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** Simulator.h 26 Nov 2005 22:40:18 -0000 1.102 --- Simulator.h 10 Dec 2005 05:18:35 -0000 1.103 *************** *** 45,48 **** --- 45,49 ---- class SpringMotor; class ThrusterMotor; + class VelocityMotor; class AccelerationSensor; class InclineSensor; *************** *** 308,311 **** --- 309,315 ---- virtual ThrusterMotor* OPAL_CALL createThrusterMotor(); + /// Creates and returns a pointer to a VelocityMotor. + virtual VelocityMotor* OPAL_CALL createVelocityMotor(); + /// Creates and returns a pointer to a GearedMotor. virtual GearedMotor* OPAL_CALL createGearedMotor(); --- NEW FILE: VelocityMotor.cpp --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * Oleksandr Lozitskiy mr....@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. * * * *************************************************************************/ // class headers #include "VelocityMotor.h" // project headers #include "Simulator.h" namespace opal { VelocityMotor::VelocityMotor( Simulator * sim ) { mSimulator = sim; } VelocityMotor::~VelocityMotor() {} void VelocityMotor::setVelocity( const Vec3r & velocity ) { mData.velocity = velocity; } const Vec3r & VelocityMotor::getVelocity() const { return mData.velocity; } void VelocityMotor::init( const VelocityMotorData & data ) { Motor::init(); mData = data; if ( mData.solid ) { mData.solid->setLinearDamping( 0 ); } } void VelocityMotor::setEnabled( bool e ) { mData.enabled = e; } bool VelocityMotor::isEnabled() const { return mData.enabled; } MotorType VelocityMotor::getType() const { return VELOCITY_MOTOR; } void VelocityMotor::setName( const std::string& name ) { mData.name = name; } const std::string & VelocityMotor::getName() const { return mData.name; } bool VelocityMotor::internal_dependsOnSolid( Solid * s ) const { if ( mData.solid == s ) return true; else return false; } void VelocityMotor::letGravityAffectSolid( bool affect ) { mData.letGravityAffectSolid = affect; } bool VelocityMotor::doesGravityAffectSolid() const { return mData.letGravityAffectSolid; } void VelocityMotor::internal_update() { // check if we have a solid if ( mData.solid == NULL || isEnabled() == false ) return ; Vec3r targetVelocity = mData.velocity; Solid * solid = mData.solid; Vec3r currentAchievedVelocity = solid->getGlobalLinearVel(); if ( doesGravityAffectSolid() ) { Vec3r gravity = mSimulator->getGravity(); if ( gravity.length() > 0 ) { Vec3r gravity_velocity = project( gravity, currentAchievedVelocity ); currentAchievedVelocity -= gravity_velocity; } } Vec3r deltaVelocity = targetVelocity - currentAchievedVelocity; Vec3r forceVector = deltaVelocity / mSimulator->getStepSize() * solid->getMass(); if ( !doesGravityAffectSolid() ) forceVector -= mSimulator->getGravity() * solid->getMass(); if ( forceVector.length() > getMaximumForce() ) { forceVector.normalize(); forceVector *= getMaximumForce(); } Force controllingForce; controllingForce.duration = 0; controllingForce.singleStep = true; controllingForce.type = GLOBAL_FORCE; controllingForce.vec = forceVector; solid->addForce( controllingForce ); } void VelocityMotor::setMaximumForce( real maxForce ) { mData.maxForce = maxForce; } real VelocityMotor::getMaximumForce() const { return mData.maxForce; } } --- NEW FILE: testBlueprint.cpp --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * Oleksandr Lozitskiy mr....@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. * * * *************************************************************************/ // system headers #include <quicktest.h> #include <sstream> // project headers #include "opal.h" using namespace opal; namespace testBlueprint { QT_TEST( create_and_delete ) { Simulator * sim = createSimulator(); // Create a SolidData object. SolidData solid1Data; solid1Data.name = "object"; BoxShapeData boxData; solid1Data.addShape( boxData ); // Setup a Blueprint. Blueprint bp; bp.addSolid( &solid1Data ); bp.finalize(); sim->simulate( 0.2 ); QT_CHECK_EQUAL( sim->getNumSolids(), 0 ); { // Instantiate the Blueprint. BlueprintInstance instance; sim->instantiateBlueprint( instance, bp ); QT_CHECK_EQUAL( sim->getNumSolids(), 1 ); unsigned int nsolids = instance.getNumSolids(); for ( unsigned int i = 0; i < nsolids; ++i ) { sim->destroySolid( instance.getSolid( i ) ); } } sim->simulate( 0.2 ); QT_CHECK_EQUAL( sim->getNumSolids(), 0 ); } class MockCollisionHandler : public CollisionEventHandler { public: MockCollisionHandler() {} void handleCollisionEvent( const CollisionEvent & e ) { // nothing } }; QT_TEST( create_and_delete_with_callback ) { Simulator * sim = createSimulator(); // Create a SolidData object. SolidData solid1Data; solid1Data.name = "object"; BoxShapeData boxData; solid1Data.addShape( boxData ); // Setup a Blueprint. Blueprint bp; bp.addSolid( &solid1Data ); bp.finalize(); sim->simulate( 0.2 ); QT_CHECK_EQUAL( sim->getNumSolids(), 0 ); { // Instantiate the Blueprint. BlueprintInstance instance; sim->instantiateBlueprint( instance, bp ); QT_CHECK_EQUAL( sim->getNumSolids(), 1 ); MockCollisionHandler * callback = new MockCollisionHandler(); instance.getSolid( "object" ) ->setCollisionEventHandler( callback ); sim->simulate( 0.2 ); unsigned int nsolids = instance.getNumSolids(); for ( unsigned int i = 0; i < nsolids; ++i ) { sim->destroySolid( instance.getSolid( i ) ); } delete callback; } sim->simulate( 0.2 ); QT_CHECK_EQUAL( sim->getNumSolids(), 0 ); } } --- NEW FILE: testMath.cpp --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * Oleksandr Lozitskiy mr....@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. * * * *************************************************************************/ // system headers #include <quicktest.h> // project headers #include "opal.h" using namespace opal; namespace testOpalMath { QT_TEST( normalizeDegrees ) { QT_CHECK_EQUAL( normalizeDegrees( 179.0 ), 179.0 ); QT_CHECK_EQUAL( normalizeDegrees( 180.0 ) , 180.0 ); QT_CHECK_EQUAL( normalizeDegrees( -179.0 ) , -179.0 ); QT_CHECK_EQUAL( normalizeDegrees( -180.0 ) , 180.0 ); QT_CHECK_EQUAL( normalizeDegrees( 360.0 + 20.0 ) , 20.0 ); QT_CHECK_EQUAL( normalizeDegrees( 360.0 + -20.0 ) , -20.0 ); QT_CHECK_EQUAL( normalizeDegrees( 180.0 + 20.0 ) , -160.0 ); } } --- NEW FILE: VelocityMotor.h --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * Oleksandr Lozitskiy mr....@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 OPALVELOCITYMOTOR_H #define OPALVELOCITYMOTOR_H // class headers #include "Motor.h" // project headers #include "Portability.h" #include "VelocityMotorData.h" namespace opal { class Simulator; class VelocityMotorData; /** * Tries to achieve given velocity in one time step of the simulation. * * @author Oleksandr Lozitskiy <mr.olexander@gmail> */ class VelocityMotor : public Motor { public: //! constructor /*! * @param sim physical simulator */ VelocityMotor( Simulator * sim ); //! destructor ~VelocityMotor(); /// Initializes the Motor with the given data structure. void OPAL_CALL init( const VelocityMotorData & data ); /// Sets whether the Motor has any effect. void OPAL_CALL setEnabled( bool e ); /// Returns true if the Motor is enabled. bool OPAL_CALL isEnabled() const; /// Returns the Motor type. MotorType OPAL_CALL getType() const; /// Sets the Motor's name. void OPAL_CALL setName( const std::string & name ); /// Returns the Motor's name. const std::string & OPAL_CALL getName() const; /// Set target velocity. void OPAL_CALL setVelocity( const Vec3r & velocity ); /// Return target velocity. const Vec3r & OPAL_CALL getVelocity() const; /// Called regularly to update the Motor. This does nothing if the /// Motor is disabled. void OPAL_CALL internal_update(); //! Returns true if motors controls this solid. bool OPAL_CALL internal_dependsOnSolid( Solid * s ) const; //! against gravity or not? /*! * @param affect if true, motor will NOT work against gravity, * so solid will be affected by gravity */ void OPAL_CALL letGravityAffectSolid( bool affect ); //! Returns true if gravity is being ignored by the motor bool OPAL_CALL doesGravityAffectSolid() const; //! Maximum allowed force for the motor to use. void OPAL_CALL setMaximumForce( real maxForce ); //! What is the maximum allowed force for this motor? real OPAL_CALL getMaximumForce() const; protected: /// Stores data describing the Motor. VelocityMotorData mData; private: Simulator * mSimulator; }; } #endif Index: MotorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/MotorData.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MotorData.h 11 Mar 2005 05:31:56 -0000 1.3 --- MotorData.h 10 Dec 2005 05:18:35 -0000 1.4 *************** *** 40,44 **** SERVO_MOTOR, SPRING_MOTOR, ! THRUSTER_MOTOR }; --- 40,45 ---- SERVO_MOTOR, SPRING_MOTOR, ! THRUSTER_MOTOR, ! VELOCITY_MOTOR }; Index: OpalMath.h =================================================================== RCS file: /cvsroot/opal/opal/src/OpalMath.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** OpalMath.h 30 Nov 2005 06:28:12 -0000 1.15 --- OpalMath.h 10 Dec 2005 05:18:35 -0000 1.16 *************** *** 1,28 **** /************************************************************************* ! * * ! * 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_OPAL_MATH_H --- 1,28 ---- /************************************************************************* ! * * ! * 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_OPAL_MATH_H *************** *** 34,100 **** namespace opal { ! #ifdef OPAL_USE_DOUBLE ! typedef double real; ! #else ! typedef float real; ! #endif ! namespace globals ! { ! const real OPAL_PI = (real)3.14159265358979323846; ! const real OPAL_HALF_PI = (real)1.57079632679489661923; ! const real OPAL_ONE_THIRD = (real)0.33333333333333333333; ! const real OPAL_EPSILON = (real)0.000001; ! } ! /// Converts a value from degrees to radians. ! inline real degToRad(real deg) ! { ! const real d2r = globals::OPAL_PI/(real)180.0; ! return (d2r * deg); ! } ! /// Converts a value from radians to degrees. ! inline real radToDeg(real rad) ! { ! const real r2d = (real)180.0/globals::OPAL_PI; ! return (r2d * rad); ! } ! /// Returns the absolute value of a real number. ! inline real abs(real value) ! { ! return fabs(value); ! } ! /// Returns true if the two values are equal within some tolerance, ! /// using a combination of absolute and relative (epsilon is scaled ! /// by the magnitudes of the values) tolerance, depending on whether ! /// both values are both less than 1. ! /// See Christer Ericson's GDC 2005 presentation: ! /// http://realtimecollisiondetection.net/pubs/GDC05_Ericson_Numerical_Robustness_for_Geometric_Calculations.ppt ! inline bool areEqual(real x, real y) ! { ! real maxVal = 1; ! if (opal::abs(x) > maxVal) ! { ! maxVal = opal::abs(x); ! } ! if (opal::abs(y) > maxVal) ! { ! maxVal = opal::abs(y); ! } ! if (opal::abs(x - y) <= globals::OPAL_EPSILON * maxVal) ! { ! return true; ! } ! else ! { ! return false; ! } ! } } --- 34,114 ---- namespace opal { ! #ifdef OPAL_USE_DOUBLE ! typedef double real; ! #else ! typedef float real; ! #endif ! namespace globals ! { ! const real OPAL_PI = ( real ) 3.14159265358979323846; ! const real OPAL_HALF_PI = ( real ) 1.57079632679489661923; ! const real OPAL_ONE_THIRD = ( real ) 0.33333333333333333333; ! const real OPAL_EPSILON = ( real ) 0.000001; ! } ! /// Converts a value from degrees to radians. ! inline real degToRad( real deg ) ! { ! const real d2r = globals::OPAL_PI / ( real ) 180.0; ! return ( d2r * deg ); ! } ! /// Converts a value from radians to degrees. ! inline real radToDeg( real rad ) ! { ! const real r2d = ( real ) 180.0 / globals::OPAL_PI; ! return ( r2d * rad ); ! } ! /// Returns the absolute value of a real number. ! inline real abs( real value ) ! { ! return fabs( value ); ! } ! /// Returns true if the two values are equal within some tolerance, ! /// using a combination of absolute and relative (epsilon is scaled ! /// by the magnitudes of the values) tolerance, depending on whether ! /// both values are both less than 1. ! /// See Christer Ericson's GDC 2005 presentation: ! /// http://realtimecollisiondetection.net/pubs/GDC05_Ericson_Numerical_Robustness_for_Geometric_Calculations.ppt ! inline bool areEqual( real x, real y ) ! { ! real maxVal = 1; ! if ( opal::abs( x ) > maxVal ) ! { ! maxVal = opal::abs( x ); ! } ! if ( opal::abs( y ) > maxVal ) ! { ! maxVal = opal::abs( y ); ! } ! if ( opal::abs( x - y ) <= globals::OPAL_EPSILON * maxVal ) ! { ! return true; ! } ! else ! { ! return false; ! } ! } ! ! //! translates degree angle to (-180, 180] ! inline real normalizeDegrees( real degrees ) ! { ! while ( degrees > 180.0 ) ! { ! degrees -= 360.0; ! } ! while ( degrees <= -180.0 ) ! { ! degrees += 360.0; ! } ! return degrees; ! } } Index: testMatrix44r.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/testMatrix44r.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testMatrix44r.cpp 9 Dec 2005 18:11:23 -0000 1.3 --- testMatrix44r.cpp 10 Dec 2005 05:18:35 -0000 1.4 *************** *** 41,45 **** Matrix44r m; m.setQuaternion( 0, 0, 0, 1 ); ! QT_CHECK_EQUAL( m.getEulerXYZ(), Vec3r( 0, 0, -180 ) ); QT_CHECK_EQUAL( m.getQuaternion(), Quaternion( 0, 0, 0, 1 ) ); --- 41,45 ---- Matrix44r m; m.setQuaternion( 0, 0, 0, 1 ); ! QT_CHECK_EQUAL( m.getEulerXYZ(), Vec3r( 0, 0, 180 ) ); QT_CHECK_EQUAL( m.getQuaternion(), Quaternion( 0, 0, 0, 1 ) ); *************** *** 51,55 **** Matrix44r m; m.setQuaternion( Quaternion( 0, 0, 0, 1 ) ); ! QT_CHECK_EQUAL( m.getEulerXYZ(), Vec3r( 0, 0, -180 ) ); QT_CHECK_EQUAL( m.getQuaternion(), Quaternion( 0, 0, 0, 1 ) ); --- 51,55 ---- Matrix44r m; m.setQuaternion( Quaternion( 0, 0, 0, 1 ) ); ! QT_CHECK_EQUAL( m.getEulerXYZ(), Vec3r( 0, 0, 180 ) ); QT_CHECK_EQUAL( m.getQuaternion(), Quaternion( 0, 0, 0, 1 ) ); Index: Makefile.am =================================================================== RCS file: /cvsroot/opal/opal/src/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.am 9 Dec 2005 18:11:23 -0000 1.9 --- Makefile.am 10 Dec 2005 05:18:35 -0000 1.10 *************** *** 9,21 **** 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 Quaternion.cpp bin_PROGRAMS = test_opal test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.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 --- 9,21 ---- 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 Quaternion.cpp VelocityMotor.cpp bin_PROGRAMS = test_opal test_opal_SOURCES = testopal.cpp testsolid.cpp testAccelerationSensor.cpp \ ! testRaycastSensor.cpp testSimulator.cpp testVec3r.cpp testPoint3r.cpp testQuaternion.cpp \ ! testMatrix44r.cpp testBlueprint.cpp testMath.cpp testVelocityMotor.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 VelocityMotor.h VelocityMotorData.h Index: Matrix44r.h =================================================================== RCS file: /cvsroot/opal/opal/src/Matrix44r.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Matrix44r.h 1 Dec 2005 23:55:21 -0000 1.40 --- Matrix44r.h 10 Dec 2005 05:18:35 -0000 1.41 *************** *** 370,373 **** --- 370,378 ---- } + // normalize to (-180,180] + angles[ 0 ] = normalizeDegrees( angles[ 0 ] ); + angles[ 1 ] = normalizeDegrees( angles[ 1 ] ); + angles[ 2 ] = normalizeDegrees( angles[ 2 ] ); + // convert to degrees angles[ 0 ] = radToDeg( angles[ 0 ] ); |
From: Olex <ole...@us...> - 2005-12-10 05:18:43
|
Update of /cvsroot/opal/opal/src/external/quicktest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11266/src/external/quicktest Modified Files: quicktest.h Log Message: Implemented VelocityMotor and its unit test. Adjusted QuickTest. Added opal::normalizeDegrees(). Index: quicktest.h =================================================================== RCS file: /cvsroot/opal/opal/src/external/quicktest/quicktest.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** quicktest.h 4 Dec 2005 03:27:11 -0000 1.7 --- quicktest.h 10 Dec 2005 05:18:35 -0000 1.8 *************** *** 549,553 **** } ! /// Checks whether the first parameter is less than the second. --- 549,566 ---- } ! /// Checks whether the first parameter is within the given tolerance from ! /// the second parameter. This is useful for comparing floating point ! /// values. ! #define QT_CHECK_CLOSE_CUSTOM(value1, value2, tolerance)\ ! {\ ! if (abs((value1)-(value2)) > tolerance)\ ! {\ ! std::ostringstream oss;\ ! oss << "value1 (" << (value1) << ") should be close to "\ ! << "value2 (" << (value2) << ")";\ ! recordFailure(_result, __FILE__, __LINE__, oss.str());\ ! return;\ ! }\ ! } /// Checks whether the first parameter is less than the second. |