├── Cubes.sublime-project ├── Cubes.sublime-workspace ├── Demo.cpp ├── Makefile ├── PreCompiled.h ├── TODO ├── UnitTest.cpp ├── client ├── Platform.cpp ├── Platform.h ├── Render.cpp ├── Render.h ├── View.cpp └── View.h ├── demos ├── Demo.h ├── DeterministicLockstepDemo.h ├── InterpolationExtrapolationDemo.h └── SingleplayerDemo.h ├── network ├── resources ├── UnitTest++.zip ├── ode-0.11.1.zip └── ode-0.11.1 │ ├── CHANGELOG.txt │ ├── GIMPACT │ ├── GIMPACT-LICENSE-BSD.TXT │ ├── GIMPACT-LICENSE-LGPL.TXT │ ├── Makefile.am │ ├── Makefile.in │ ├── include │ │ ├── GIMPACT │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── gim_boxpruning.h │ │ │ ├── gim_contact.h │ │ │ ├── gim_geometry.h │ │ │ ├── gim_math.h │ │ │ ├── gim_memory.h │ │ │ ├── gim_radixsort.h │ │ │ ├── gim_tri_capsule_collision.h │ │ │ ├── gim_tri_collision.h │ │ │ ├── gim_tri_sphere_collision.h │ │ │ ├── gim_trimesh.h │ │ │ └── gimpact.h │ │ ├── Makefile.am │ │ └── Makefile.in │ └── src │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── gim_boxpruning.cpp │ │ ├── gim_contact.cpp │ │ ├── gim_math.cpp │ │ ├── gim_memory.cpp │ │ ├── gim_tri_tri_overlap.cpp │ │ ├── gim_trimesh.cpp │ │ ├── gim_trimesh_capsule_collision.cpp │ │ ├── gim_trimesh_ray_collision.cpp │ │ ├── gim_trimesh_sphere_collision.cpp │ │ ├── gim_trimesh_trimesh_collision.cpp │ │ └── gimpact.cpp │ ├── INSTALL.txt │ ├── LICENSE-BSD.TXT │ ├── LICENSE.TXT │ ├── Makefile.am │ ├── Makefile.in │ ├── OPCODE │ ├── Ice │ │ ├── IceAABB.cpp │ │ ├── IceAABB.h │ │ ├── IceAxes.h │ │ ├── IceBoundingSphere.h │ │ ├── IceContainer.cpp │ │ ├── IceContainer.h │ │ ├── IceFPU.h │ │ ├── IceHPoint.cpp │ │ ├── IceHPoint.h │ │ ├── IceIndexedTriangle.cpp │ │ ├── IceIndexedTriangle.h │ │ ├── IceLSS.h │ │ ├── IceMatrix3x3.cpp │ │ ├── IceMatrix3x3.h │ │ ├── IceMatrix4x4.cpp │ │ ├── IceMatrix4x4.h │ │ ├── IceMemoryMacros.h │ │ ├── IceOBB.cpp │ │ ├── IceOBB.h │ │ ├── IcePairs.h │ │ ├── IcePlane.cpp │ │ ├── IcePlane.h │ │ ├── IcePoint.cpp │ │ ├── IcePoint.h │ │ ├── IcePreprocessor.h │ │ ├── IceRandom.cpp │ │ ├── IceRandom.h │ │ ├── IceRay.cpp │ │ ├── IceRay.h │ │ ├── IceRevisitedRadix.cpp │ │ ├── IceRevisitedRadix.h │ │ ├── IceSegment.cpp │ │ ├── IceSegment.h │ │ ├── IceTriList.h │ │ ├── IceTriangle.cpp │ │ ├── IceTriangle.h │ │ ├── IceTypes.h │ │ ├── IceUtils.cpp │ │ ├── IceUtils.h │ │ ├── Makefile.am │ │ └── Makefile.in │ ├── Makefile.am │ ├── Makefile.in │ ├── OPC_AABBCollider.cpp │ ├── OPC_AABBCollider.h │ ├── OPC_AABBTree.cpp │ ├── OPC_AABBTree.h │ ├── OPC_BaseModel.cpp │ ├── OPC_BaseModel.h │ ├── OPC_BoxBoxOverlap.h │ ├── OPC_Collider.cpp │ ├── OPC_Collider.h │ ├── OPC_Common.cpp │ ├── OPC_Common.h │ ├── OPC_HybridModel.cpp │ ├── OPC_HybridModel.h │ ├── OPC_IceHook.h │ ├── OPC_LSSAABBOverlap.h │ ├── OPC_LSSCollider.cpp │ ├── OPC_LSSCollider.h │ ├── OPC_LSSTriOverlap.h │ ├── OPC_MeshInterface.cpp │ ├── OPC_MeshInterface.h │ ├── OPC_Model.cpp │ ├── OPC_Model.h │ ├── OPC_OBBCollider.cpp │ ├── OPC_OBBCollider.h │ ├── OPC_OptimizedTree.cpp │ ├── OPC_OptimizedTree.h │ ├── OPC_Picking.cpp │ ├── OPC_Picking.h │ ├── OPC_PlanesAABBOverlap.h │ ├── OPC_PlanesCollider.cpp │ ├── OPC_PlanesCollider.h │ ├── OPC_PlanesTriOverlap.h │ ├── OPC_RayAABBOverlap.h │ ├── OPC_RayCollider.cpp │ ├── OPC_RayCollider.h │ ├── OPC_RayTriOverlap.h │ ├── OPC_Settings.h │ ├── OPC_SphereAABBOverlap.h │ ├── OPC_SphereCollider.cpp │ ├── OPC_SphereCollider.h │ ├── OPC_SphereTriOverlap.h │ ├── OPC_TreeBuilders.cpp │ ├── OPC_TreeBuilders.h │ ├── OPC_TreeCollider.cpp │ ├── OPC_TreeCollider.h │ ├── OPC_TriBoxOverlap.h │ ├── OPC_TriTriOverlap.h │ ├── OPC_VolumeCollider.cpp │ ├── OPC_VolumeCollider.h │ ├── Opcode.cpp │ ├── Opcode.h │ └── Stdafx.h │ ├── README.txt │ ├── aclocal.m4 │ ├── autogen.sh │ ├── build │ ├── config-default.h │ ├── premake4.exe │ └── premake4.lua │ ├── compile │ ├── config.guess │ ├── config.sub │ ├── configure │ ├── configure.in │ ├── depcomp │ ├── drawstuff │ ├── Makefile.am │ ├── Makefile.in │ ├── dstest │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ └── dstest.cpp │ ├── src │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── drawstuff.cpp │ │ ├── internal.h │ │ ├── osx.cpp │ │ ├── resource.h │ │ ├── resources.rc │ │ ├── windows.cpp │ │ └── x11.cpp │ └── textures │ │ ├── checkered.ppm │ │ ├── ground.ppm │ │ ├── sky.ppm │ │ └── wood.ppm │ ├── include │ ├── Makefile.am │ ├── Makefile.in │ ├── drawstuff │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── drawstuff.h │ │ └── version.h │ └── ode │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── README │ │ ├── collision.h │ │ ├── collision_space.h │ │ ├── collision_trimesh.h │ │ ├── common.h │ │ ├── compatibility.h │ │ ├── contact.h │ │ ├── error.h │ │ ├── export-dif.h │ │ ├── mass.h │ │ ├── matrix.h │ │ ├── memory.h │ │ ├── misc.h │ │ ├── objects.h │ │ ├── ode.h │ │ ├── odeconfig.h │ │ ├── odecpp.h │ │ ├── odecpp_collision.h │ │ ├── odeinit.h │ │ ├── odemath.h │ │ ├── rotation.h │ │ └── timer.h │ ├── install-sh │ ├── ltmain.sh │ ├── missing │ ├── ode-config.in │ ├── ode.pc.in │ ├── ode │ ├── Makefile.am │ ├── Makefile.in │ ├── README │ ├── TODO │ ├── demo │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── basket_geom.h │ │ ├── bunny_geom.h │ │ ├── convex_bunny_geom.h │ │ ├── demo_I.cpp │ │ ├── demo_basket.cpp │ │ ├── demo_boxstack.cpp │ │ ├── demo_buggy.cpp │ │ ├── demo_cards.cpp │ │ ├── demo_chain1.c │ │ ├── demo_chain2.cpp │ │ ├── demo_collision.cpp │ │ ├── demo_convex_cd.cpp │ │ ├── demo_crash.cpp │ │ ├── demo_cyl.cpp │ │ ├── demo_cylvssphere.cpp │ │ ├── demo_feedback.cpp │ │ ├── demo_friction.cpp │ │ ├── demo_gyroscopic.cpp │ │ ├── demo_heightfield.cpp │ │ ├── demo_hinge.cpp │ │ ├── demo_jointPR.cpp │ │ ├── demo_jointPU.cpp │ │ ├── demo_joints.cpp │ │ ├── demo_kinematic.cpp │ │ ├── demo_motion.cpp │ │ ├── demo_motor.cpp │ │ ├── demo_moving_convex.cpp │ │ ├── demo_moving_trimesh.cpp │ │ ├── demo_ode.cpp │ │ ├── demo_piston.cpp │ │ ├── demo_plane2d.cpp │ │ ├── demo_slider.cpp │ │ ├── demo_space.cpp │ │ ├── demo_space_stress.cpp │ │ ├── demo_step.cpp │ │ ├── demo_trimesh.cpp │ │ ├── icosahedron_geom.h │ │ ├── texturepath.h │ │ └── world_geom3.h │ ├── doc │ │ ├── Doxyfile │ │ ├── main.dox │ │ └── pix │ │ │ ├── amotor.jpg │ │ │ ├── ball-and-socket-bad.jpg │ │ │ ├── ball-and-socket.jpg │ │ │ ├── body.jpg │ │ │ ├── contact.jpg │ │ │ ├── hinge.jpg │ │ │ ├── hinge2.jpg │ │ │ ├── joints.jpg │ │ │ ├── rollingcontact.jpg │ │ │ ├── sf-graph1.jpg │ │ │ ├── sf-graph2.jpg │ │ │ ├── slider.jpg │ │ │ └── universal.jpg │ └── src │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── array.cpp │ │ ├── array.h │ │ ├── box.cpp │ │ ├── capsule.cpp │ │ ├── collision_cylinder_box.cpp │ │ ├── collision_cylinder_plane.cpp │ │ ├── collision_cylinder_sphere.cpp │ │ ├── collision_cylinder_trimesh.cpp │ │ ├── collision_kernel.cpp │ │ ├── collision_kernel.h │ │ ├── collision_quadtreespace.cpp │ │ ├── collision_sapspace.cpp │ │ ├── collision_space.cpp │ │ ├── collision_space_internal.h │ │ ├── collision_std.h │ │ ├── collision_transform.cpp │ │ ├── collision_transform.h │ │ ├── collision_trimesh_box.cpp │ │ ├── collision_trimesh_ccylinder.cpp │ │ ├── collision_trimesh_colliders.h │ │ ├── collision_trimesh_disabled.cpp │ │ ├── collision_trimesh_distance.cpp │ │ ├── collision_trimesh_gimpact.cpp │ │ ├── collision_trimesh_internal.h │ │ ├── collision_trimesh_opcode.cpp │ │ ├── collision_trimesh_plane.cpp │ │ ├── collision_trimesh_ray.cpp │ │ ├── collision_trimesh_sphere.cpp │ │ ├── collision_trimesh_trimesh.cpp │ │ ├── collision_trimesh_trimesh_new.cpp │ │ ├── collision_util.cpp │ │ ├── collision_util.h │ │ ├── config.h.in │ │ ├── convex.cpp │ │ ├── cylinder.cpp │ │ ├── error.cpp │ │ ├── export-dif.cpp │ │ ├── fastdot.c │ │ ├── fastldlt.c │ │ ├── fastlsolve.c │ │ ├── fastltsolve.c │ │ ├── heightfield.cpp │ │ ├── heightfield.h │ │ ├── joints │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── amotor.cpp │ │ ├── amotor.h │ │ ├── ball.cpp │ │ ├── ball.h │ │ ├── contact.cpp │ │ ├── contact.h │ │ ├── fixed.cpp │ │ ├── fixed.h │ │ ├── hinge.cpp │ │ ├── hinge.h │ │ ├── hinge2.cpp │ │ ├── hinge2.h │ │ ├── joint.cpp │ │ ├── joint.h │ │ ├── joint_internal.h │ │ ├── joints.h │ │ ├── lmotor.cpp │ │ ├── lmotor.h │ │ ├── null.cpp │ │ ├── null.h │ │ ├── piston.cpp │ │ ├── piston.h │ │ ├── plane2d.cpp │ │ ├── plane2d.h │ │ ├── pr.cpp │ │ ├── pr.h │ │ ├── pu.cpp │ │ ├── pu.h │ │ ├── slider.cpp │ │ ├── slider.h │ │ ├── universal.cpp │ │ └── universal.h │ │ ├── lcp.cpp │ │ ├── lcp.h │ │ ├── mass.cpp │ │ ├── mat.cpp │ │ ├── mat.h │ │ ├── matrix.cpp │ │ ├── memory.cpp │ │ ├── misc.cpp │ │ ├── objects.h │ │ ├── obstack.cpp │ │ ├── obstack.h │ │ ├── ode.cpp │ │ ├── odeinit.cpp │ │ ├── odemath.cpp │ │ ├── odeou.cpp │ │ ├── odeou.h │ │ ├── odetls.cpp │ │ ├── odetls.h │ │ ├── plane.cpp │ │ ├── quickstep.cpp │ │ ├── quickstep.h │ │ ├── ray.cpp │ │ ├── rotation.cpp │ │ ├── sphere.cpp │ │ ├── step.cpp │ │ ├── step.h │ │ ├── stepfast.cpp │ │ ├── testing.cpp │ │ ├── testing.h │ │ ├── timer.cpp │ │ ├── util.cpp │ │ └── util.h │ ├── ou │ ├── CHANGELOG.TXT │ ├── INSTALL.TXT │ ├── LICENSE-BSD.TXT │ ├── LICENSE-LESSER.TXT │ ├── LICENSE-ZLIB.TXT │ ├── LICENSE.TXT │ ├── Makefile.am │ ├── Makefile.in │ ├── README.TXT │ ├── aclocal.m4 │ ├── bootstrap │ ├── build │ │ ├── make │ │ │ ├── makefile │ │ │ └── makefile.os │ │ ├── vs2005 │ │ │ ├── ou.sln │ │ │ └── ou.vcproj │ │ └── vs6 │ │ │ ├── ou.dsp │ │ │ └── ou.dsw │ ├── configure │ ├── configure.ac │ ├── include │ │ └── ou │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── assert.h │ │ │ ├── atomic.h │ │ │ ├── atomicflags.h │ │ │ ├── customization.h │ │ │ ├── enumarrays.h │ │ │ ├── flags.h │ │ │ ├── flagsdefines.h │ │ │ ├── inttypes.h │ │ │ ├── macros.h │ │ │ ├── malloc.h │ │ │ ├── namespace.h │ │ │ ├── platform.h │ │ │ ├── simpleflags.h │ │ │ ├── templates.h │ │ │ ├── threadlocalstorage.h │ │ │ └── typewrapper.h │ ├── src │ │ └── ou │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── atomic.cpp │ │ │ ├── customization.cpp │ │ │ ├── malloc.cpp │ │ │ └── threadlocalstorage.cpp │ └── test │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ └── outest.cpp │ ├── tests │ ├── Makefile.am │ ├── Makefile.in │ ├── UnitTest++ │ │ ├── COPYING │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── README │ │ ├── docs │ │ │ └── UnitTest++.html │ │ └── src │ │ │ ├── AssertException.cpp │ │ │ ├── AssertException.h │ │ │ ├── CheckMacros.h │ │ │ ├── Checks.cpp │ │ │ ├── Checks.h │ │ │ ├── Config.h │ │ │ ├── DeferredTestReporter.cpp │ │ │ ├── DeferredTestReporter.h │ │ │ ├── DeferredTestResult.cpp │ │ │ ├── DeferredTestResult.h │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── MemoryOutStream.cpp │ │ │ ├── MemoryOutStream.h │ │ │ ├── Posix │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── SignalTranslator.cpp │ │ │ ├── SignalTranslator.h │ │ │ ├── TimeHelpers.cpp │ │ │ └── TimeHelpers.h │ │ │ ├── ReportAssert.cpp │ │ │ ├── ReportAssert.h │ │ │ ├── Test.cpp │ │ │ ├── Test.h │ │ │ ├── TestDetails.cpp │ │ │ ├── TestDetails.h │ │ │ ├── TestList.cpp │ │ │ ├── TestList.h │ │ │ ├── TestMacros.h │ │ │ ├── TestReporter.cpp │ │ │ ├── TestReporter.h │ │ │ ├── TestReporterStdout.cpp │ │ │ ├── TestReporterStdout.h │ │ │ ├── TestResults.cpp │ │ │ ├── TestResults.h │ │ │ ├── TestRunner.cpp │ │ │ ├── TestRunner.h │ │ │ ├── TestSuite.h │ │ │ ├── TimeConstraint.cpp │ │ │ ├── TimeConstraint.h │ │ │ ├── TimeHelpers.h │ │ │ ├── UnitTest++.h │ │ │ ├── Win32 │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── TimeHelpers.cpp │ │ │ └── TimeHelpers.h │ │ │ ├── XmlTestReporter.cpp │ │ │ └── XmlTestReporter.h │ ├── collision.cpp │ ├── joint.cpp │ ├── joints │ │ ├── ball.cpp │ │ ├── fixed.cpp │ │ ├── hinge.cpp │ │ ├── hinge2.cpp │ │ ├── piston.cpp │ │ ├── pr.cpp │ │ ├── pu.cpp │ │ ├── slider.cpp │ │ └── universal.cpp │ ├── main.cpp │ └── odemath.cpp │ └── tools │ ├── README.txt │ ├── msw-release.bat │ ├── ode_convex_export.py │ └── src-release.sh ├── shared ├── Activation.cpp ├── Activation.h ├── Config.h ├── Cubes.h ├── Engine.cpp ├── Engine.h ├── Game.cpp ├── Game.h ├── Hypercube.h ├── Mathematics.h ├── Simulation.cpp ├── Simulation.h └── ViewObject.h ├── tests └── TestEngine.cpp └── vectorial ├── config.h ├── mat4f.h ├── simd4f.h ├── simd4f_common.h ├── simd4f_gnu.h ├── simd4f_neon.h ├── simd4f_scalar.h ├── simd4f_sse.h ├── simd4x4f.h ├── simd4x4f_gnu.h ├── simd4x4f_neon.h ├── simd4x4f_scalar.h ├── simd4x4f_sse.h ├── vec2f.h ├── vec3f.h └── vec4f.h /Cubes.sublime-project: -------------------------------------------------------------------------------- 1 | { 2 | "folders": 3 | [ 4 | { 5 | "path": "/Users/gaffer/git/cubes" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /PreCompiled.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "network/netConfig.h" 11 | #include "network/netAssert.h" 12 | #include "network/netLog.h" 13 | #include "network/netStream.h" 14 | #include "network/netStats.h" 15 | 16 | #include "client/Platform.h" 17 | #include "client/Render.h" 18 | #include "client/View.h" 19 | 20 | #include "shared/Mathematics.h" 21 | #include "shared/Simulation.h" 22 | #include "shared/Activation.h" 23 | #include "shared/Game.h" 24 | -------------------------------------------------------------------------------- /demos/Demo.h: -------------------------------------------------------------------------------- 1 | /* 2 | Networked Physics Demo 3 | Copyright © 2008-2011 Glenn Fiedler 4 | http://www.gafferongames.com/networking-for-game-programmers 5 | */ 6 | 7 | #ifndef DEMO_H 8 | #define DEMO_H 9 | 10 | #include "PreCompiled.h" 11 | #include "shared/Game.h" 12 | #include "client/View.h" 13 | #include "client/Render.h" 14 | 15 | using namespace game; 16 | using namespace view; 17 | #ifdef HAS_OPENGL 18 | using namespace render; 19 | #endif 20 | using namespace engine; 21 | using namespace platform; 22 | 23 | const float DeltaTime = 1.0f / 60.0f; 24 | 25 | // ------------------------------------------------------------------------- 26 | 27 | class GameWorkerThread : public WorkerThread 28 | { 29 | public: 30 | 31 | GameWorkerThread() 32 | { 33 | instance = NULL; 34 | numSteps = 1; 35 | } 36 | 37 | void Start( game::Interface * instance, float deltaTime = DeltaTime, int numSteps = 1 ) 38 | { 39 | assert( instance ); 40 | this->instance = instance; 41 | this->deltaTime = deltaTime; 42 | this->numSteps = numSteps; 43 | WorkerThread::Start(); 44 | } 45 | 46 | #ifdef HAS_OPENGL 47 | float GetSimTime() const 48 | { 49 | return simTime; 50 | } 51 | #endif 52 | 53 | private: 54 | 55 | virtual void Run() 56 | { 57 | // TODO: port timer to linux 58 | #ifdef HAS_OPENGL 59 | platform::Timer timer; 60 | #endif 61 | for ( int i = 0; i < numSteps; ++i ) 62 | instance->Update( deltaTime ); 63 | #ifdef HAS_OPENGL 64 | simTime = timer.delta(); 65 | #endif 66 | } 67 | 68 | #ifdef HAS_OPENGL 69 | float simTime; 70 | #endif 71 | game::Interface * instance; 72 | int numSteps; 73 | float deltaTime; 74 | }; 75 | 76 | // ------------------------------------------------------ 77 | 78 | class Demo 79 | { 80 | public: 81 | 82 | virtual ~Demo() {} 83 | virtual void InitializeWorld() = 0; 84 | virtual void SetRenderInterface( render::Interface * renderInterface ) = 0; 85 | virtual void ProcessInput( const platform::Input & input ) = 0; 86 | virtual void Update( float deltaTime ) = 0; 87 | virtual void Render( float deltaTime, bool shadows ) = 0; 88 | virtual void WaitForSim() = 0; 89 | }; 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /network: -------------------------------------------------------------------------------- 1 | /Users/gaffer/git/network -------------------------------------------------------------------------------- /resources/UnitTest++.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/UnitTest++.zip -------------------------------------------------------------------------------- /resources/ode-0.11.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1.zip -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/GIMPACT-LICENSE-BSD.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/GIMPACT-LICENSE-BSD.TXT -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = GIMPACT-LICENSE-BSD.TXT GIMPACT-LICENSE-LGPL.TXT 2 | 3 | SUBDIRS = include src 4 | 5 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_HEADERS = \ 2 | gim_boxpruning.h gim_contact.h gim_geometry.h \ 3 | gim_math.h gim_memory.h gimpact.h \ 4 | gim_radixsort.h gim_tri_capsule_collision.h gim_tri_collision.h \ 5 | gim_trimesh.h gim_tri_sphere_collision.h 6 | 7 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_boxpruning.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_boxpruning.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_contact.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_contact.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_geometry.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_geometry.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_math.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_math.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_memory.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_memory.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_radixsort.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_radixsort.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_tri_capsule_collision.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_tri_capsule_collision.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_tri_collision.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_tri_collision.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_tri_sphere_collision.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_tri_sphere_collision.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_trimesh.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/include/GIMPACT/gim_trimesh.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/GIMPACT/gimpact.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/GIMPACT/include/GIMPACT/gimpact.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/include/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = GIMPACT 2 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/src/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libGIMPACT.la 2 | AM_CPPFLAGS = -fno-strict-aliasing \ 3 | -I$(top_srcdir)/include \ 4 | -I$(top_srcdir)/GIMPACT/include 5 | 6 | libGIMPACT_la_SOURCES = gim_boxpruning.cpp \ 7 | gim_contact.cpp \ 8 | gim_math.cpp \ 9 | gim_memory.cpp \ 10 | gim_tri_tri_overlap.cpp \ 11 | gim_trimesh.cpp \ 12 | gim_trimesh_capsule_collision.cpp \ 13 | gim_trimesh_ray_collision.cpp \ 14 | gim_trimesh_sphere_collision.cpp \ 15 | gim_trimesh_trimesh_collision.cpp \ 16 | gimpact.cpp 17 | 18 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/src/gim_math.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ----------------------------------------------------------------------------- 3 | This source file is part of GIMPACT Library. 4 | 5 | For the latest info, see http://gimpact.sourceforge.net/ 6 | 7 | Copyright (c) 2006 Francisco Leon. C.C. 80087371. 8 | email: projectileman@yahoo.com 9 | 10 | This library is free software; you can redistribute it and/or 11 | modify it under the terms of EITHER: 12 | (1) The GNU Lesser General Public License as published by the Free 13 | Software Foundation; either version 2.1 of the License, or (at 14 | your option) any later version. The text of the GNU Lesser 15 | General Public License is included with this library in the 16 | file GIMPACT-LICENSE-LGPL.TXT. 17 | (2) The BSD-style license that is included with this library in 18 | the file GIMPACT-LICENSE-BSD.TXT. 19 | 20 | This library is distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files 23 | GIMPACT-LICENSE-LGPL.TXT and GIMPACT-LICENSE-BSD.TXT for more details. 24 | 25 | ----------------------------------------------------------------------------- 26 | */ 27 | 28 | 29 | #include "GIMPACT/gim_math.h" 30 | #include "stdlib.h" 31 | #include "time.h" 32 | 33 | 34 | GREAL gim_inv_sqrt(GREAL f) 35 | { 36 | GREAL r; 37 | GIM_INV_SQRT(f,r); 38 | return r; 39 | } 40 | 41 | GREAL gim_sqrt(GREAL f) 42 | { 43 | GREAL r; 44 | GIM_SQRT(f,r); 45 | return r; 46 | } 47 | 48 | //!Initializes mathematical functions 49 | void gim_init_math() 50 | { 51 | srand( static_cast< unsigned int >( time( 0 ) ) ); 52 | } 53 | 54 | //! Generates an unit random 55 | GREAL gim_unit_random() 56 | { 57 | GREAL rn = static_cast< GREAL >( rand() ); 58 | rn/=(GREAL)RAND_MAX; 59 | return rn; 60 | } 61 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/GIMPACT/src/gimpact.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | ----------------------------------------------------------------------------- 4 | This source file is part of GIMPACT Library. 5 | 6 | For the latest info, see http://gimpact.sourceforge.net/ 7 | 8 | Copyright (c) 2006 Francisco Leon. C.C. 80087371. 9 | email: projectileman@yahoo.com 10 | 11 | This library is free software; you can redistribute it and/or 12 | modify it under the terms of EITHER: 13 | (1) The GNU Lesser General Public License as published by the Free 14 | Software Foundation; either version 2.1 of the License, or (at 15 | your option) any later version. The text of the GNU Lesser 16 | General Public License is included with this library in the 17 | file GIMPACT-LICENSE-LGPL.TXT. 18 | (2) The BSD-style license that is included with this library in 19 | the file GIMPACT-LICENSE-BSD.TXT. 20 | 21 | This library is distributed in the hope that it will be useful, 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files 24 | GIMPACT-LICENSE-LGPL.TXT and GIMPACT-LICENSE-BSD.TXT for more details. 25 | 26 | ----------------------------------------------------------------------------- 27 | */ 28 | 29 | #include "GIMPACT/gimpact.h" 30 | 31 | 32 | 33 | void gimpact_init() 34 | { 35 | gim_init_math(); 36 | } 37 | 38 | void gimpact_terminate() 39 | { 40 | } 41 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/LICENSE-BSD.TXT: -------------------------------------------------------------------------------- 1 | 2 | This is the BSD-style license for the Open Dynamics Engine 3 | ---------------------------------------------------------- 4 | 5 | Open Dynamics Engine 6 | Copyright (c) 2001-2007, Russell L. Smith. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | Redistributions of source code must retain the above copyright notice, 14 | this list of conditions and the following disclaimer. 15 | 16 | Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | Neither the names of ODE's copyright owner nor the names of its 21 | contributors may be used to endorse or promote products derived from 22 | this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 30 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 31 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 32 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 33 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/Makefile.am: -------------------------------------------------------------------------------- 1 | if ENABLE_OU 2 | OU_DIR = ou 3 | endif 4 | 5 | if ENABLE_DEMOS 6 | DRAWSTUFF_DIR = drawstuff 7 | endif 8 | 9 | if GIMPACT 10 | GIMPACT_DIR = GIMPACT 11 | endif 12 | 13 | if OPCODE 14 | OPCODE_DIR = OPCODE 15 | endif 16 | 17 | SUBDIRS = include \ 18 | $(DRAWSTUFF_DIR) \ 19 | $(GIMPACT_DIR) \ 20 | $(OPCODE_DIR) \ 21 | $(OU_DIR) \ 22 | ode \ 23 | tests 24 | 25 | bin_SCRIPTS = ode-config 26 | 27 | # Utility rule for making a release 28 | release: dist-gzip dist-bzip2 29 | @echo Created release packages for ${PACKAGE}-${VERSION}. 30 | 31 | EXTRA_DIST = autogen.sh build tools \ 32 | CHANGELOG.txt INSTALL.txt README.txt LICENSE.TXT LICENSE-BSD.TXT 33 | 34 | pkgconfigdir = $(libdir)/pkgconfig 35 | pkgconfig_DATA = ode.pc 36 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IceAxes.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains axes definition. 4 | * \file IceAxes.h 5 | * \author Pierre Terdiman 6 | * \date January, 29, 2000 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | // Include Guard 12 | #ifndef __ICEAXES_H__ 13 | #define __ICEAXES_H__ 14 | 15 | enum PointComponent 16 | { 17 | X = 0, 18 | Y = 1, 19 | Z = 2, 20 | W = 3, 21 | 22 | FORCE_DWORD = 0x7fffffff 23 | }; 24 | 25 | enum AxisOrder 26 | { 27 | AXES_XYZ = (X)|(Y<<2)|(Z<<4), 28 | AXES_XZY = (X)|(Z<<2)|(Y<<4), 29 | AXES_YXZ = (Y)|(X<<2)|(Z<<4), 30 | AXES_YZX = (Y)|(Z<<2)|(X<<4), 31 | AXES_ZXY = (Z)|(X<<2)|(Y<<4), 32 | AXES_ZYX = (Z)|(Y<<2)|(X<<4), 33 | 34 | AXES_FORCE_DWORD = 0x7fffffff 35 | }; 36 | 37 | class ICEMATHS_API Axes 38 | { 39 | public: 40 | 41 | inline_ Axes(AxisOrder order) 42 | { 43 | mAxis0 = (order ) & 3; 44 | mAxis1 = (order>>2) & 3; 45 | mAxis2 = (order>>4) & 3; 46 | } 47 | inline_ ~Axes() {} 48 | 49 | udword mAxis0; 50 | udword mAxis1; 51 | udword mAxis2; 52 | }; 53 | 54 | #endif // __ICEAXES_H__ 55 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IceMatrix3x3.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains code for 3x3 matrices. 4 | * \file IceMatrix3x3.cpp 5 | * \author Pierre Terdiman 6 | * \date April, 4, 2000 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | /** 12 | * 3x3 matrix. 13 | * DirectX-compliant, ie row-column order, ie m[Row][Col]. 14 | * Same as: 15 | * m11 m12 m13 first row. 16 | * m21 m22 m23 second row. 17 | * m31 m32 m33 third row. 18 | * Stored in memory as m11 m12 m13 m21... 19 | * 20 | * Multiplication rules: 21 | * 22 | * [x'y'z'] = [xyz][M] 23 | * 24 | * x' = x*m11 + y*m21 + z*m31 25 | * y' = x*m12 + y*m22 + z*m32 26 | * z' = x*m13 + y*m23 + z*m33 27 | * 28 | * \class Matrix3x3 29 | * \author Pierre Terdiman 30 | * \version 1.0 31 | */ 32 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 33 | 34 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 35 | // Precompiled Header 36 | #include "Stdafx.h" 37 | 38 | using namespace IceMaths; 39 | 40 | // Cast operator 41 | Matrix3x3::operator Matrix4x4() const 42 | { 43 | return Matrix4x4( 44 | m[0][0], m[0][1], m[0][2], 0.0f, 45 | m[1][0], m[1][1], m[1][2], 0.0f, 46 | m[2][0], m[2][1], m[2][2], 0.0f, 47 | 0.0f, 0.0f, 0.0f, 1.0f); 48 | } 49 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IcePairs.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains a simple pair class. 4 | * \file IcePairs.h 5 | * \author Pierre Terdiman 6 | * \date January, 13, 2003 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | // Include Guard 12 | #ifndef __ICEPAIRS_H__ 13 | #define __ICEPAIRS_H__ 14 | 15 | //! A generic couple structure 16 | struct ICECORE_API Pair 17 | { 18 | inline_ Pair() {} 19 | inline_ Pair(udword i0, udword i1) : id0(i0), id1(i1) {} 20 | 21 | udword id0; //!< First index of the pair 22 | udword id1; //!< Second index of the pair 23 | }; 24 | 25 | class ICECORE_API Pairs : private Container 26 | { 27 | public: 28 | // Constructor / Destructor 29 | Pairs() {} 30 | ~Pairs() {} 31 | 32 | inline_ udword GetNbPairs() const { return GetNbEntries()>>1; } 33 | inline_ const Pair* GetPairs() const { return (const Pair*)GetEntries(); } 34 | inline_ const Pair* GetPair(udword i) const { return (const Pair*)&GetEntries()[i+i]; } 35 | 36 | inline_ BOOL HasPairs() const { return IsNotEmpty(); } 37 | 38 | inline_ void ResetPairs() { Reset(); } 39 | inline_ void DeleteLastPair() { DeleteLastEntry(); DeleteLastEntry(); } 40 | 41 | inline_ void AddPair(const Pair& p) { Add(p.id0).Add(p.id1); } 42 | inline_ void AddPair(udword id0, udword id1) { Add(id0).Add(id1); } 43 | }; 44 | 45 | #endif // __ICEPAIRS_H__ 46 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IcePlane.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains code for planes. 4 | * \file IcePlane.cpp 5 | * \author Pierre Terdiman 6 | * \date April, 4, 2000 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | /** 12 | * Plane class. 13 | * \class Plane 14 | * \author Pierre Terdiman 15 | * \version 1.0 16 | */ 17 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 18 | 19 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 20 | // Precompiled Header 21 | #include "Stdafx.h" 22 | 23 | using namespace IceMaths; 24 | 25 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 26 | /** 27 | * Computes the plane equation from 3 points. 28 | * \param p0 [in] first point 29 | * \param p1 [in] second point 30 | * \param p2 [in] third point 31 | * \return Self-reference 32 | */ 33 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 34 | Plane& Plane::Set(const Point& p0, const Point& p1, const Point& p2) 35 | { 36 | Point Edge0 = p1 - p0; 37 | Point Edge1 = p2 - p0; 38 | 39 | n = Edge0 ^ Edge1; 40 | n.Normalize(); 41 | 42 | d = -(p0 | n); 43 | 44 | return *this; 45 | } 46 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IceRandom.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains code for random generators. 4 | * \file IceRandom.cpp 5 | * \author Pierre Terdiman 6 | * \date August, 9, 2001 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | // Precompiled Header 12 | #include "Stdafx.h" 13 | 14 | using namespace IceCore; 15 | 16 | void IceCore:: SRand(udword seed) 17 | { 18 | srand(seed); 19 | } 20 | 21 | udword IceCore::Rand() 22 | { 23 | return rand(); 24 | } 25 | 26 | 27 | static BasicRandom gRandomGenerator(42); 28 | 29 | udword IceCore::GetRandomIndex(udword max_index) 30 | { 31 | // We don't use rand() since it's limited to RAND_MAX 32 | udword Index = gRandomGenerator.Randomize(); 33 | return Index % max_index; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IceRandom.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains code for random generators. 4 | * \file IceRandom.h 5 | * \author Pierre Terdiman 6 | * \date August, 9, 2001 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | // Include Guard 12 | #ifndef __ICERANDOM_H__ 13 | #define __ICERANDOM_H__ 14 | 15 | FUNCTION ICECORE_API void SRand(udword seed); 16 | FUNCTION ICECORE_API udword Rand(); 17 | 18 | //! Returns a unit random floating-point value 19 | inline_ float UnitRandomFloat() { return float(Rand()) * ONE_OVER_RAND_MAX; } 20 | 21 | //! Returns a random index so that 0<= index < max_index 22 | ICECORE_API udword GetRandomIndex(udword max_index); 23 | 24 | class ICECORE_API BasicRandom 25 | { 26 | public: 27 | 28 | //! Constructor 29 | inline_ BasicRandom(udword seed=0) : mRnd(seed) {} 30 | //! Destructor 31 | inline_ ~BasicRandom() {} 32 | 33 | inline_ void SetSeed(udword seed) { mRnd = seed; } 34 | inline_ udword GetCurrentValue() const { return mRnd; } 35 | inline_ udword Randomize() { mRnd = mRnd * 2147001325 + 715136305; return mRnd; } 36 | 37 | private: 38 | udword mRnd; 39 | }; 40 | 41 | #endif // __ICERANDOM_H__ 42 | 43 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IceRay.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains code for rays. 4 | * \file IceRay.cpp 5 | * \author Pierre Terdiman 6 | * \date April, 4, 2000 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | /** 12 | * Ray class. 13 | * A ray is a half-line P(t) = mOrig + mDir * t, with 0 <= t <= +infinity 14 | * \class Ray 15 | * \author Pierre Terdiman 16 | * \version 1.0 17 | */ 18 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 19 | 20 | /* 21 | O = Origin = impact point 22 | i = normalized vector along the x axis 23 | j = normalized vector along the y axis = actually the normal vector in O 24 | D = Direction vector, norm |D| = 1 25 | N = Projection of D on y axis, norm |N| = normal reaction 26 | T = Projection of D on x axis, norm |T| = tangential reaction 27 | R = Reflexion vector 28 | 29 | ^y 30 | | 31 | | 32 | | 33 | _ _ _| _ _ _ 34 | * * *| 35 | \ | / 36 | \ |N / | 37 | R\ | /D 38 | \ | / | 39 | \ | / 40 | _________\|/______*_______>x 41 | O T 42 | 43 | Let define theta = angle between D and N. Then cos(theta) = |N| / |D| = |N| since D is normalized. 44 | 45 | j|D = |j|*|D|*cos(theta) => |N| = j|D 46 | 47 | Then we simply have: 48 | 49 | D = N + T 50 | 51 | To compute tangential reaction : 52 | 53 | T = D - N 54 | 55 | To compute reflexion vector : 56 | 57 | R = N - T = N - (D-N) = 2*N - D 58 | */ 59 | 60 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 61 | // Precompiled Header 62 | #include "Stdafx.h" 63 | 64 | using namespace IceMaths; 65 | 66 | float Ray::SquareDistance(const Point& point, float* t) const 67 | { 68 | Point Diff = point - mOrig; 69 | float fT = Diff | mDir; 70 | 71 | if(fT<=0.0f) 72 | { 73 | fT = 0.0f; 74 | } 75 | else 76 | { 77 | fT /= mDir.SquareMagnitude(); 78 | Diff -= fT*mDir; 79 | } 80 | 81 | if(t) *t = fT; 82 | 83 | return Diff.SquareMagnitude(); 84 | } 85 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IceRevisitedRadix.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains source code from the article "Radix Sort Revisited". 4 | * \file IceRevisitedRadix.h 5 | * \author Pierre Terdiman 6 | * \date April, 4, 2000 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | // Include Guard 12 | #ifndef __ICERADIXSORT_H__ 13 | #define __ICERADIXSORT_H__ 14 | 15 | //! Allocate histograms & offsets locally 16 | #define RADIX_LOCAL_RAM 17 | 18 | enum RadixHint 19 | { 20 | RADIX_SIGNED, //!< Input values are signed 21 | RADIX_UNSIGNED, //!< Input values are unsigned 22 | 23 | RADIX_FORCE_DWORD = 0x7fffffff 24 | }; 25 | 26 | class ICECORE_API RadixSort 27 | { 28 | public: 29 | // Constructor/Destructor 30 | RadixSort(); 31 | ~RadixSort(); 32 | // Sorting methods 33 | RadixSort& Sort(const udword* input, udword nb, RadixHint hint=RADIX_SIGNED); 34 | RadixSort& Sort(const float* input, udword nb); 35 | 36 | //! Access to results. mRanks is a list of indices in sorted order, i.e. in the order you may further process your data 37 | inline_ const udword* GetRanks() const { return mRanks; } 38 | 39 | //! mIndices2 gets trashed on calling the sort routine, but otherwise you can recycle it the way you want. 40 | inline_ udword* GetRecyclable() const { return mRanks2; } 41 | 42 | // Stats 43 | udword GetUsedRam() const; 44 | //! Returns the total number of calls to the radix sorter. 45 | inline_ udword GetNbTotalCalls() const { return mTotalCalls; } 46 | //! Returns the number of eraly exits due to temporal coherence. 47 | inline_ udword GetNbHits() const { return mNbHits; } 48 | 49 | private: 50 | #ifndef RADIX_LOCAL_RAM 51 | udword* mHistogram; //!< Counters for each byte 52 | udword* mOffset; //!< Offsets (nearly a cumulative distribution function) 53 | #endif 54 | udword mCurrentSize; //!< Current size of the indices list 55 | udword* mRanks; //!< Two lists, swapped each pass 56 | udword* mRanks2; 57 | // Stats 58 | udword mTotalCalls; //!< Total number of calls to the sort routine 59 | udword mNbHits; //!< Number of early exits due to coherence 60 | // Internal methods 61 | void CheckResize(udword nb); 62 | bool Resize(udword nb); 63 | }; 64 | 65 | #endif // __ICERADIXSORT_H__ 66 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IceSegment.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains code for segments. 4 | * \file IceSegment.cpp 5 | * \author Pierre Terdiman 6 | * \date April, 4, 2000 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | /** 12 | * Segment class. 13 | * A segment is defined by S(t) = mP0 * (1 - t) + mP1 * t, with 0 <= t <= 1 14 | * Alternatively, a segment is S(t) = Origin + t * Direction for 0 <= t <= 1. 15 | * Direction is not necessarily unit length. The end points are Origin = mP0 and Origin + Direction = mP1. 16 | * 17 | * \class Segment 18 | * \author Pierre Terdiman 19 | * \version 1.0 20 | */ 21 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 24 | // Precompiled Header 25 | #include "Stdafx.h" 26 | 27 | using namespace IceMaths; 28 | 29 | float Segment::SquareDistance(const Point& point, float* t) const 30 | { 31 | Point Diff = point - mP0; 32 | Point Dir = mP1 - mP0; 33 | float fT = Diff | Dir; 34 | 35 | if(fT<=0.0f) 36 | { 37 | fT = 0.0f; 38 | } 39 | else 40 | { 41 | float SqrLen= Dir.SquareMagnitude(); 42 | if(fT>=SqrLen) 43 | { 44 | fT = 1.0f; 45 | Diff -= Dir; 46 | } 47 | else 48 | { 49 | fT /= SqrLen; 50 | Diff -= fT*Dir; 51 | } 52 | } 53 | 54 | if(t) *t = fT; 55 | 56 | return Diff.SquareMagnitude(); 57 | } 58 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IceSegment.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains code for segments. 4 | * \file IceSegment.h 5 | * \author Pierre Terdiman 6 | * \date April, 4, 2000 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | // Include Guard 12 | #ifndef __ICESEGMENT_H__ 13 | #define __ICESEGMENT_H__ 14 | 15 | class ICEMATHS_API Segment 16 | { 17 | public: 18 | //! Constructor 19 | inline_ Segment() {} 20 | //! Constructor 21 | inline_ Segment(const Point& p0, const Point& p1) : mP0(p0), mP1(p1) {} 22 | //! Copy constructor 23 | inline_ Segment(const Segment& seg) : mP0(seg.mP0), mP1(seg.mP1) {} 24 | //! Destructor 25 | inline_ ~Segment() {} 26 | 27 | inline_ const Point& GetOrigin() const { return mP0; } 28 | inline_ Point ComputeDirection() const { return mP1 - mP0; } 29 | inline_ void ComputeDirection(Point& dir) const { dir = mP1 - mP0; } 30 | inline_ float ComputeLength() const { return mP1.Distance(mP0); } 31 | inline_ float ComputeSquareLength() const { return mP1.SquareDistance(mP0); } 32 | 33 | inline_ void SetOriginDirection(const Point& origin, const Point& direction) 34 | { 35 | mP0 = mP1 = origin; 36 | mP1 += direction; 37 | } 38 | 39 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 40 | /** 41 | * Computes a point on the segment 42 | * \param pt [out] point on segment 43 | * \param t [in] point's parameter [t=0 => pt = mP0, t=1 => pt = mP1] 44 | */ 45 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 46 | inline_ void ComputePoint(Point& pt, float t) const { pt = mP0 + t * (mP1 - mP0); } 47 | 48 | float SquareDistance(const Point& point, float* t=null) const; 49 | inline_ float Distance(const Point& point, float* t=null) const { return sqrtf(SquareDistance(point, t)); } 50 | 51 | Point mP0; //!< Start of segment 52 | Point mP1; //!< End of segment 53 | }; 54 | 55 | #endif // __ICESEGMENT_H__ 56 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IceTriList.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains code for a triangle container. 4 | * \file IceTrilist.h 5 | * \author Pierre Terdiman 6 | * \date April, 4, 2000 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | // Include Guard 12 | #ifndef __ICETRILIST_H__ 13 | #define __ICETRILIST_H__ 14 | 15 | class ICEMATHS_API TriList : public Container 16 | { 17 | public: 18 | // Constructor / Destructor 19 | TriList() {} 20 | ~TriList() {} 21 | 22 | inline_ udword GetNbTriangles() const { return GetNbEntries()/9; } 23 | inline_ Triangle* GetTriangles() const { return (Triangle*)GetEntries(); } 24 | 25 | void AddTri(const Triangle& tri) 26 | { 27 | Add(tri.mVerts[0].x).Add(tri.mVerts[0].y).Add(tri.mVerts[0].z); 28 | Add(tri.mVerts[1].x).Add(tri.mVerts[1].y).Add(tri.mVerts[1].z); 29 | Add(tri.mVerts[2].x).Add(tri.mVerts[2].y).Add(tri.mVerts[2].z); 30 | } 31 | 32 | void AddTri(const Point& p0, const Point& p1, const Point& p2) 33 | { 34 | Add(p0.x).Add(p0.y).Add(p0.z); 35 | Add(p1.x).Add(p1.y).Add(p1.z); 36 | Add(p2.x).Add(p2.y).Add(p2.z); 37 | } 38 | }; 39 | 40 | class ICEMATHS_API TriangleList : public Container 41 | { 42 | public: 43 | // Constructor / Destructor 44 | TriangleList() {} 45 | ~TriangleList() {} 46 | 47 | inline_ udword GetNbTriangles() const { return GetNbEntries()/3; } 48 | inline_ IndexedTriangle* GetTriangles() const { return (IndexedTriangle*)GetEntries();} 49 | 50 | void AddTriangle(const IndexedTriangle& tri) 51 | { 52 | Add((udword)tri.mVRef[0]).Add((udword)tri.mVRef[1]).Add((udword)tri.mVRef[2]); 53 | } 54 | 55 | void AddTriangle(udword vref0, udword vref1, udword vref2) 56 | { 57 | Add(vref0).Add(vref1).Add(vref2); 58 | } 59 | }; 60 | 61 | #endif //__ICETRILIST_H__ 62 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IceTriangle.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains a handy triangle class. 4 | * \file IceTriangle.h 5 | * \author Pierre Terdiman 6 | * \date January, 17, 2000 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | // Include Guard 12 | #ifndef __ICETRIANGLE_H__ 13 | #define __ICETRIANGLE_H__ 14 | 15 | // Forward declarations 16 | class Moment; 17 | 18 | // Partitioning values 19 | enum PartVal 20 | { 21 | TRI_MINUS_SPACE = 0, //!< Triangle is in the negative space 22 | TRI_PLUS_SPACE = 1, //!< Triangle is in the positive space 23 | TRI_INTERSECT = 2, //!< Triangle intersects plane 24 | TRI_ON_PLANE = 3, //!< Triangle and plane are coplanar 25 | 26 | TRI_FORCEDWORD = 0x7fffffff 27 | }; 28 | 29 | // A triangle class. 30 | class ICEMATHS_API Triangle 31 | { 32 | public: 33 | //! Constructor 34 | inline_ Triangle() {} 35 | //! Constructor 36 | inline_ Triangle(const Point& p0, const Point& p1, const Point& p2) { mVerts[0]=p0; mVerts[1]=p1; mVerts[2]=p2; } 37 | //! Copy constructor 38 | inline_ Triangle(const Triangle& triangle) 39 | { 40 | mVerts[0] = triangle.mVerts[0]; 41 | mVerts[1] = triangle.mVerts[1]; 42 | mVerts[2] = triangle.mVerts[2]; 43 | } 44 | //! Destructor 45 | inline_ ~Triangle() {} 46 | //! Vertices 47 | Point mVerts[3]; 48 | 49 | // Methods 50 | void Flip(); 51 | float Area() const; 52 | float Perimeter() const; 53 | float Compacity() const; 54 | void Normal(Point& normal) const; 55 | void DenormalizedNormal(Point& normal) const; 56 | void Center(Point& center) const; 57 | inline_ Plane PlaneEquation() const { return Plane(mVerts[0], mVerts[1], mVerts[2]); } 58 | 59 | PartVal TestAgainstPlane(const Plane& plane, float epsilon) const; 60 | // float Distance(Point& cp, Point& cq, Tri& tri); 61 | void ComputeMoment(Moment& m); 62 | float MinEdgeLength() const; 63 | float MaxEdgeLength() const; 64 | void ComputePoint(float u, float v, Point& pt, udword* nearvtx=null) const; 65 | void Inflate(float fat_coeff, bool constant_border); 66 | }; 67 | 68 | #endif // __ICETRIANGLE_H__ 69 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/IceUtils.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Contains misc. useful macros & defines. 4 | * \file IceUtils.cpp 5 | * \author Pierre Terdiman (collected from various sources) 6 | * \date April, 4, 2000 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | // Precompiled Header 12 | #include "Stdafx.h" 13 | 14 | using namespace IceCore; 15 | 16 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 17 | /** 18 | * Returns the alignment of the input address. 19 | * \fn Alignment() 20 | * \param address [in] address to check 21 | * \return the best alignment (e.g. 1 for odd addresses, etc) 22 | */ 23 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 24 | udword IceCore::Alignment(udword address) 25 | { 26 | // Returns 0 for null addresses 27 | if(!address) return 0; 28 | 29 | // Test all bits 30 | udword Align = 1; 31 | for(udword i=1;i<32;i++) 32 | { 33 | // Returns as soon as the alignment is broken 34 | if(address&Align) return Align; 35 | Align<<=1; 36 | } 37 | // Here all bits are null, except the highest one (else the address would be null) 38 | return Align; 39 | } 40 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Ice/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I $(top_srcdir)/OPCODE -I $(top_srcdir)/include 2 | 3 | noinst_LTLIBRARIES = libIce.la 4 | libIce_la_SOURCES = \ 5 | IceAABB.cpp IceAABB.h IceAxes.h \ 6 | IceBoundingSphere.h IceContainer.cpp IceContainer.h \ 7 | IceFPU.h IceHPoint.cpp IceHPoint.h \ 8 | IceIndexedTriangle.cpp IceIndexedTriangle.h IceLSS.h \ 9 | IceMatrix3x3.cpp IceMatrix3x3.h IceMatrix4x4.cpp \ 10 | IceMatrix4x4.h IceMemoryMacros.h IceOBB.cpp \ 11 | IceOBB.h IcePairs.h IcePlane.cpp \ 12 | IcePlane.h IcePoint.cpp IcePoint.h \ 13 | IcePreprocessor.h IceRandom.cpp IceRandom.h \ 14 | IceRay.cpp IceRay.h IceRevisitedRadix.cpp \ 15 | IceRevisitedRadix.h IceSegment.cpp IceSegment.h \ 16 | IceTriangle.cpp IceTriangle.h IceTriList.h \ 17 | IceTypes.h IceUtils.cpp IceUtils.h 18 | 19 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = Ice 2 | 3 | noinst_LTLIBRARIES = libOPCODE.la 4 | AM_CPPFLAGS= -fno-strict-aliasing -I$(top_srcdir)/include 5 | 6 | libOPCODE_la_SOURCES = OPC_AABBCollider.cpp OPC_AABBCollider.h \ 7 | OPC_AABBTree.cpp OPC_AABBTree.h \ 8 | OPC_BaseModel.cpp OPC_BaseModel.h \ 9 | OPC_Collider.cpp OPC_Collider.h \ 10 | OPC_Common.cpp OPC_Common.h \ 11 | OPC_HybridModel.cpp OPC_HybridModel.h \ 12 | OPC_LSSCollider.cpp OPC_LSSCollider.h \ 13 | OPC_MeshInterface.cpp OPC_MeshInterface.h \ 14 | OPC_Model.cpp OPC_Model.h \ 15 | OPC_OBBCollider.cpp OPC_OBBCollider.h \ 16 | Opcode.cpp Opcode.h \ 17 | OPC_OptimizedTree.cpp OPC_OptimizedTree.h \ 18 | OPC_Picking.cpp OPC_Picking.h \ 19 | OPC_PlanesCollider.cpp OPC_PlanesCollider.h \ 20 | OPC_RayCollider.cpp OPC_RayCollider.h \ 21 | OPC_SphereCollider.cpp OPC_SphereCollider.h \ 22 | OPC_TreeBuilders.cpp OPC_TreeBuilders.h \ 23 | OPC_TreeCollider.cpp OPC_TreeCollider.h \ 24 | OPC_VolumeCollider.cpp OPC_VolumeCollider.h \ 25 | OPC_Settings.h \ 26 | OPC_SphereAABBOverlap.h \ 27 | OPC_BoxBoxOverlap.h \ 28 | OPC_SphereTriOverlap.h \ 29 | OPC_PlanesAABBOverlap.h \ 30 | OPC_TriBoxOverlap.h \ 31 | OPC_IceHook.h \ 32 | OPC_PlanesTriOverlap.h \ 33 | OPC_TriTriOverlap.h \ 34 | OPC_LSSAABBOverlap.h \ 35 | OPC_RayAABBOverlap.h \ 36 | Stdafx.h \ 37 | OPC_LSSTriOverlap.h \ 38 | OPC_RayTriOverlap.h 39 | 40 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/OPC_IceHook.h: -------------------------------------------------------------------------------- 1 | 2 | // Should be included by Opcode.h if needed 3 | 4 | #define ICE_DONT_CHECK_COMPILER_OPTIONS 5 | 6 | // From Windows... 7 | typedef int BOOL; 8 | #ifndef FALSE 9 | #define FALSE 0 10 | #endif 11 | 12 | #ifndef TRUE 13 | #define TRUE 1 14 | #endif 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #ifndef ASSERT 24 | #define ASSERT(exp) {} 25 | #endif 26 | #define ICE_COMPILE_TIME_ASSERT(exp) extern char ICE_Dummy[ (exp) ? 1 : -1 ] 27 | 28 | #define Log {} 29 | #define SetIceError(a,b) false 30 | #define EC_OUTOFMEMORY "Out of memory" 31 | 32 | #include "Ice/IcePreprocessor.h" 33 | 34 | #undef ICECORE_API 35 | #define ICECORE_API OPCODE_API 36 | 37 | #include "Ice/IceTypes.h" 38 | #include "Ice/IceFPU.h" 39 | #include "Ice/IceMemoryMacros.h" 40 | 41 | namespace IceCore 42 | { 43 | #include "Ice/IceUtils.h" 44 | #include "Ice/IceContainer.h" 45 | #include "Ice/IcePairs.h" 46 | #include "Ice/IceRevisitedRadix.h" 47 | #include "Ice/IceRandom.h" 48 | } 49 | using namespace IceCore; 50 | 51 | #define ICEMATHS_API OPCODE_API 52 | namespace IceMaths 53 | { 54 | #include "Ice/IceAxes.h" 55 | #include "Ice/IcePoint.h" 56 | #include "Ice/IceHPoint.h" 57 | #include "Ice/IceMatrix3x3.h" 58 | #include "Ice/IceMatrix4x4.h" 59 | #include "Ice/IcePlane.h" 60 | #include "Ice/IceRay.h" 61 | #include "Ice/IceIndexedTriangle.h" 62 | #include "Ice/IceTriangle.h" 63 | #include "Ice/IceTriList.h" 64 | #include "Ice/IceAABB.h" 65 | #include "Ice/IceOBB.h" 66 | #include "Ice/IceBoundingSphere.h" 67 | #include "Ice/IceSegment.h" 68 | #include "Ice/IceLSS.h" 69 | } 70 | using namespace IceMaths; 71 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/OPC_Picking.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /* 3 | * OPCODE - Optimized Collision Detection 4 | * Copyright (C) 2001 Pierre Terdiman 5 | * Homepage: http://www.codercorner.com/Opcode.htm 6 | */ 7 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 8 | 9 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 10 | /** 11 | * Contains code to perform "picking". 12 | * \file OPC_Picking.h 13 | * \author Pierre Terdiman 14 | * \date March, 20, 2001 15 | */ 16 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 17 | 18 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 19 | // Include Guard 20 | #ifndef __OPC_PICKING_H__ 21 | #define __OPC_PICKING_H__ 22 | 23 | #ifdef OPC_RAYHIT_CALLBACK 24 | 25 | enum CullMode 26 | { 27 | CULLMODE_NONE = 0, 28 | CULLMODE_CW = 1, 29 | CULLMODE_CCW = 2 30 | }; 31 | 32 | typedef CullMode (*CullModeCallback)(udword triangle_index, void* user_data); 33 | 34 | OPCODE_API bool SetupAllHits (RayCollider& collider, CollisionFaces& contacts); 35 | OPCODE_API bool SetupClosestHit (RayCollider& collider, CollisionFace& closest_contact); 36 | OPCODE_API bool SetupShadowFeeler (RayCollider& collider); 37 | OPCODE_API bool SetupInOutTest (RayCollider& collider); 38 | 39 | OPCODE_API bool Picking( 40 | CollisionFace& picked_face, 41 | const Ray& world_ray, const Model& model, const Matrix4x4* world, 42 | float min_dist, float max_dist, const Point& view_point, CullModeCallback callback, void* user_data); 43 | #endif 44 | 45 | #endif //__OPC_PICKING_H__ 46 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/OPC_PlanesAABBOverlap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/OPCODE/OPC_PlanesAABBOverlap.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/OPC_PlanesTriOverlap.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /** 3 | * Planes-triangle overlap test. 4 | * \param in_clip_mask [in] bitmask for active planes 5 | * \return TRUE if triangle overlap planes 6 | * \warning THIS IS A CONSERVATIVE TEST !! Some triangles will be returned as intersecting, while they're not! 7 | */ 8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9 | inline_ BOOL PlanesCollider::PlanesTriOverlap(udword in_clip_mask) 10 | { 11 | // Stats 12 | mNbVolumePrimTests++; 13 | 14 | const Plane* p = mPlanes; 15 | udword Mask = 1; 16 | 17 | while(Mask<=in_clip_mask) 18 | { 19 | if(in_clip_mask & Mask) 20 | { 21 | float d0 = p->Distance(*mVP.Vertex[0]); 22 | float d1 = p->Distance(*mVP.Vertex[1]); 23 | float d2 = p->Distance(*mVP.Vertex[2]); 24 | if(d0>0.0f && d1>0.0f && d2>0.0f) return FALSE; 25 | // if(!(IR(d0)&SIGN_BITMASK) && !(IR(d1)&SIGN_BITMASK) && !(IR(d2)&SIGN_BITMASK)) return FALSE; 26 | } 27 | Mask+=Mask; 28 | p++; 29 | } 30 | /* 31 | for(udword i=0;i<6;i++) 32 | { 33 | float d0 = p[i].Distance(mLeafVerts[0]); 34 | float d1 = p[i].Distance(mLeafVerts[1]); 35 | float d2 = p[i].Distance(mLeafVerts[2]); 36 | if(d0>0.0f && d1>0.0f && d2>0.0f) return false; 37 | } 38 | */ 39 | return TRUE; 40 | } 41 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/OPC_RayTriOverlap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/OPCODE/OPC_RayTriOverlap.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/OPC_Settings.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /* 3 | * OPCODE - Optimized Collision Detection 4 | * Copyright (C) 2001 Pierre Terdiman 5 | * Homepage: http://www.codercorner.com/Opcode.htm 6 | */ 7 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 8 | 9 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 10 | /** 11 | * Contains compilation flags. 12 | * \file OPC_Settings.h 13 | * \author Pierre Terdiman 14 | * \date May, 12, 2001 15 | */ 16 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 17 | 18 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 19 | // Include Guard 20 | #ifndef __OPC_SETTINGS_H__ 21 | #define __OPC_SETTINGS_H__ 22 | 23 | //! Use CPU comparisons (comment that line to use standard FPU compares) 24 | #define OPC_CPU_COMPARE 25 | 26 | //! Use FCOMI / FCMOV on Pentium-Pro based processors (comment that line to use plain C++) 27 | #define OPC_USE_FCOMI 28 | 29 | //! Use epsilon value in tri-tri overlap test 30 | #define OPC_TRITRI_EPSILON_TEST 31 | 32 | //! Use tree-coherence or not [not implemented yet] 33 | // #define OPC_USE_TREE_COHERENCE 34 | 35 | //! Use callbacks or direct pointers. Using callbacks might be a bit slower (but probably not much) 36 | // #define OPC_USE_CALLBACKS 37 | 38 | //! Support triangle and vertex strides or not. Using strides might be a bit slower (but probably not much) 39 | #define OPC_USE_STRIDE 40 | 41 | //! Discard negative pointer in vanilla trees 42 | #define OPC_NO_NEG_VANILLA_TREE 43 | 44 | //! Use a callback in the ray collider 45 | //#define OPC_RAYHIT_CALLBACK 46 | 47 | // NB: no compilation flag to enable/disable stats since they're actually needed in the box/box overlap test 48 | 49 | #endif //__OPC_SETTINGS_H__ 50 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/OPC_TriBoxOverlap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/OPCODE/OPC_TriBoxOverlap.h -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Opcode.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /* 3 | * OPCODE - Optimized Collision Detection 4 | * Copyright (C) 2001 Pierre Terdiman 5 | * Homepage: http://www.codercorner.com/Opcode.htm 6 | */ 7 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 8 | 9 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 10 | /** 11 | * Main file for Opcode.dll. 12 | * \file Opcode.cpp 13 | * \author Pierre Terdiman 14 | * \date March, 20, 2001 15 | */ 16 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 17 | 18 | /* 19 | Finding a good name is difficult! 20 | Here's the draft for this lib.... Spooky, uh? 21 | 22 | VOID? Very Optimized Interference Detection 23 | ZOID? Zappy's Optimized Interference Detection 24 | CID? Custom/Clever Interference Detection 25 | AID / ACID! Accurate Interference Detection 26 | QUID? Quick Interference Detection 27 | RIDE? Realtime Interference DEtection 28 | WIDE? Wicked Interference DEtection (....) 29 | GUID! 30 | KID ! k-dop interference detection :) 31 | OPCODE! OPtimized COllision DEtection 32 | */ 33 | 34 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 35 | // Precompiled Header 36 | #include "Stdafx.h" 37 | 38 | using namespace Opcode; 39 | 40 | 41 | bool Opcode::InitOpcode() 42 | { 43 | //Log("// Initializing OPCODE\n\n"); 44 | // LogAPIInfo(); 45 | 46 | return true; 47 | } 48 | 49 | bool Opcode::CloseOpcode() 50 | { 51 | //Log("// Closing OPCODE\n\n"); 52 | 53 | return true; 54 | } 55 | 56 | 57 | #ifdef ICE_MAIN 58 | 59 | void ModuleAttach(HINSTANCE hinstance) 60 | { 61 | } 62 | 63 | void ModuleDetach() 64 | { 65 | } 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/OPCODE/Stdafx.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | /* 3 | * OPCODE - Optimized Collision Detection 4 | * Copyright (C) 2001 Pierre Terdiman 5 | * Homepage: http://www.codercorner.com/Opcode.htm 6 | */ 7 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 8 | 9 | #if !defined(AFX_STDAFX_H__EFB95044_1D31_11D5_8B0F_0050BAC83302__INCLUDED_) 10 | #define AFX_STDAFX_H__EFB95044_1D31_11D5_8B0F_0050BAC83302__INCLUDED_ 11 | 12 | #if _MSC_VER > 1000 13 | #pragma once 14 | #endif // _MSC_VER > 1000 15 | 16 | // Insert your headers here 17 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 18 | 19 | #include "Opcode.h" 20 | 21 | //{{AFX_INSERT_LOCATION}} 22 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 23 | 24 | #endif // !defined(AFX_STDAFX_H__EFB95044_1D31_11D5_8B0F_0050BAC83302__INCLUDED_) 25 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/README.txt: -------------------------------------------------------------------------------- 1 | The Open Dynamics Engine (ODE), Copyright (C) 2001-2007 Russell L. Smith. 2 | ------------------------------------------------------------------------- 3 | 4 | ODE is a free, industrial quality library for simulating articulated 5 | rigid body dynamics - for example ground vehicles, legged creatures, 6 | and moving objects in VR environments. It is fast, flexible, robust 7 | and platform independent, with advanced joints, contact with friction, 8 | and built-in collision detection. 9 | 10 | This library is free software; you can redistribute it and/or 11 | modify it under the terms of EITHER: 12 | (1) The GNU Lesser General Public License as published by the Free 13 | Software Foundation; either version 2.1 of the License, or (at 14 | your option) any later version. The text of the GNU Lesser 15 | General Public License is included with this library in the 16 | file LICENSE.TXT. 17 | (2) The BSD-style license that is included with this library in 18 | the file LICENSE-BSD.TXT. 19 | 20 | This library is distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files 23 | LICENSE.TXT and LICENSE-BSD.TXT for more details. 24 | 25 | * Installation instructions are in the INSTALL file 26 | 27 | * The ODE web pages are at http://ode.org/ 28 | 29 | * An online manual is at http://opende.sf.net/wiki/index.php/Manual 30 | 31 | * API documentation is in the file ode/docs/index.html, or you 32 | can view it on the web at http://opende.sf.net/docs/index.html 33 | 34 | All contributions are copyright by their owners, but the owners 35 | automatically transfer unrestricted rights in those changes to the ODE 36 | project, which is released under the dual licenses as indicated. The 37 | owners can also use the contributions in other projects under other 38 | licenses if they want (including sell them), but they can't prevent 39 | anyone from releasing the contributions under the dual ODE licenses as 40 | part of an ODE release. 41 | 42 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # The version nr detection is not working. 4 | # It fails if there is a '-' char in the version nr e.g. 5 | # We should not use it until fixed. - Bram 6 | 7 | ## The reason this uses sed instead of "grep --only-matches" 8 | ## is because MinGW's grep is an old version and does not contain that flag. 9 | #automake_version=`automake --version | grep --regexp='[+0-9].[+0-9].[+0-9]' | sed -n 's/[* ()A-Za-z]//g;p'` 10 | #automake_mayor=${automake_version%.*.*} 11 | #automake_minor=${automake_version%.*} 12 | #automake_minor=${automake_minor##*.} 13 | #automake_revision=${automake_version##*.} 14 | #echo "AutoMake Version: $automake_mayor.$automake_minor.$automake_revision" 15 | # 16 | #if [ $automake_mayor -eq 1 ]; then 17 | # if [ $automake_minor -lt 8 ]; then 18 | # echo "Automake must be 1.8.2 or higher, please upgrade" 19 | # exit 20 | # else 21 | # if [ $automake_minor -eq 8 ] && [ $automake_revision -lt 2 ]; then 22 | # echo "Automake must be 1.8.2 or higher, please upgrade" 23 | # exit 24 | # fi 25 | # fi 26 | #fi 27 | 28 | echo "Please make sure that you use automake 1.10 or later" 29 | echo "Warnings about underquoted definitions are harmless" 30 | 31 | echo "Running aclocal" 32 | aclocal -I . || exit 1 33 | # on Mac libtoolize is called glibtoolize 34 | LIBTOOLIZE=libtoolize 35 | if [ `uname -s` = Darwin ]; then 36 | LIBTOOLIZE=glibtoolize 37 | fi 38 | echo "Running $LIBTOOLIZE" 39 | $LIBTOOLIZE --copy --force --automake || exit 1 40 | echo "Running autoheader" 41 | autoheader || exit 1 42 | echo "Running automake" 43 | automake --foreign --add-missing --copy || exit 1 44 | echo "Running autoconf" 45 | autoconf || exit 1 46 | 47 | echo "Running bootstrap in ou directory" 48 | (cd ou && ./bootstrap) 49 | 50 | #./configure $* 51 | 52 | echo "Now you are ready to run ./configure" 53 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/build/premake4.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/build/premake4.exe -------------------------------------------------------------------------------- /resources/ode-0.11.1/drawstuff/Makefile.am: -------------------------------------------------------------------------------- 1 | if ENABLE_DRAWSTUFF 2 | SUBDIRS = src dstest 3 | EXTRA_DIST = textures 4 | endif 5 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/drawstuff/dstest/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_PROGRAMS= dstest 2 | AM_CPPFLAGS = -I$(top_srcdir)/drawstuff/src -I$(top_srcdir)/include 3 | 4 | dstest_SOURCES= dstest.cpp 5 | dstest_LDADD=$(top_builddir)/drawstuff/src/libdrawstuff.la \ 6 | @GL_LIBS@ 7 | 8 | if WIN32 9 | resources.o: $(top_srcdir)/drawstuff/src/resources.rc $(top_srcdir)/drawstuff/src/resource.h 10 | @WINDRES@ $(top_srcdir)/drawstuff/src/resources.rc -o resources.o 11 | 12 | dstest_LDADD += resources.o 13 | endif 14 | 15 | if X11 16 | dstest_LDADD+=$(X_PRE_LIBS) $(X_LIBS) $(X_EXTRA_LIBS) 17 | endif 18 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/drawstuff/src/Makefile.am: -------------------------------------------------------------------------------- 1 | # Drawstuff is meant as an aid for testing and not as a full 2 | # rendering library. 3 | 4 | noinst_LTLIBRARIES = libdrawstuff.la 5 | libdrawstuff_la_SOURCES = drawstuff.cpp internal.h 6 | AM_CPPFLAGS = -I$(top_srcdir)/include \ 7 | -DDEFAULT_PATH_TO_TEXTURES='"$(top_srcdir)/drawstuff/textures/"' \ 8 | $(X_CFLAGS) 9 | 10 | if WIN32 11 | libdrawstuff_la_SOURCES+= windows.cpp resource.h resources.rc 12 | libdrawstuff_la_LIBADD = -lwinmm -lgdi32 13 | libdrawstuff_la_LDFLAGS = -no-undefined 14 | endif 15 | 16 | if X11 17 | libdrawstuff_la_SOURCES+= x11.cpp 18 | libdrawstuff_la_LIBADD = $(X_LIBS) 19 | endif 20 | 21 | if OSX 22 | libdrawstuff_la_SOURCES+= osx.cpp 23 | endif 24 | 25 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/drawstuff/src/internal.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | /* functions supplied and used by the platform specific code */ 24 | 25 | #ifndef __DS_INTERNAL_H 26 | #define __DS_INTERNAL_H 27 | 28 | #include "drawstuff/drawstuff.h" 29 | 30 | 31 | // supplied by platform specific code 32 | 33 | void dsPlatformSimLoop (int window_width, int window_height, 34 | dsFunctions *fn, int initial_pause); 35 | 36 | 37 | // used by platform specific code 38 | 39 | void dsStartGraphics (int width, int height, dsFunctions *fn); 40 | void dsDrawFrame (int width, int height, dsFunctions *fn, int pause); 41 | void dsStopGraphics(); 42 | void dsMotion (int mode, int deltax, int deltay); 43 | 44 | int dsGetShadows(); 45 | void dsSetShadows (int a); 46 | 47 | int dsGetTextures(); 48 | void dsSetTextures (int a); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/drawstuff/src/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by resources.rc 4 | // 5 | #define IDD_MSGDLG 101 6 | #define IDR_MENU1 102 7 | #define IDD_ABOUT 103 8 | #define IDR_ACCELERATOR1 104 9 | #define IDC_LIST1 1000 10 | #define IDM_EXIT 40001 11 | #define IDM_ABOUT 40002 12 | #define IDM_PAUSE 40003 13 | #define IDM_PERF_MONITOR 40004 14 | #define IDM_SHADOWS 40005 15 | #define IDM_TEXTURES 40006 16 | #define IDM_SAVE_SETTINGS 40007 17 | #define IDM_SINGLE_STEP 40008 18 | 19 | // Next default values for new objects 20 | // 21 | #ifdef APSTUDIO_INVOKED 22 | #ifndef APSTUDIO_READONLY_SYMBOLS 23 | #define _APS_NEXT_RESOURCE_VALUE 108 24 | #define _APS_NEXT_COMMAND_VALUE 40009 25 | #define _APS_NEXT_CONTROL_VALUE 1001 26 | #define _APS_NEXT_SYMED_VALUE 101 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/drawstuff/textures/checkered.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/drawstuff/textures/checkered.ppm -------------------------------------------------------------------------------- /resources/ode-0.11.1/drawstuff/textures/ground.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/drawstuff/textures/ground.ppm -------------------------------------------------------------------------------- /resources/ode-0.11.1/drawstuff/textures/sky.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/drawstuff/textures/sky.ppm -------------------------------------------------------------------------------- /resources/ode-0.11.1/drawstuff/textures/wood.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/drawstuff/textures/wood.ppm -------------------------------------------------------------------------------- /resources/ode-0.11.1/include/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = ode drawstuff 2 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/include/drawstuff/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | noinst_HEADERS = drawstuff.h version.h 3 | 4 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/include/drawstuff/version.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef __VERSION_H 24 | #define __VERSION_H 25 | 26 | /* high byte is major version, low byte is minor version */ 27 | #define DS_VERSION 0x0002 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/include/ode/Makefile.am: -------------------------------------------------------------------------------- 1 | libode_la_includedir = $(includedir)/ode 2 | libode_la_include_HEADERS = collision_trimesh.h \ 3 | mass.h \ 4 | odecpp.h \ 5 | common.h \ 6 | matrix.h \ 7 | odecpp_collision.h \ 8 | compatibility.h \ 9 | memory.h \ 10 | contact.h \ 11 | misc.h \ 12 | odemath.h \ 13 | odeinit.h \ 14 | collision.h \ 15 | error.h \ 16 | objects.h \ 17 | rotation.h \ 18 | collision_space.h \ 19 | export-dif.h \ 20 | ode.h \ 21 | timer.h \ 22 | odeconfig.h 23 | 24 | EXTRA_DIST = README 25 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/include/ode/README: -------------------------------------------------------------------------------- 1 | 2 | this is the public C interface to the ODE library. 3 | 4 | all these files should be includable from C, i.e. they should not use any 5 | C++ features. everything should be protected with 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | ... 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | the only exceptions are the odecpp.h and odecpp_collisioh.h files, which define a C++ wrapper for 18 | the C interface. remember to keep this in sync! 19 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/include/ode/compatibility.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_COMPATIBILITY_H_ 24 | #define _ODE_COMPATIBILITY_H_ 25 | 26 | /* 27 | * ODE's backward compatibility system ensures that as ODE's API 28 | * evolves, user code will not break. 29 | */ 30 | 31 | /* 32 | * These new rotation function names are more consistent with the 33 | * rest of the API. 34 | */ 35 | #define dQtoR(q,R) dRfromQ((R),(q)) 36 | #define dRtoQ(R,q) dQfromR((q),(R)) 37 | #define dWtoDQ(w,q,dq) dDQfromW((dq),(w),(q)) 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/include/ode/export-dif.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_EXPORT_DIF_ 24 | #define _ODE_EXPORT_DIF_ 25 | 26 | #include 27 | 28 | 29 | ODE_API void dWorldExportDIF (dWorldID w, FILE *file, const char *world_name); 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/include/ode/memory.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | /* this comes from the `reuse' library. copy any changes back to the source */ 24 | 25 | #ifndef _ODE_MEMORY_H_ 26 | #define _ODE_MEMORY_H_ 27 | 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /* function types to allocate and free memory */ 35 | typedef void * dAllocFunction (size_t size); 36 | typedef void * dReallocFunction (void *ptr, size_t oldsize, size_t newsize); 37 | typedef void dFreeFunction (void *ptr, size_t size); 38 | 39 | /* set new memory management functions. if fn is 0, the default handlers are 40 | * used. */ 41 | ODE_API void dSetAllocHandler (dAllocFunction *fn); 42 | ODE_API void dSetReallocHandler (dReallocFunction *fn); 43 | ODE_API void dSetFreeHandler (dFreeFunction *fn); 44 | 45 | /* get current memory management functions */ 46 | ODE_API dAllocFunction *dGetAllocHandler (void); 47 | ODE_API dReallocFunction *dGetReallocHandler (void); 48 | ODE_API dFreeFunction *dGetFreeHandler (void); 49 | 50 | /* allocate and free memory. */ 51 | ODE_API void * dAlloc (size_t size); 52 | ODE_API void * dRealloc (void *ptr, size_t oldsize, size_t newsize); 53 | ODE_API void dFree (void *ptr, size_t size); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/include/ode/ode.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_ODE_H_ 24 | #define _ODE_ODE_H_ 25 | 26 | /* include *everything* here */ 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/include/ode/odeconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef ODECONFIG_H 2 | #define ODECONFIG_H 3 | 4 | #ifndef dDOUBLE 5 | #ifndef dSINGLE 6 | #define dSINGLE 7 | #endif 8 | #endif 9 | 10 | /* Pull in the standard headers */ 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #if defined(ODE_DLL) || defined(ODE_LIB) || !defined(_MSC_VER) 19 | #define __ODE__ 20 | #endif 21 | 22 | /* Define a DLL export symbol for those platforms that need it */ 23 | #if defined(_MSC_VER) 24 | #if defined(ODE_DLL) 25 | #define ODE_API __declspec(dllexport) 26 | #elif !defined(ODE_LIB) 27 | #define ODE_DLL_API __declspec(dllimport) 28 | #endif 29 | #endif 30 | 31 | #if !defined(ODE_API) 32 | #define ODE_API 33 | #endif 34 | 35 | #if defined(_MSC_VER) 36 | # define ODE_API_DEPRECATED __declspec(deprecated) 37 | #elif defined (__GNUC__) && ( (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)) ) 38 | # define ODE_API_DEPRECATED __attribute__((__deprecated__)) 39 | #else 40 | # define ODE_API_DEPRECATED 41 | #endif 42 | 43 | /* Well-defined common data types...need to define for 64 bit systems */ 44 | #if defined(_M_IA64) || defined(__ia64__) || defined(_M_AMD64) || defined(__x86_64__) 45 | #define X86_64_SYSTEM 1 46 | typedef int int32; 47 | typedef unsigned int uint32; 48 | typedef short int16; 49 | typedef unsigned short uint16; 50 | typedef char int8; 51 | typedef unsigned char uint8; 52 | #else 53 | typedef int int32; 54 | typedef unsigned int uint32; 55 | typedef short int16; 56 | typedef unsigned short uint16; 57 | typedef char int8; 58 | typedef unsigned char uint8; 59 | #endif 60 | 61 | /* Visual C does not define these functions */ 62 | #if defined(_MSC_VER) 63 | #define copysignf _copysign 64 | #define copysign _copysign 65 | #endif 66 | 67 | 68 | 69 | /* Define the dInfinity macro */ 70 | #ifdef INFINITY 71 | #define dInfinity INFINITY 72 | #elif defined(HUGE_VAL) 73 | #ifdef dSINGLE 74 | #ifdef HUGE_VALF 75 | #define dInfinity HUGE_VALF 76 | #else 77 | #define dInfinity ((float)HUGE_VAL) 78 | #endif 79 | #else 80 | #define dInfinity HUGE_VAL 81 | #endif 82 | #else 83 | #ifdef dSINGLE 84 | #define dInfinity ((float)(1.0/0.0)) 85 | #else 86 | #define dInfinity (1.0/0.0) 87 | #endif 88 | #endif 89 | 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode-config.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | exec_prefix_set=no 6 | 7 | usage="\ 8 | Usage: ode-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]" 9 | 10 | if test $# -eq 0; then 11 | echo "${usage}" 1>&2 12 | exit 1 13 | fi 14 | 15 | while test $# -gt 0; do 16 | case "$1" in 17 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 18 | *) optarg= ;; 19 | esac 20 | 21 | case $1 in 22 | --prefix=*) 23 | prefix=$optarg 24 | if test $exec_prefix_set = no ; then 25 | exec_prefix=$optarg 26 | fi 27 | ;; 28 | --prefix) 29 | echo $prefix 30 | ;; 31 | --exec-prefix=*) 32 | exec_prefix=$optarg 33 | exec_prefix_set=yes 34 | ;; 35 | --exec-prefix) 36 | echo $exec_prefix 37 | ;; 38 | --version) 39 | echo @ODE_RELEASE@ 40 | ;; 41 | --cflags) 42 | echo -I@includedir@ @ODE_PRECISION@ 43 | ;; 44 | --libs) 45 | echo -L@libdir@ -lode 46 | ;; 47 | *) 48 | echo "${usage}" 1>&2 49 | exit 1 50 | ;; 51 | esac 52 | shift 53 | done 54 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: ode 7 | Description: Open Dynamics Engine 8 | Version: @ODE_RELEASE@ 9 | Libs: -L${libdir} -lode 10 | Libs.private: -lstdc++ -lm 11 | Cflags: -I${includedir} @ODE_PRECISION@ 12 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = src 2 | if ENABLE_DEMOS 3 | SUBDIRS += demo 4 | endif 5 | 6 | EXTRA_DIST = doc 7 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/demo/texturepath.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | // Sourceforge tests require the textures in the drawstuff folder 24 | 25 | #ifndef DRAWSTUFF_TEXTURE_PATH 26 | #define DRAWSTUFF_TEXTURE_PATH "../../drawstuff/textures" 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/main.dox: -------------------------------------------------------------------------------- 1 | /** 2 | @mainpage Open Dynamics Engine API Reference 3 | 4 |
This document is © Russell Smith and the ODE Project
5 | 6 | The Open Dynamics Engine (ODE) is a free, industrial quality library for 7 | simulating articulated rigid body dynamics. ODE is being developed by 8 | Russell Smith with help from several 9 | contributors. 10 | 11 | This document describes the library API. For a more general introduction 12 | to ODE, please see the 13 | Online Handbook. 14 | 15 |

Important: this document is not yet complete!

16 | 17 | We are still working on getting the full API documentated. In the meantime, 18 | please refer to the 19 | Online Handbook 20 | 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/amotor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/amotor.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/ball-and-socket-bad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/ball-and-socket-bad.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/ball-and-socket.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/ball-and-socket.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/body.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/body.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/contact.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/contact.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/hinge.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/hinge.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/hinge2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/hinge2.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/joints.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/joints.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/rollingcontact.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/rollingcontact.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/sf-graph1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/sf-graph1.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/sf-graph2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/sf-graph2.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/slider.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/slider.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/doc/pix/universal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/doc/pix/universal.jpg -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/collision_transform.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | /* 24 | 25 | geom transform 26 | 27 | */ 28 | 29 | #ifndef _ODE_COLLISION_TRANSFORM_H_ 30 | #define _ODE_COLLISION_TRANSFORM_H_ 31 | 32 | #include 33 | #include "collision_kernel.h" 34 | 35 | 36 | int dCollideTransform (dxGeom *o1, dxGeom *o2, int flags, 37 | dContactGeom *contact, int skip); 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/collision_trimesh_colliders.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001-2003 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_COLLISION_TRIMESH_COLLIDERS_H_ 24 | #define _ODE_COLLISION_TRIMESH_COLLIDERS_H_ 25 | 26 | 27 | int dCollideCylinderTrimesh(dxGeom *o1, dxGeom *o2, int flags, dContactGeom *contact, int skip); 28 | int dCollideTrimeshPlane(dxGeom *o1, dxGeom *o2, int flags, dContactGeom *contact, int skip); 29 | 30 | int dCollideSTL(dxGeom *o1, dxGeom *o2, int flags, dContactGeom *contact, int skip); 31 | int dCollideBTL(dxGeom *o1, dxGeom *o2, int flags, dContactGeom *contact, int skip); 32 | int dCollideRTL(dxGeom *o1, dxGeom *o2, int flags, dContactGeom *contact, int skip); 33 | int dCollideTTL(dxGeom *o1, dxGeom *o2, int flags, dContactGeom *contact, int skip); 34 | int dCollideCCTL(dxGeom *o1, dxGeom *o2, int flags, dContactGeom *contact, int skip); 35 | 36 | PURE_INLINE int dCollideRayTrimesh( dxGeom *ray, dxGeom *trimesh, int flags, 37 | dContactGeom *contact, int skip ) 38 | { 39 | // Swapped case, for code that needs it (heightfield initially) 40 | // The other ray-geom colliders take geoms in a swapped order to the 41 | // dCollideRTL function which is annoying when using function pointers. 42 | return dCollideRTL( trimesh, ray, flags, contact, skip ); 43 | } 44 | 45 | 46 | #endif // _ODE_COLLISION_TRIMESH_COLLIDERS_H_ 47 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/collision_trimesh_trimesh_new.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mas-bandwidth/cubes-old/5d071d7c11fb6c337d34716105197ee254f020dd/resources/ode-0.11.1/ode/src/collision_trimesh_trimesh_new.cpp -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/fastdot.c: -------------------------------------------------------------------------------- 1 | /* generated code, do not edit. */ 2 | 3 | #include "ode/matrix.h" 4 | 5 | 6 | dReal dDot (const dReal *a, const dReal *b, int n) 7 | { 8 | dReal p0,q0,m0,p1,q1,m1,sum; 9 | sum = 0; 10 | n -= 2; 11 | while (n >= 0) { 12 | p0 = a[0]; q0 = b[0]; 13 | m0 = p0 * q0; 14 | p1 = a[1]; q1 = b[1]; 15 | m1 = p1 * q1; 16 | sum += m0; 17 | sum += m1; 18 | a += 2; 19 | b += 2; 20 | n -= 2; 21 | } 22 | n += 2; 23 | while (n > 0) { 24 | sum += (*a) * (*b); 25 | a++; 26 | b++; 27 | n--; 28 | } 29 | return sum; 30 | } 31 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | noinst_LTLIBRARIES = libjoints.la 4 | 5 | libjoints_la_SOURCES = joints.h \ 6 | joint.h joint.cpp \ 7 | joint_internal.h \ 8 | ball.h ball.cpp \ 9 | hinge.h hinge.cpp \ 10 | slider.h slider.cpp \ 11 | contact.h contact.cpp \ 12 | universal.h universal.cpp \ 13 | hinge2.h hinge2.cpp \ 14 | fixed.h fixed.cpp \ 15 | null.h null.cpp \ 16 | amotor.h amotor.cpp \ 17 | lmotor.h lmotor.cpp \ 18 | plane2d.h plane2d.cpp \ 19 | pu.h pu.cpp \ 20 | pr.h pr.cpp \ 21 | piston.h piston.cpp 22 | 23 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/amotor.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_JOINT_AMOTOR_H_ 24 | #define _ODE_JOINT_AMOTOR_H_ 25 | 26 | #include "joint.h" 27 | 28 | 29 | // angular motor 30 | 31 | struct dxJointAMotor : public dxJoint 32 | { 33 | int num; // number of axes (0..3) 34 | int mode; // a dAMotorXXX constant 35 | int rel[3]; // what the axes are relative to (global,b1,b2) 36 | dVector3 axis[3]; // three axes 37 | dxJointLimitMotor limot[3]; // limit+motor info for axes 38 | dReal angle[3]; // user-supplied angles for axes 39 | // these vectors are used for calculating euler angles 40 | dVector3 reference1; // original axis[2], relative to body 1 41 | dVector3 reference2; // original axis[0], relative to body 2 42 | 43 | 44 | void computeGlobalAxes( dVector3 ax[3] ); 45 | void computeEulerAngles( dVector3 ax[3] ); 46 | void setEulerReferenceVectors(); 47 | 48 | 49 | dxJointAMotor( dxWorld *w ); 50 | virtual void getInfo1( Info1* info ); 51 | virtual void getInfo2( Info2* info ); 52 | virtual dJointType type() const; 53 | virtual size_t size() const; 54 | }; 55 | 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/ball.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_JOINT_BALL_H_ 24 | #define _ODE_JOINT_BALL_H_ 25 | 26 | #include "joint.h" 27 | 28 | // ball and socket 29 | 30 | struct dxJointBall : public dxJoint 31 | { 32 | dVector3 anchor1; // anchor w.r.t first body 33 | dVector3 anchor2; // anchor w.r.t second body 34 | dReal erp; // error reduction 35 | dReal cfm; // constraint force mix in 36 | void set( int num, dReal value ); 37 | dReal get( int num ); 38 | 39 | dxJointBall( dxWorld *w ); 40 | virtual void getInfo1( Info1* info ); 41 | virtual void getInfo2( Info2* info ); 42 | virtual dJointType type() const; 43 | virtual size_t size() const; 44 | 45 | virtual void setRelativeValues(); 46 | }; 47 | 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/contact.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_JOINT_CONTACT_H_ 24 | #define _ODE_JOINT_CONTACT_H_ 25 | 26 | #include "joint.h" 27 | 28 | // contact 29 | 30 | struct dxJointContact : public dxJoint 31 | { 32 | int the_m; // number of rows computed by getInfo1 33 | dContact contact; 34 | 35 | dxJointContact( dxWorld* w ); 36 | virtual void getInfo1( Info1* info ); 37 | virtual void getInfo2( Info2* info ); 38 | virtual dJointType type() const; 39 | virtual size_t size() const; 40 | }; 41 | 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/fixed.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_JOINT_FIXED_H_ 24 | #define _ODE_JOINT_FIXED_H_ 25 | 26 | #include "joint.h" 27 | 28 | 29 | // fixed 30 | 31 | struct dxJointFixed : public dxJoint 32 | { 33 | dQuaternion qrel; // initial relative rotation body1 -> body2 34 | dVector3 offset; // relative offset between the bodies 35 | dReal erp; // error reduction parameter 36 | dReal cfm; // constraint force mix-in 37 | void set ( int num, dReal value ); 38 | dReal get ( int num ); 39 | 40 | dxJointFixed ( dxWorld *w ); 41 | virtual void getInfo1 ( Info1* info ); 42 | virtual void getInfo2 ( Info2* info ); 43 | virtual dJointType type() const; 44 | virtual size_t size() const; 45 | 46 | void computeInitialRelativeRotation(); 47 | }; 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/hinge.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_JOINT_HINGE_H_ 24 | #define _ODE_JOINT_HINGE_H_ 25 | 26 | #include "joint.h" 27 | 28 | 29 | // hinge 30 | 31 | struct dxJointHinge : public dxJoint 32 | { 33 | dVector3 anchor1; // anchor w.r.t first body 34 | dVector3 anchor2; // anchor w.r.t second body 35 | dVector3 axis1; // axis w.r.t first body 36 | dVector3 axis2; // axis w.r.t second body 37 | dQuaternion qrel; // initial relative rotation body1 -> body2 38 | dxJointLimitMotor limot; // limit and motor information 39 | 40 | dxJointHinge( dxWorld *w ); 41 | virtual void getInfo1( Info1* info ); 42 | virtual void getInfo2( Info2* info ); 43 | virtual dJointType type() const; 44 | virtual size_t size() const; 45 | 46 | virtual void setRelativeValues(); 47 | 48 | void computeInitialRelativeRotation(); 49 | }; 50 | 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/joints.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_JOINTS_H_ 24 | #define _ODE_JOINTS_H_ 25 | 26 | #include 27 | 28 | #include "joint.h" 29 | 30 | #include "ball.h" 31 | #include "hinge.h" 32 | #include "slider.h" 33 | #include "contact.h" 34 | #include "universal.h" 35 | #include "hinge2.h" 36 | #include "fixed.h" 37 | #include "null.h" 38 | #include "amotor.h" 39 | #include "lmotor.h" 40 | #include "plane2d.h" 41 | #include "pu.h" 42 | #include "pr.h" 43 | #include "piston.h" 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/lmotor.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_JOINT_LMOTOR_H_ 24 | #define _ODE_JOINT_LMOTOR_H_ 25 | 26 | #include "joint.h" 27 | 28 | struct dxJointLMotor : public dxJoint 29 | { 30 | int num; 31 | int rel[3]; 32 | dVector3 axis[3]; 33 | dxJointLimitMotor limot[3]; 34 | 35 | void computeGlobalAxes( dVector3 ax[3] ); 36 | 37 | 38 | dxJointLMotor( dxWorld *w ); 39 | virtual void getInfo1( Info1* info ); 40 | virtual void getInfo2( Info2* info ); 41 | virtual dJointType type() const; 42 | virtual size_t size() const; 43 | }; 44 | 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/null.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | 24 | #include "null.h" 25 | #include "joint_internal.h" 26 | 27 | 28 | 29 | //**************************************************************************** 30 | // null joint 31 | dxJointNull::dxJointNull( dxWorld *w ) : 32 | dxJoint( w ) 33 | { 34 | } 35 | 36 | void 37 | dxJointNull::getInfo1( dxJoint::Info1 *info ) 38 | { 39 | info->m = 0; 40 | info->nub = 0; 41 | } 42 | 43 | 44 | void 45 | dxJointNull::getInfo2( dxJoint::Info2 *info ) 46 | { 47 | dDebug( 0, "this should never get called" ); 48 | } 49 | 50 | dJointType 51 | dxJointNull::type() const 52 | { 53 | return dJointTypeNull; 54 | } 55 | 56 | size_t 57 | dxJointNull::size() const 58 | { 59 | return sizeof( *this ); 60 | } 61 | 62 | 63 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/null.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_JOINT_NULL_H_ 24 | #define _ODE_JOINT_NULL_H_ 25 | 26 | #include "joint.h" 27 | 28 | 29 | 30 | // null joint, for testing only 31 | 32 | struct dxJointNull : public dxJoint 33 | { 34 | dxJointNull( dxWorld *w ); 35 | virtual void getInfo1( Info1* info ); 36 | virtual void getInfo2( Info2* info ); 37 | virtual dJointType type() const; 38 | virtual size_t size() const; 39 | }; 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/plane2d.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_JOINT_PLANE2D_H_ 24 | #define _ODE_JOINT_PLANE2D_H_ 25 | 26 | #include "joint.h" 27 | 28 | 29 | // 2d joint, constrains to z == 0 30 | 31 | struct dxJointPlane2D : public dxJoint 32 | { 33 | int row_motor_x; 34 | int row_motor_y; 35 | int row_motor_angle; 36 | dxJointLimitMotor motor_x; 37 | dxJointLimitMotor motor_y; 38 | dxJointLimitMotor motor_angle; 39 | 40 | 41 | dxJointPlane2D( dxWorld *w ); 42 | virtual void getInfo1( Info1* info ); 43 | virtual void getInfo2( Info2* info ); 44 | virtual dJointType type() const; 45 | virtual size_t size() const; 46 | }; 47 | 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/joints/slider.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_JOINT_SLIDER_H_ 24 | #define _ODE_JOINT_SLIDER_H_ 25 | 26 | #include "joint.h" 27 | 28 | 29 | // slider. if body2 is 0 then qrel is the absolute rotation of body1 and 30 | // offset is the position of body1 center along axis1. 31 | 32 | struct dxJointSlider : public dxJoint 33 | { 34 | dVector3 axis1; // axis w.r.t first body 35 | dQuaternion qrel; // initial relative rotation body1 -> body2 36 | dVector3 offset; // point relative to body2 that should be 37 | // aligned with body1 center along axis1 38 | dxJointLimitMotor limot; // limit and motor information 39 | 40 | dxJointSlider ( dxWorld *w ); 41 | virtual void getInfo1 ( Info1* info ); 42 | virtual void getInfo2 ( Info2* info ); 43 | virtual dJointType type() const; 44 | virtual size_t size() const; 45 | 46 | virtual void setRelativeValues(); 47 | 48 | void computeInitialRelativeRotation(); 49 | 50 | void computeOffset(); 51 | }; 52 | 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/lcp.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | /* 24 | 25 | given (A,b,lo,hi), solve the LCP problem: A*x = b+w, where each x(i),w(i) 26 | satisfies one of 27 | (1) x = lo, w >= 0 28 | (2) x = hi, w <= 0 29 | (3) lo < x < hi, w = 0 30 | A is a matrix of dimension n*n, everything else is a vector of size n*1. 31 | lo and hi can be +/- dInfinity as needed. the first `nub' variables are 32 | unbounded, i.e. hi and lo are assumed to be +/- dInfinity. 33 | 34 | we restrict lo(i) <= 0 and hi(i) >= 0. 35 | 36 | the original data (A,b) may be modified by this function. 37 | 38 | if the `findex' (friction index) parameter is nonzero, it points to an array 39 | of index values. in this case constraints that have findex[i] >= 0 are 40 | special. all non-special constraints are solved for, then the lo and hi values 41 | for the special constraints are set: 42 | hi[i] = abs( hi[i] * x[findex[i]] ) 43 | lo[i] = -hi[i] 44 | and the solution continues. this mechanism allows a friction approximation 45 | to be implemented. the first `nub' variables are assumed to have findex < 0. 46 | 47 | */ 48 | 49 | 50 | #ifndef _ODE_LCP_H_ 51 | #define _ODE_LCP_H_ 52 | 53 | 54 | void dSolveLCP (int n, dReal *A, dReal *x, dReal *b, dReal *w, 55 | int nub, dReal *lo, dReal *hi, int *findex); 56 | 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/quickstep.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_QUICK_STEP_H_ 24 | #define _ODE_QUICK_STEP_H_ 25 | 26 | #include 27 | 28 | 29 | void dxQuickStepper (dxWorld *world, dxBody * const *body, int nb, 30 | dxJoint * const *_joint, int nj, dReal stepsize); 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ode/src/step.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. * 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 2.1 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE.TXT. * 13 | * (2) The BSD-style license that is included with this library in * 14 | * the file LICENSE-BSD.TXT. * 15 | * * 16 | * This library is distributed in the hope that it will be useful, * 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 19 | * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 20 | * * 21 | *************************************************************************/ 22 | 23 | #ifndef _ODE_STEP_H_ 24 | #define _ODE_STEP_H_ 25 | 26 | #include 27 | 28 | 29 | void dInternalStepIsland (dxWorld *world, 30 | dxBody * const *body, int nb, 31 | dxJoint * const *joint, int nj, 32 | dReal stepsize); 33 | 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/CHANGELOG.TXT: -------------------------------------------------------------------------------- 1 | ======================= 2 | Legend 3 | ======================= 4 | [+] A feature added 5 | [-] A bug fixed 6 | [*] A change 7 | [!] An important note 8 | ======================= 9 | 10 | 2009/10/07 oleh_derevenko 11 | 12 | [-] Tests corrected to avoid checking int64ou alignment on Macs 13 | (just like for uint64ou) 14 | 15 | 2009/09/08 oleh_derevenko 16 | 17 | [-] Enumerated type increment/decrement operators re-implemented in a way that 18 | can't produce bad code with modern GCCs due to aliasing rules violation. 19 | 20 | 2008/06/26 oleh_derevenko 21 | 22 | [+] --disable-asserts option support added for configure. 23 | 24 | 2008/04/19 oleh_derevenko 25 | 26 | [+] Atomic functions via i486 assembler implementation added (manuall 27 | selection with a preprocessor symbol only). 28 | 29 | 2008/04/16 oleh_derevenko 30 | 31 | [-] Fixed bug with storage memory not being properly zeroed at allocation. 32 | 33 | [*] Memory customization changed to match assertion failure handler 34 | customization. Now it is not necessary to save original pointers, 35 | just NULL-s are to be assigned to revert from customized to 36 | default memory menager. 37 | 38 | 2008/04/08 oleh_derevenko 39 | 40 | [!] Licensing changed: permission to distribute/use library under zlib/libpng 41 | license added. 42 | 43 | 2008/04/07 oleh_derevenko 44 | 45 | [+] Initial commit 46 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/INSTALL.TXT: -------------------------------------------------------------------------------- 1 | Currently OU provides project files for Visual Studio 6, Visual Studio 2005 2 | and makefile for GCC. These are located in "build" directory. 3 | Makefile is quite simple and may not work on some platforms. Makefile does not 4 | have "clean" targets and does not track header changes. Further in this file 5 | you can find how to delete build output files to re-run a clean build. 6 | 7 | There is also a test project file in "test" directory that covers all the 8 | library functionality and allows to make sure everything is fine on 9 | a particular platform. 10 | 11 | All the intermediate files are generated in "intermediate" directory. 12 | Library output files are placed in "lib" directory. 13 | Test binary is placed in "bin" directory. 14 | Having these three folders deleted you can return to initial state. 15 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/LICENSE-BSD.TXT: -------------------------------------------------------------------------------- 1 | 2 | This is the BSD-style license for the ODER's Utilities Library 3 | -------------------------------------------------------------- 4 | 5 | ODER's Utilities Library 6 | Copyright (c) 2008, Oleh Derevenko. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | Redistributions of source code must retain the above copyright notice, 14 | this list of conditions and the following disclaimer. 15 | 16 | Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | Neither the names of ODER's Utilities' copyright owner nor the names of 21 | its contributors may be used to endorse or promote products derived from 22 | this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 30 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 31 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 32 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 33 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/LICENSE-ZLIB.TXT: -------------------------------------------------------------------------------- 1 | The zlib/libpng License for the ODER's Utilities Library 2 | 3 | Copyright (c) 2008 Oleh Derevenko 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign 2 | 3 | EXTRA_DIST = bootstrap \ 4 | CHANGELOG.TXT INSTALL.TXT \ 5 | LICENSE.TXT LICENSE-BSD.TXT LICENSE-LESSER.TXT LICENSE-ZLIB.TXT \ 6 | README.TXT \ 7 | build 8 | 9 | SUBDIRS = include/ou src/ou test 10 | 11 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/README.TXT: -------------------------------------------------------------------------------- 1 | ODER's Utilities Library (OU), Copyright (C) 2008 Oleh Derevenko, 2 | E-mail: odar@eleks.com (change all "a" to "e"). 3 | ------------------------------------------------------------------------- 4 | 5 | OU is a free multi-platform library that provides basic API for 6 | atomic (interlocked) operations and thread local storage. It also 7 | implements assertion checking macros, classes for flags manipulations 8 | (both with ordinary and atomic access), templates for enumerated 9 | values decoding/encoding by static arrays, and some more useful macros 10 | and templates. Most of the library is implemented as inlined code. 11 | Library allows customization of assertion failure handlers and memory 12 | management functions. It is possible to link OU more than once into 13 | a single binary as parts of other libraries. 14 | 15 | This library is free software; you can redistribute it and/or 16 | modify it under the terms of EITHER: 17 | (1) The GNU Lesser General Public License as published by the Free 18 | Software Foundation; either version 3 of the License, or (at 19 | your option) any later version. The text of the GNU Lesser 20 | General Public License is included with this library in the 21 | file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL 22 | the text of GNU General Public License is also provided for 23 | your information in file LICENSE.TXT. 24 | (2) The BSD-style license that is included with this library in 25 | the file LICENSE-BSD.TXT. 26 | (3) The zlib/libpng license that is included with this library in 27 | the file LICENSE-ZLIB.TXT 28 | 29 | This library is distributed WITHOUT ANY WARRANTY, including implied 30 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 31 | See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT 32 | or LICENSE-ZLIB.TXT for more details. 33 | 34 | * Installation instructions are in the INSTALL.TXT file 35 | 36 | All contributions are copyright by their owners, but the owners 37 | automatically transfer unrestricted rights in those changes to the OU 38 | project, which is released under the threefold licenses as indicated. 39 | The owners can also use the contributions in other projects under other 40 | licenses if they want (including sell them), but they can't prevent 41 | anyone from releasing the contributions under the threefold OU licenses 42 | as part of an OU release. 43 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | aclocal --force || exit 1 4 | # on Mac libtoolize is called glibtoolize 5 | LIBTOOLIZE=libtoolize 6 | if [ `uname -s` = Darwin ]; then 7 | LIBTOOLIZE=glibtoolize 8 | fi 9 | $LIBTOOLIZE -f --automake -c || exit 1 10 | autoconf -f || exit 1 11 | automake -a -c -f --foreign || exit 1 12 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/build/make/makefile.os: -------------------------------------------------------------------------------- 1 | ifeq ($(OS), Windows_NT) 2 | 3 | OS_TYPE = WIN32 4 | OS_PLATFORM := i386 5 | 6 | OS_OBJ_EXT = .obj 7 | OS_LIB_EXT = .lib 8 | OS_LIB_PRE = 9 | OS_EXE_EXT = .exe 10 | 11 | FN_CONVERT_PATH = $(subst /,\,$(subst //,/,$(1))) 12 | 13 | FN_RM = $(OS_VP)erase "$(strip $(call FN_CONVERT_PATH, $(1)))" 14 | FN_MKDIR = $(OS_VP)if NOT EXIST "$(strip $(call FN_CONVERT_PATH, $(1)))" mkdir "$(strip $(call FN_CONVERT_PATH, $(1)))" 15 | 16 | OS_INCLUDE_PATH = $(GCC_PATH)/include $(GCC_PATH)/include/win32 17 | OS_LIB_PATH += $(GCC_PATH)/lib $(GCC_PATH)/lib/win32 18 | OS_VP=@ 19 | 20 | else 21 | 22 | OS_OBJ_EXT = .o 23 | OS_LIB_EXT = .a 24 | OS_LIB_PRE = lib 25 | OS_EXE_EXT = 26 | 27 | OS_TYPE = $(subst SunOS,SUN,$(shell uname)) 28 | OS_PLATFORM := $(shell uname -p) 29 | OS_PLATFORM := $(subst x86_64,i386,$(OS_PLATFORM)) 30 | OS_PLATFORM := $(subst i586,i386,$(OS_PLATFORM)) 31 | OS_PLATFORM := $(subst i686,i386,$(OS_PLATFORM)) 32 | 33 | FN_RM = $(OS_VP)rm -rf $(1) 34 | FN_MKDIR = $(OS_VP)test -d $(1) || mkdir -p $(patsubst %/,%,$(1)) 35 | 36 | OS_INCLUDE_PATH = /include /usr/include 37 | OS_LIB_PATH = /lib /usr/lib 38 | OS_VP=@ 39 | 40 | endif 41 | 42 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/build/vs2005/ou.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ou", "ou.vcproj", "{7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "outest", "..\..\test\vs2005\outest.vcproj", "{B2F294B7-F3F0-4876-AD75-6BB24BA020F8}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {7DD3E42F-80C8-430D-87B0-2E6B8147F7D7} = {7DD3E42F-80C8-430D-87B0-2E6B8147F7D7} 9 | EndProjectSection 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Debug|x64 = Debug|x64 15 | Release|Win32 = Release|Win32 16 | Release|x64 = Release|x64 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Debug|Win32.ActiveCfg = Debug|Win32 20 | {7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Debug|Win32.Build.0 = Debug|Win32 21 | {7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Debug|x64.ActiveCfg = Debug|x64 22 | {7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Debug|x64.Build.0 = Debug|x64 23 | {7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Release|Win32.ActiveCfg = Release|Win32 24 | {7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Release|Win32.Build.0 = Release|Win32 25 | {7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Release|x64.ActiveCfg = Release|x64 26 | {7DD3E42F-80C8-430D-87B0-2E6B8147F7D7}.Release|x64.Build.0 = Release|x64 27 | {B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Debug|Win32.ActiveCfg = Debug|Win32 28 | {B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Debug|Win32.Build.0 = Debug|Win32 29 | {B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Debug|x64.ActiveCfg = Debug|x64 30 | {B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Debug|x64.Build.0 = Debug|x64 31 | {B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Release|Win32.ActiveCfg = Release|Win32 32 | {B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Release|Win32.Build.0 = Release|Win32 33 | {B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Release|x64.ActiveCfg = Release|x64 34 | {B2F294B7-F3F0-4876-AD75-6BB24BA020F8}.Release|x64.Build.0 = Release|x64 35 | EndGlobalSection 36 | GlobalSection(SolutionProperties) = preSolution 37 | HideSolutionNode = FALSE 38 | EndGlobalSection 39 | EndGlobal 40 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/build/vs6/ou.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "ou"=.\ou.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "outest"=..\..\test\vs6\outest.dsp - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name ou 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/include/ou/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = assert.h \ 2 | atomicflags.h \ 3 | atomic.h \ 4 | customization.h \ 5 | enumarrays.h \ 6 | flagsdefines.h \ 7 | flags.h \ 8 | inttypes.h \ 9 | macros.h \ 10 | malloc.h \ 11 | namespace.h \ 12 | platform.h \ 13 | simpleflags.h \ 14 | templates.h \ 15 | threadlocalstorage.h \ 16 | typewrapper.h 17 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/include/ou/flags.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * ODER's Utilities Library. Copyright (C) 2008 Oleh Derevenko. * 4 | * All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 3 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL * 13 | * the text of GNU General Public License is also provided for * 14 | * your information in file LICENSE.TXT. * 15 | * (2) The BSD-style license that is included with this library in * 16 | * the file LICENSE-BSD.TXT. * 17 | * (3) The zlib/libpng license that is included with this library in * 18 | * the file LICENSE-ZLIB.TXT * 19 | * * 20 | * This library is distributed WITHOUT ANY WARRANTY, including implied * 21 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * 22 | * See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT * 23 | * or LICENSE-ZLIB.TXT for more details. * 24 | * * 25 | *************************************************************************/ 26 | 27 | #ifndef __OU_FLAGS_H_INCLUDED 28 | #define __OU_FLAGS_H_INCLUDED 29 | 30 | 31 | #include 32 | #include 33 | 34 | 35 | #endif // #ifndef __OU_FLAGS_H_INCLUDED 36 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/include/ou/flagsdefines.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * ODER's Utilities Library. Copyright (C) 2008 Oleh Derevenko. * 4 | * All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 3 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL * 13 | * the text of GNU General Public License is also provided for * 14 | * your information in file LICENSE.TXT. * 15 | * (2) The BSD-style license that is included with this library in * 16 | * the file LICENSE-BSD.TXT. * 17 | * (3) The zlib/libpng license that is included with this library in * 18 | * the file LICENSE-ZLIB.TXT * 19 | * * 20 | * This library is distributed WITHOUT ANY WARRANTY, including implied * 21 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * 22 | * See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT * 23 | * or LICENSE-ZLIB.TXT for more details. * 24 | * * 25 | *************************************************************************/ 26 | 27 | #ifndef __OU_FLAGSDEFINES_H_INCLUDED 28 | #define __OU_FLAGSDEFINES_H_INCLUDED 29 | 30 | 31 | #define OU_FLAGS_ENUMFLAGS_MASK(Type, StartingFlag, EnumMax) ((Type)((Type)((Type)((Type)(StartingFlag) << ((EnumMax) - 1)) - (Type)(StartingFlag)) | (Type)((Type)(StartingFlag) << ((EnumMax) - 1)))) 32 | #define OU_FLAGS_ENUMFLAGS_START_VALID(Type, StartingFlag, EnumMax) ((Type)((Type)(StartingFlag) << ((EnumMax) - 1)) != 0) 33 | #define OU_FLAGS_STOREENUM_VALUE_IN_MASK(Type, EnumValue, ValueMask) ((Type)(ValueMask) != 0 && ((Type)(EnumValue) & (Type)(~((Type)(ValueMask)))) == 0) 34 | #define OU_FLAGS_FLAG_IS_SINGLE(Type, Flag) ((Type)(Flag) != 0 && ((Type)(Flag) & (Type)((Type)(Flag) - (Type)1)) == 0) 35 | 36 | 37 | #endif // #ifndef __OU_FLAGSDEFINES_H_INCLUDED 38 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/include/ou/malloc.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * ODER's Utilities Library. Copyright (C) 2008 Oleh Derevenko. * 4 | * All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 3 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL * 13 | * the text of GNU General Public License is also provided for * 14 | * your information in file LICENSE.TXT. * 15 | * (2) The BSD-style license that is included with this library in * 16 | * the file LICENSE-BSD.TXT. * 17 | * (3) The zlib/libpng license that is included with this library in * 18 | * the file LICENSE-ZLIB.TXT * 19 | * * 20 | * This library is distributed WITHOUT ANY WARRANTY, including implied * 21 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * 22 | * See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT * 23 | * or LICENSE-ZLIB.TXT for more details. * 24 | * * 25 | *************************************************************************/ 26 | 27 | #ifndef __OU_MALLOC_H_INCLUDED 28 | #define __OU_MALLOC_H_INCLUDED 29 | 30 | 31 | #include 32 | #include 33 | 34 | #include 35 | 36 | 37 | BEGIN_NAMESPACE_OU(); 38 | 39 | 40 | void *_OU_CONVENTION_API AllocateMemoryBlock(size_t nBlockSize); 41 | void *_OU_CONVENTION_API ReallocateMemoryBlock(void *pv_ExistingBlock, size_t nNewBlockSize); 42 | void _OU_CONVENTION_API FreeMemoryBlock(void *pv_ExistingBlock); 43 | 44 | 45 | END_NAMESPACE_OU(); 46 | 47 | 48 | #endif // #ifndef __OU_MALLOC_H_INCLUDED 49 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/include/ou/namespace.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * * 3 | * ODER's Utilities Library. Copyright (C) 2008 Oleh Derevenko. * 4 | * All rights reserved. e-mail: odar@eleks.com (change all "a" to "e") * 5 | * * 6 | * This library is free software; you can redistribute it and/or * 7 | * modify it under the terms of EITHER: * 8 | * (1) The GNU Lesser General Public License as published by the Free * 9 | * Software Foundation; either version 3 of the License, or (at * 10 | * your option) any later version. The text of the GNU Lesser * 11 | * General Public License is included with this library in the * 12 | * file LICENSE-LESSER.TXT. Since LGPL is the extension of GPL * 13 | * the text of GNU General Public License is also provided for * 14 | * your information in file LICENSE.TXT. * 15 | * (2) The BSD-style license that is included with this library in * 16 | * the file LICENSE-BSD.TXT. * 17 | * (3) The zlib/libpng license that is included with this library in * 18 | * the file LICENSE-ZLIB.TXT * 19 | * * 20 | * This library is distributed WITHOUT ANY WARRANTY, including implied * 21 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * 22 | * See the files LICENSE.TXT and LICENSE-LESSER.TXT or LICENSE-BSD.TXT * 23 | * or LICENSE-ZLIB.TXT for more details. * 24 | * * 25 | *************************************************************************/ 26 | 27 | #ifndef __OU_NAMESPACE_H_INCLUDED 28 | #define __OU_NAMESPACE_H_INCLUDED 29 | 30 | 31 | #ifndef _OU_NAMESPACE 32 | 33 | #define _OU_NAMESPACE ou 34 | 35 | 36 | #endif // #ifndef _OU_NAMESPACE 37 | 38 | 39 | #define BEGIN_NAMESPACE_OU() namespace _OU_NAMESPACE { 40 | #define END_NAMESPACE_OU() } /* namespace _OU_NAMESPACE */ 41 | 42 | 43 | #endif // #ifndef __OU_NAMESPACE_H_INCLUDED 44 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/src/ou/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | AM_CXXFLAGS = -fno-exceptions -fno-rtti 4 | AM_LDFLAGS = -fno-exceptions -fno-rtti 5 | 6 | noinst_LTLIBRARIES = libou.la 7 | 8 | libou_la_SOURCES = atomic.cpp \ 9 | customization.cpp \ 10 | malloc.cpp \ 11 | threadlocalstorage.cpp 12 | 13 | 14 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/ou/test/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | AM_CXXFLAGS = -fno-exceptions -fno-rtti 3 | AM_LDFLAGS = -fno-exceptions -fno-rtti 4 | 5 | check_PROGRAMS = outest 6 | 7 | outest_SOURCES = outest.cpp 8 | 9 | outest_LDADD = $(top_builddir)/src/ou/libou.la 10 | 11 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = UnitTest++ 2 | 3 | AM_CPPFLAGS = -I $(srcdir)/UnitTest++/src \ 4 | -I $(top_srcdir)/include \ 5 | -I $(top_srcdir)/ode/src 6 | 7 | if GIMPACT 8 | AM_CPPFLAGS += -DdTRIMESH_ENABLED -DdTRIMESH_GIMPACT 9 | endif 10 | if OPCODE 11 | AM_CPPFLAGS += -DdTRIMESH_ENABLED -DdTRIMESH_OPCODE 12 | endif 13 | 14 | LDADD = $(builddir)/UnitTest++/src/libunittestpp.la \ 15 | $(top_builddir)/ode/src/libode.la 16 | 17 | check_PROGRAMS = tests 18 | 19 | TESTS = tests 20 | 21 | tests_SOURCES = main.cpp joint.cpp odemath.cpp collision.cpp \ 22 | joints/ball.cpp \ 23 | joints/fixed.cpp \ 24 | joints/hinge.cpp \ 25 | joints/hinge2.cpp \ 26 | joints/piston.cpp \ 27 | joints/pr.cpp \ 28 | joints/pu.cpp \ 29 | joints/slider.cpp \ 30 | joints/universal.cpp 31 | 32 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006 Noel Llopis and Charles Nicholson 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile.am for UnitTest++ 2 | 3 | SUBDIRS = src 4 | 5 | EXTRA_DIST = docs 6 | 7 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/README: -------------------------------------------------------------------------------- 1 | UnitTest++ README 2 | Version: v1.3 3 | Last update: 2007-4-22 4 | 5 | 6 | UnitTest++ is free software. You may copy, distribute, and modify it under 7 | the terms of the License contained in the file COPYING distributed 8 | with this package. This license is the same as the MIT/X Consortium 9 | license. 10 | 11 | See src/tests/TestUnitTest++.cpp for usage. 12 | 13 | Authors: 14 | Noel Llopis (llopis@convexhull.com) 15 | Charles Nicholson (cn@cnicholson.net) 16 | 17 | Contributors: 18 | Jim Tilander (jim.tilander@gmail.com) 19 | Kim Grasman (kim@mvps.org) 20 | Jonathan Jansson (lilliemarck@users.sourceforge.net) 21 | Dirck Blaskey (listtarget2@danbala.com) 22 | Rory Driscoll (rorydriscoll@gmail.com) 23 | Dan Lind (podcat@gmail.com) 24 | Matt Kimmel (mattkimmel@gmail.com) -- Submitted with permission from Blue Fang Games 25 | Anthony Moralez (anthony.moralez@gmail.com) 26 | Jeff Dixon 27 | 28 | 29 | Release notes 30 | -------------- 31 | Version 1.3 (2007-4-22) 32 | - Removed dynamic memory allocations (other than streams) 33 | - MinGW support 34 | - Consistent (native) line endings 35 | - Minor bug fixing 36 | 37 | Version 1.2 (2006-10-29) 38 | - First pass at documentation. 39 | - More detailed error crash catching in fixtures. 40 | - Standard streams used for printing objects under check. This should allow the 41 | use of standard class types such as std::string or other custom classes with 42 | stream operators to ostream. 43 | - Standard streams can be optionally compiled off by defining UNITTEST_USE_CUSTOM_STREAMS 44 | in Config.h 45 | - Added named test suites 46 | - Added CHECK_ARRAY2D_CLOSE 47 | - Posix library name is libUnitTest++.a now 48 | - Floating point numbers are postfixed with f in the failure reports 49 | 50 | Version 1.1 (2006-04-18) 51 | - CHECK macros do not have side effects even if one of the parameters changes state 52 | - Removed CHECK_ARRAY_EQUAL (too similar to CHECK_ARRAY_CLOSE) 53 | - Added local and global time constraints 54 | - Removed dependencies on strstream 55 | - Improved Posix signal to exception translator 56 | - Failing tests are added to Visual Studio's error list 57 | - Fixed Visual Studio projects to work with spaces in directories 58 | 59 | 60 | Version 1.0 (2006-03-15) 61 | - Initial release 62 | 63 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/AssertException.cpp: -------------------------------------------------------------------------------- 1 | #include "AssertException.h" 2 | #include 3 | 4 | namespace UnitTest { 5 | 6 | AssertException::AssertException(char const* description, char const* filename, int const lineNumber) 7 | : m_lineNumber(lineNumber) 8 | { 9 | std::strcpy(m_description, description); 10 | std::strcpy(m_filename, filename); 11 | } 12 | 13 | AssertException::~AssertException() throw() 14 | { 15 | } 16 | 17 | char const* AssertException::what() const throw() 18 | { 19 | return m_description; 20 | } 21 | 22 | char const* AssertException::Filename() const 23 | { 24 | return m_filename; 25 | } 26 | 27 | int AssertException::LineNumber() const 28 | { 29 | return m_lineNumber; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/AssertException.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_ASSERTEXCEPTION_H 2 | #define UNITTEST_ASSERTEXCEPTION_H 3 | 4 | #include 5 | 6 | 7 | namespace UnitTest { 8 | 9 | class AssertException : public std::exception 10 | { 11 | public: 12 | AssertException(char const* description, char const* filename, int lineNumber); 13 | virtual ~AssertException() throw(); 14 | 15 | virtual char const* what() const throw(); 16 | 17 | char const* Filename() const; 18 | int LineNumber() const; 19 | 20 | private: 21 | char m_description[512]; 22 | char m_filename[256]; 23 | int m_lineNumber; 24 | }; 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Checks.cpp: -------------------------------------------------------------------------------- 1 | #include "Checks.h" 2 | #include 3 | 4 | namespace UnitTest { 5 | 6 | namespace { 7 | 8 | void CheckStringsEqual(TestResults& results, char const* expected, char const* actual, 9 | TestDetails const& details) 10 | { 11 | if (std::strcmp(expected, actual)) 12 | { 13 | UnitTest::MemoryOutStream stream; 14 | stream << "Expected " << expected << " but was " << actual; 15 | 16 | results.OnTestFailure(details, stream.GetText()); 17 | } 18 | } 19 | 20 | } 21 | 22 | 23 | void CheckEqual(TestResults& results, char const* expected, char const* actual, 24 | TestDetails const& details) 25 | { 26 | CheckStringsEqual(results, expected, actual, details); 27 | } 28 | 29 | void CheckEqual(TestResults& results, char* expected, char* actual, 30 | TestDetails const& details) 31 | { 32 | CheckStringsEqual(results, expected, actual, details); 33 | } 34 | 35 | void CheckEqual(TestResults& results, char* expected, char const* actual, 36 | TestDetails const& details) 37 | { 38 | CheckStringsEqual(results, expected, actual, details); 39 | } 40 | 41 | void CheckEqual(TestResults& results, char const* expected, char* actual, 42 | TestDetails const& details) 43 | { 44 | CheckStringsEqual(results, expected, actual, details); 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Config.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_CONFIG_H 2 | #define UNITTEST_CONFIG_H 3 | 4 | // Standard defines documented here: http://predef.sourceforge.net 5 | 6 | #if defined _MSC_VER 7 | #pragma warning(disable:4127) // conditional expression is constant 8 | #pragma warning(disable:4702) // unreachable code 9 | #pragma warning(disable:4722) // destructor never returns, potential memory leak 10 | #endif 11 | 12 | #if defined(unix) || defined(__unix__) || defined(__unix) || defined(linux) || \ 13 | defined(__APPLE__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__FreeBSD__) 14 | #define UNITTEST_POSIX 15 | #endif 16 | 17 | #if defined (__MINGW32__) 18 | #define UNITTEST_MINGW 19 | #endif 20 | 21 | // by default, MemoryOutStream is implemented in terms of std::ostringstream. 22 | // uncomment this line to use the custom MemoryOutStream (no deps on std::ostringstream). 23 | //#define UNITTEST_USE_CUSTOM_STREAMS 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/DeferredTestReporter.cpp: -------------------------------------------------------------------------------- 1 | #include "DeferredTestReporter.h" 2 | #include "TestDetails.h" 3 | 4 | using namespace UnitTest; 5 | 6 | void DeferredTestReporter::ReportTestStart(TestDetails const& details) 7 | { 8 | m_results.push_back(DeferredTestResult(details.suiteName, details.testName)); 9 | } 10 | 11 | void DeferredTestReporter::ReportFailure(TestDetails const& details, char const* failure) 12 | { 13 | DeferredTestResult& r = m_results.back(); 14 | r.failed = true; 15 | r.failures.push_back(DeferredTestResult::Failure(details.lineNumber, failure)); 16 | r.failureFile = details.filename; 17 | } 18 | 19 | void DeferredTestReporter::ReportTestFinish(TestDetails const&, float const secondsElapsed) 20 | { 21 | DeferredTestResult& r = m_results.back(); 22 | r.timeElapsed = secondsElapsed; 23 | } 24 | 25 | DeferredTestReporter::DeferredTestResultList& DeferredTestReporter::GetResults() 26 | { 27 | return m_results; 28 | } 29 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/DeferredTestReporter.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_DEFERREDTESTREPORTER_H 2 | #define UNITTEST_DEFERREDTESTREPORTER_H 3 | 4 | #include "TestReporter.h" 5 | #include "DeferredTestResult.h" 6 | 7 | #include 8 | 9 | namespace UnitTest 10 | { 11 | 12 | class DeferredTestReporter : public TestReporter 13 | { 14 | public: 15 | virtual void ReportTestStart(TestDetails const& details); 16 | virtual void ReportFailure(TestDetails const& details, char const* failure); 17 | virtual void ReportTestFinish(TestDetails const& details, float secondsElapsed); 18 | 19 | typedef std::vector< DeferredTestResult > DeferredTestResultList; 20 | DeferredTestResultList& GetResults(); 21 | 22 | private: 23 | DeferredTestResultList m_results; 24 | }; 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/DeferredTestResult.cpp: -------------------------------------------------------------------------------- 1 | #include "DeferredTestResult.h" 2 | 3 | #include 4 | 5 | namespace UnitTest 6 | { 7 | 8 | DeferredTestResult::DeferredTestResult() 9 | : suiteName("") 10 | , testName("") 11 | , failureFile("") 12 | , timeElapsed(0.0f) 13 | , failed(false) 14 | { 15 | } 16 | 17 | DeferredTestResult::DeferredTestResult(char const* suite, char const* test) 18 | : suiteName(suite) 19 | , testName(test) 20 | , failureFile("") 21 | , timeElapsed(0.0f) 22 | , failed(false) 23 | { 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/DeferredTestResult.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_DEFERREDTESTRESULT_H 2 | #define UNITTEST_DEFERREDTESTRESULT_H 3 | 4 | #include 5 | #include 6 | 7 | namespace UnitTest 8 | { 9 | 10 | struct DeferredTestResult 11 | { 12 | DeferredTestResult(); 13 | DeferredTestResult(char const* suite, char const* test); 14 | 15 | std::string suiteName; 16 | std::string testName; 17 | std::string failureFile; 18 | 19 | typedef std::pair< int, std::string > Failure; 20 | typedef std::vector< Failure > FailureVec; 21 | FailureVec failures; 22 | 23 | float timeElapsed; 24 | bool failed; 25 | }; 26 | 27 | } 28 | 29 | #endif //UNITTEST_DEFERREDTESTRESULT_H 30 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Makefile.am: -------------------------------------------------------------------------------- 1 | if WIN32 2 | SUBDIRS = Win32 3 | else 4 | SUBDIRS = Posix 5 | endif 6 | 7 | 8 | check_LTLIBRARIES = libunittestpp.la 9 | 10 | libunittestpp_la_SOURCES = AssertException.cpp AssertException.h \ 11 | CheckMacros.h Checks.cpp \ 12 | Checks.h Config.h \ 13 | DeferredTestReporter.cpp DeferredTestReporter.h \ 14 | DeferredTestResult.cpp DeferredTestResult.h \ 15 | MemoryOutStream.cpp MemoryOutStream.h \ 16 | ReportAssert.cpp ReportAssert.h \ 17 | Test.cpp TestDetails.cpp \ 18 | TestDetails.h Test.h \ 19 | TestList.cpp TestList.h \ 20 | TestMacros.h TestReporter.cpp \ 21 | TestReporter.h TestReporterStdout.cpp \ 22 | TestReporterStdout.h TestResults.cpp \ 23 | TestResults.h TestRunner.cpp \ 24 | TestRunner.h TestSuite.h \ 25 | TimeConstraint.cpp TimeConstraint.h \ 26 | TimeHelpers.h UnitTest++.h \ 27 | XmlTestReporter.cpp XmlTestReporter.h 28 | if WIN32 29 | libunittestpp_la_LIBADD = $(builddir)/Win32/libhelper.la 30 | else 31 | libunittestpp_la_LIBADD = $(builddir)/Posix/libhelper.la 32 | endif 33 | 34 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/MemoryOutStream.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_MEMORYOUTSTREAM_H 2 | #define UNITTEST_MEMORYOUTSTREAM_H 3 | 4 | #include "Config.h" 5 | 6 | #ifndef UNITTEST_USE_CUSTOM_STREAMS 7 | 8 | #include 9 | 10 | namespace UnitTest 11 | { 12 | 13 | class MemoryOutStream : public std::ostringstream 14 | { 15 | public: 16 | MemoryOutStream() {} 17 | char const* GetText() const; 18 | 19 | private: 20 | MemoryOutStream(MemoryOutStream const&); 21 | void operator =(MemoryOutStream const&); 22 | 23 | mutable std::string m_text; 24 | }; 25 | 26 | } 27 | 28 | #else 29 | 30 | #include 31 | 32 | namespace UnitTest 33 | { 34 | 35 | class MemoryOutStream 36 | { 37 | public: 38 | explicit MemoryOutStream(int const size = 256); 39 | ~MemoryOutStream(); 40 | 41 | char const* GetText() const; 42 | 43 | MemoryOutStream& operator << (char const* txt); 44 | MemoryOutStream& operator << (int n); 45 | MemoryOutStream& operator << (long n); 46 | MemoryOutStream& operator << (unsigned long n); 47 | MemoryOutStream& operator << (float f); 48 | MemoryOutStream& operator << (double d); 49 | MemoryOutStream& operator << (void const* p); 50 | MemoryOutStream& operator << (unsigned int s); 51 | 52 | enum { GROW_CHUNK_SIZE = 32 }; 53 | int GetCapacity() const; 54 | 55 | private: 56 | void operator= (MemoryOutStream const&); 57 | void GrowBuffer(int capacity); 58 | 59 | int m_capacity; 60 | char* m_buffer; 61 | }; 62 | 63 | } 64 | 65 | #endif 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Posix/Makefile.am: -------------------------------------------------------------------------------- 1 | check_LTLIBRARIES = libhelper.la 2 | 3 | libhelper_la_SOURCES = SignalTranslator.cpp SignalTranslator.h \ 4 | TimeHelpers.cpp TimeHelpers.h 5 | 6 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Posix/SignalTranslator.cpp: -------------------------------------------------------------------------------- 1 | #include "SignalTranslator.h" 2 | 3 | namespace UnitTest { 4 | 5 | sigjmp_buf* SignalTranslator::s_jumpTarget = 0; 6 | 7 | namespace { 8 | 9 | void SignalHandler (int sig) 10 | { 11 | siglongjmp(*SignalTranslator::s_jumpTarget, sig ); 12 | } 13 | 14 | } 15 | 16 | 17 | SignalTranslator::SignalTranslator () 18 | { 19 | m_oldJumpTarget = s_jumpTarget; 20 | s_jumpTarget = &m_currentJumpTarget; 21 | 22 | struct sigaction action; 23 | action.sa_flags = 0; 24 | action.sa_handler = SignalHandler; 25 | sigemptyset( &action.sa_mask ); 26 | 27 | sigaction( SIGSEGV, &action, &m_old_SIGSEGV_action ); 28 | sigaction( SIGFPE , &action, &m_old_SIGFPE_action ); 29 | sigaction( SIGTRAP, &action, &m_old_SIGTRAP_action ); 30 | sigaction( SIGBUS , &action, &m_old_SIGBUS_action ); 31 | sigaction( SIGILL , &action, &m_old_SIGBUS_action ); 32 | } 33 | 34 | SignalTranslator::~SignalTranslator() 35 | { 36 | sigaction( SIGILL , &m_old_SIGBUS_action , 0 ); 37 | sigaction( SIGBUS , &m_old_SIGBUS_action , 0 ); 38 | sigaction( SIGTRAP, &m_old_SIGTRAP_action, 0 ); 39 | sigaction( SIGFPE , &m_old_SIGFPE_action , 0 ); 40 | sigaction( SIGSEGV, &m_old_SIGSEGV_action, 0 ); 41 | 42 | s_jumpTarget = m_oldJumpTarget; 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Posix/SignalTranslator.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_SIGNALTRANSLATOR_H 2 | #define UNITTEST_SIGNALTRANSLATOR_H 3 | 4 | #include 5 | #include 6 | 7 | namespace UnitTest { 8 | 9 | class SignalTranslator 10 | { 11 | public: 12 | SignalTranslator(); 13 | ~SignalTranslator(); 14 | 15 | static sigjmp_buf* s_jumpTarget; 16 | 17 | private: 18 | sigjmp_buf m_currentJumpTarget; 19 | sigjmp_buf* m_oldJumpTarget; 20 | 21 | struct sigaction m_old_SIGFPE_action; 22 | struct sigaction m_old_SIGTRAP_action; 23 | struct sigaction m_old_SIGSEGV_action; 24 | struct sigaction m_old_SIGBUS_action; 25 | struct sigaction m_old_SIGABRT_action; 26 | struct sigaction m_old_SIGALRM_action; 27 | }; 28 | 29 | #ifdef SOLARIS 30 | #define UNITTEST_EXTENSION 31 | #else 32 | #define UNITTEST_EXTENSION __extension__ 33 | #endif 34 | 35 | #define UNITTEST_THROW_SIGNALS \ 36 | UnitTest::SignalTranslator sig; \ 37 | if (UNITTEST_EXTENSION sigsetjmp(*UnitTest::SignalTranslator::s_jumpTarget, 1) != 0) \ 38 | throw ("Unhandled system exception"); 39 | 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Posix/TimeHelpers.cpp: -------------------------------------------------------------------------------- 1 | #include "TimeHelpers.h" 2 | #include 3 | 4 | namespace UnitTest { 5 | 6 | Timer::Timer() 7 | { 8 | m_startTime.tv_sec = 0; 9 | m_startTime.tv_usec = 0; 10 | } 11 | 12 | void Timer::Start() 13 | { 14 | gettimeofday(&m_startTime, 0); 15 | } 16 | 17 | 18 | int Timer::GetTimeInMs() const 19 | { 20 | struct timeval currentTime; 21 | gettimeofday(¤tTime, 0); 22 | int const dsecs = currentTime.tv_sec - m_startTime.tv_sec; 23 | int const dus = currentTime.tv_usec - m_startTime.tv_usec; 24 | return dsecs*1000 + dus/1000; 25 | } 26 | 27 | 28 | void TimeHelpers::SleepMs (int ms) 29 | { 30 | usleep(ms * 1000); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Posix/TimeHelpers.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TIMEHELPERS_H 2 | #define UNITTEST_TIMEHELPERS_H 3 | 4 | #include 5 | 6 | namespace UnitTest { 7 | 8 | class Timer 9 | { 10 | public: 11 | Timer(); 12 | void Start(); 13 | int GetTimeInMs() const; 14 | 15 | private: 16 | struct timeval m_startTime; 17 | }; 18 | 19 | 20 | namespace TimeHelpers 21 | { 22 | void SleepMs (int ms); 23 | } 24 | 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/ReportAssert.cpp: -------------------------------------------------------------------------------- 1 | #include "AssertException.h" 2 | 3 | namespace UnitTest { 4 | 5 | void ReportAssert(char const* description, char const* filename, int const lineNumber) 6 | { 7 | throw AssertException(description, filename, lineNumber); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/ReportAssert.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_ASSERT_H 2 | #define UNITTEST_ASSERT_H 3 | 4 | namespace UnitTest { 5 | 6 | void ReportAssert(char const* description, char const* filename, int lineNumber); 7 | 8 | } 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Test.cpp: -------------------------------------------------------------------------------- 1 | #include "Config.h" 2 | #include "Test.h" 3 | #include "TestList.h" 4 | #include "TestResults.h" 5 | #include "AssertException.h" 6 | #include "MemoryOutStream.h" 7 | 8 | #ifdef UNITTEST_POSIX 9 | #include "Posix/SignalTranslator.h" 10 | #endif 11 | 12 | namespace UnitTest { 13 | 14 | TestList& Test::GetTestList() 15 | { 16 | static TestList s_list; 17 | return s_list; 18 | } 19 | 20 | Test::Test(char const* testName, char const* suiteName, char const* filename, int const lineNumber) 21 | : m_details(testName, suiteName, filename, lineNumber) 22 | , next(0) 23 | , m_timeConstraintExempt(false) 24 | { 25 | } 26 | 27 | Test::~Test() 28 | { 29 | } 30 | 31 | void Test::Run(TestResults& testResults) const 32 | { 33 | try 34 | { 35 | #ifdef UNITTEST_POSIX 36 | UNITTEST_THROW_SIGNALS 37 | #endif 38 | RunImpl(testResults); 39 | } 40 | catch (AssertException const& e) 41 | { 42 | testResults.OnTestFailure( TestDetails(m_details.testName, m_details.suiteName, e.Filename(), e.LineNumber()), e.what()); 43 | } 44 | catch (std::exception const& e) 45 | { 46 | MemoryOutStream stream; 47 | stream << "Unhandled exception: " << e.what(); 48 | testResults.OnTestFailure(m_details, stream.GetText()); 49 | } 50 | catch (...) 51 | { 52 | testResults.OnTestFailure(m_details, "Unhandled exception: Crash!"); 53 | } 54 | } 55 | 56 | 57 | void Test::RunImpl(TestResults&) const 58 | { 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Test.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TEST_H 2 | #define UNITTEST_TEST_H 3 | 4 | #include "TestDetails.h" 5 | 6 | namespace UnitTest { 7 | 8 | class TestResults; 9 | class TestList; 10 | 11 | class Test 12 | { 13 | public: 14 | Test(char const* testName, char const* suiteName = "DefaultSuite", char const* filename = "", int lineNumber = 0); 15 | virtual ~Test(); 16 | void Run(TestResults& testResults) const; 17 | 18 | TestDetails const m_details; 19 | Test* next; 20 | mutable bool m_timeConstraintExempt; 21 | 22 | static TestList& GetTestList(); 23 | 24 | private: 25 | virtual void RunImpl(TestResults& testResults_) const; 26 | 27 | Test(Test const&); 28 | Test& operator =(Test const&); 29 | }; 30 | 31 | 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestDetails.cpp: -------------------------------------------------------------------------------- 1 | #include "TestDetails.h" 2 | 3 | namespace UnitTest { 4 | 5 | TestDetails::TestDetails(char const* testName_, char const* suiteName_, char const* filename_, int lineNumber_) 6 | : suiteName(suiteName_) 7 | , testName(testName_) 8 | , filename(filename_) 9 | , lineNumber(lineNumber_) 10 | { 11 | } 12 | 13 | TestDetails::TestDetails(const TestDetails& details, int lineNumber_) 14 | : suiteName(details.suiteName) 15 | , testName(details.testName) 16 | , filename(details.filename) 17 | , lineNumber(lineNumber_) 18 | { 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestDetails.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTDETAILS_H 2 | #define UNITTEST_TESTDETAILS_H 3 | 4 | namespace UnitTest { 5 | 6 | class TestDetails 7 | { 8 | public: 9 | TestDetails(char const* testName, char const* suiteName, char const* filename, int lineNumber); 10 | TestDetails(const TestDetails& details, int lineNumber); 11 | 12 | char const* const suiteName; 13 | char const* const testName; 14 | char const* const filename; 15 | int const lineNumber; 16 | 17 | TestDetails(TestDetails const&); // Why is it public? --> http://gcc.gnu.org/bugs.html#cxx_rvalbind 18 | private: 19 | TestDetails& operator=(TestDetails const&); 20 | }; 21 | 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestList.cpp: -------------------------------------------------------------------------------- 1 | #include "TestList.h" 2 | #include "Test.h" 3 | 4 | #include 5 | 6 | namespace UnitTest { 7 | 8 | TestList::TestList() 9 | : m_head(0) 10 | , m_tail(0) 11 | { 12 | } 13 | 14 | void TestList::Add(Test* test) 15 | { 16 | if (m_tail == 0) 17 | { 18 | assert(m_head == 0); 19 | m_head = test; 20 | m_tail = test; 21 | } 22 | else 23 | { 24 | m_tail->next = test; 25 | m_tail = test; 26 | } 27 | } 28 | 29 | const Test* TestList::GetHead() const 30 | { 31 | return m_head; 32 | } 33 | 34 | ListAdder::ListAdder(TestList& list, Test* test) 35 | { 36 | list.Add(test); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestList.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTLIST_H 2 | #define UNITTEST_TESTLIST_H 3 | 4 | 5 | namespace UnitTest { 6 | 7 | class Test; 8 | 9 | class TestList 10 | { 11 | public: 12 | TestList(); 13 | void Add (Test* test); 14 | 15 | const Test* GetHead() const; 16 | 17 | private: 18 | Test* m_head; 19 | Test* m_tail; 20 | }; 21 | 22 | 23 | class ListAdder 24 | { 25 | public: 26 | ListAdder(TestList& list, Test* test); 27 | }; 28 | 29 | } 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestReporter.cpp: -------------------------------------------------------------------------------- 1 | #include "TestReporter.h" 2 | 3 | namespace UnitTest { 4 | 5 | 6 | TestReporter::~TestReporter() 7 | { 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestReporter.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTREPORTER_H 2 | #define UNITTEST_TESTREPORTER_H 3 | 4 | namespace UnitTest { 5 | 6 | class TestDetails; 7 | 8 | class TestReporter 9 | { 10 | public: 11 | virtual ~TestReporter(); 12 | 13 | virtual void ReportTestStart(TestDetails const& test) = 0; 14 | virtual void ReportFailure(TestDetails const& test, char const* failure) = 0; 15 | virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed) = 0; 16 | virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed) = 0; 17 | }; 18 | 19 | } 20 | #endif 21 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestReporterStdout.cpp: -------------------------------------------------------------------------------- 1 | #include "TestReporterStdout.h" 2 | #include 3 | 4 | #include "TestDetails.h" 5 | 6 | namespace UnitTest { 7 | 8 | void TestReporterStdout::ReportFailure(TestDetails const& details, char const* failure) 9 | { 10 | #ifdef __APPLE__ 11 | char const* const errorFormat = "%s:%d: error: Failure in %s: %s\n"; 12 | #else 13 | char const* const errorFormat = "%s(%d): error: Failure in %s: %s\n"; 14 | #endif 15 | std::printf(errorFormat, details.filename, details.lineNumber, details.testName, failure); 16 | } 17 | 18 | void TestReporterStdout::ReportTestStart(TestDetails const& /*test*/) 19 | { 20 | } 21 | 22 | void TestReporterStdout::ReportTestFinish(TestDetails const& /*test*/, float) 23 | { 24 | } 25 | 26 | void TestReporterStdout::ReportSummary(int const totalTestCount, int const failedTestCount, 27 | int const failureCount, float secondsElapsed) 28 | { 29 | if (failureCount > 0) 30 | std::printf("FAILURE: %d out of %d tests failed (%d failures).\n", failedTestCount, totalTestCount, failureCount); 31 | else 32 | std::printf("Success: %d tests passed.\n", totalTestCount); 33 | std::printf("Test time: %.2f seconds.\n", secondsElapsed); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestReporterStdout.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTREPORTERSTDOUT_H 2 | #define UNITTEST_TESTREPORTERSTDOUT_H 3 | 4 | #include "TestReporter.h" 5 | 6 | namespace UnitTest { 7 | 8 | class TestReporterStdout : public TestReporter 9 | { 10 | private: 11 | virtual void ReportTestStart(TestDetails const& test); 12 | virtual void ReportFailure(TestDetails const& test, char const* failure); 13 | virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed); 14 | virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed); 15 | }; 16 | 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestResults.cpp: -------------------------------------------------------------------------------- 1 | #include "TestResults.h" 2 | #include "TestReporter.h" 3 | 4 | #include "TestDetails.h" 5 | 6 | namespace UnitTest { 7 | 8 | TestResults::TestResults(TestReporter* testReporter) 9 | : m_testReporter(testReporter) 10 | , m_totalTestCount(0) 11 | , m_failedTestCount(0) 12 | , m_failureCount(0) 13 | , m_currentTestFailed(false) 14 | { 15 | } 16 | 17 | void TestResults::OnTestStart(TestDetails const& test) 18 | { 19 | ++m_totalTestCount; 20 | m_currentTestFailed = false; 21 | if (m_testReporter) 22 | m_testReporter->ReportTestStart(test); 23 | } 24 | 25 | void TestResults::OnTestFailure(TestDetails const& test, char const* failure) 26 | { 27 | ++m_failureCount; 28 | if (!m_currentTestFailed) 29 | { 30 | ++m_failedTestCount; 31 | m_currentTestFailed = true; 32 | } 33 | 34 | if (m_testReporter) 35 | m_testReporter->ReportFailure(test, failure); 36 | } 37 | 38 | void TestResults::OnTestFinish(TestDetails const& test, float secondsElapsed) 39 | { 40 | if (m_testReporter) 41 | m_testReporter->ReportTestFinish(test, secondsElapsed); 42 | } 43 | 44 | int TestResults::GetTotalTestCount() const 45 | { 46 | return m_totalTestCount; 47 | } 48 | 49 | int TestResults::GetFailedTestCount() const 50 | { 51 | return m_failedTestCount; 52 | } 53 | 54 | int TestResults::GetFailureCount() const 55 | { 56 | return m_failureCount; 57 | } 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestResults.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTRESULTS_H 2 | #define UNITTEST_TESTRESULTS_H 3 | 4 | namespace UnitTest { 5 | 6 | class TestReporter; 7 | class TestDetails; 8 | 9 | class TestResults 10 | { 11 | public: 12 | explicit TestResults(TestReporter* reporter = 0); 13 | 14 | void OnTestStart(TestDetails const& test); 15 | void OnTestFailure(TestDetails const& test, char const* failure); 16 | void OnTestFinish(TestDetails const& test, float secondsElapsed); 17 | 18 | int GetTotalTestCount() const; 19 | int GetFailedTestCount() const; 20 | int GetFailureCount() const; 21 | 22 | private: 23 | TestReporter* m_testReporter; 24 | int m_totalTestCount; 25 | int m_failedTestCount; 26 | int m_failureCount; 27 | 28 | bool m_currentTestFailed; 29 | 30 | TestResults(TestResults const&); 31 | TestResults& operator =(TestResults const&); 32 | }; 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestRunner.cpp: -------------------------------------------------------------------------------- 1 | #include "TestRunner.h" 2 | #include "TestResults.h" 3 | #include "Test.h" 4 | #include "TestList.h" 5 | #include "TestReporter.h" 6 | #include "TestReporterStdout.h" 7 | #include "TimeHelpers.h" 8 | #include "MemoryOutStream.h" 9 | #include 10 | 11 | 12 | namespace UnitTest { 13 | 14 | 15 | int RunAllTests(TestReporter& reporter, TestList const& list, char const* suiteName, int const maxTestTimeInMs ) 16 | { 17 | TestResults result(&reporter); 18 | 19 | Timer overallTimer; 20 | overallTimer.Start(); 21 | 22 | Test const* curTest = list.GetHead(); 23 | while (curTest != 0) 24 | { 25 | if (suiteName == 0 || !std::strcmp(curTest->m_details.suiteName, suiteName)) 26 | { 27 | Timer testTimer; 28 | testTimer.Start(); 29 | result.OnTestStart(curTest->m_details); 30 | 31 | curTest->Run(result); 32 | 33 | int const testTimeInMs = testTimer.GetTimeInMs(); 34 | if (maxTestTimeInMs > 0 && testTimeInMs > maxTestTimeInMs && !curTest->m_timeConstraintExempt) 35 | { 36 | MemoryOutStream stream; 37 | stream << "Global time constraint failed. Expected under " << maxTestTimeInMs << 38 | "ms but took " << testTimeInMs << "ms."; 39 | result.OnTestFailure(curTest->m_details, stream.GetText()); 40 | } 41 | result.OnTestFinish(curTest->m_details, testTimeInMs/1000.0f); 42 | } 43 | 44 | curTest = curTest->next; 45 | } 46 | 47 | float const secondsElapsed = overallTimer.GetTimeInMs() / 1000.0f; 48 | reporter.ReportSummary(result.GetTotalTestCount(), result.GetFailedTestCount(), result.GetFailureCount(), secondsElapsed); 49 | 50 | return result.GetFailureCount(); 51 | } 52 | 53 | 54 | int RunAllTests() 55 | { 56 | TestReporterStdout reporter; 57 | return RunAllTests(reporter, Test::GetTestList(), 0); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestRunner.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTRUNNER_H 2 | #define UNITTEST_TESTRUNNER_H 3 | 4 | 5 | namespace UnitTest { 6 | 7 | class TestReporter; 8 | class TestList; 9 | 10 | 11 | int RunAllTests(); 12 | int RunAllTests(TestReporter& reporter, TestList const& list, char const* suiteName, int maxTestTimeInMs = 0); 13 | 14 | } 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TestSuite.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TESTSUITE_H 2 | #define UNITTEST_TESTSUITE_H 3 | 4 | namespace UnitTestSuite { 5 | 6 | inline char const* GetSuiteName () 7 | { 8 | return "DefaultSuite"; 9 | } 10 | 11 | } 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TimeConstraint.cpp: -------------------------------------------------------------------------------- 1 | #include "TimeConstraint.h" 2 | #include "TestResults.h" 3 | #include "MemoryOutStream.h" 4 | 5 | namespace UnitTest { 6 | 7 | 8 | TimeConstraint::TimeConstraint(int ms, TestResults& result, TestDetails const& details) 9 | : m_result(result) 10 | , m_details(details) 11 | , m_maxMs(ms) 12 | { 13 | m_timer.Start(); 14 | } 15 | 16 | TimeConstraint::~TimeConstraint() 17 | { 18 | int const totalTimeInMs = m_timer.GetTimeInMs(); 19 | if (totalTimeInMs > m_maxMs) 20 | { 21 | MemoryOutStream stream; 22 | stream << "Time constraint failed. Expected to run test under " << m_maxMs << 23 | "ms but took " << totalTimeInMs << "ms."; 24 | m_result.OnTestFailure(m_details, stream.GetText()); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TimeConstraint.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TIMECONSTRAINT_H 2 | #define UNITTEST_TIMECONSTRAINT_H 3 | 4 | #include "TimeHelpers.h" 5 | 6 | namespace UnitTest { 7 | 8 | class TestResults; 9 | class TestDetails; 10 | 11 | class TimeConstraint 12 | { 13 | public: 14 | TimeConstraint(int ms, TestResults& result, TestDetails const& details); 15 | ~TimeConstraint(); 16 | 17 | private: 18 | void operator=(TimeConstraint const&); 19 | TimeConstraint(TimeConstraint const&); 20 | 21 | Timer m_timer; 22 | TestResults& m_result; 23 | TestDetails const& m_details; 24 | int const m_maxMs; 25 | }; 26 | 27 | #define UNITTEST_TIME_CONSTRAINT(ms) \ 28 | UnitTest::TimeConstraint unitTest__timeConstraint__(ms, testResults_, UnitTest::TestDetails(m_details, __LINE__)) 29 | 30 | #define UNITTEST_TIME_CONSTRAINT_EXEMPT() do { m_timeConstraintExempt = true; } while (0) 31 | 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/TimeHelpers.h: -------------------------------------------------------------------------------- 1 | #include "Config.h" 2 | 3 | #if defined UNITTEST_POSIX 4 | #include "Posix/TimeHelpers.h" 5 | #else 6 | #include "Win32/TimeHelpers.h" 7 | #endif 8 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/UnitTest++.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTESTCPP_H 2 | #define UNITTESTCPP_H 3 | 4 | #include "Config.h" 5 | #include "Test.h" 6 | #include "TestList.h" 7 | #include "TestSuite.h" 8 | #include "TestResults.h" 9 | 10 | #include 11 | #include "TestMacros.h" 12 | 13 | #include "CheckMacros.h" 14 | #include "TestRunner.h" 15 | #include "TimeConstraint.h" 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Win32/Makefile.am: -------------------------------------------------------------------------------- 1 | check_LTLIBRARIES = libhelper.la 2 | 3 | libhelper_la_SOURCES = TimeHelpers.cpp TimeHelpers.h 4 | 5 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Win32/TimeHelpers.cpp: -------------------------------------------------------------------------------- 1 | #include "TimeHelpers.h" 2 | #include 3 | 4 | namespace UnitTest { 5 | 6 | Timer::Timer() 7 | : m_startTime(0) 8 | { 9 | m_threadId = ::GetCurrentThread(); 10 | DWORD_PTR systemMask; 11 | ::GetProcessAffinityMask(GetCurrentProcess(), &m_processAffinityMask, &systemMask); 12 | 13 | ::SetThreadAffinityMask(m_threadId, 1); 14 | ::QueryPerformanceFrequency(reinterpret_cast< LARGE_INTEGER* >(&m_frequency)); 15 | ::SetThreadAffinityMask(m_threadId, m_processAffinityMask); 16 | } 17 | 18 | void Timer::Start() 19 | { 20 | m_startTime = GetTime(); 21 | } 22 | 23 | int Timer::GetTimeInMs() const 24 | { 25 | __int64 const elapsedTime = GetTime() - m_startTime; 26 | double const seconds = double(elapsedTime) / double(m_frequency); 27 | return int(seconds * 1000.0f); 28 | } 29 | 30 | __int64 Timer::GetTime() const 31 | { 32 | LARGE_INTEGER curTime; 33 | ::SetThreadAffinityMask(m_threadId, 1); 34 | ::QueryPerformanceCounter(&curTime); 35 | ::SetThreadAffinityMask(m_threadId, m_processAffinityMask); 36 | return curTime.QuadPart; 37 | } 38 | 39 | 40 | 41 | void TimeHelpers::SleepMs(int const ms) 42 | { 43 | ::Sleep(ms); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/Win32/TimeHelpers.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_TIMEHELPERS_H 2 | #define UNITTEST_TIMEHELPERS_H 3 | 4 | #include "../Config.h" 5 | 6 | 7 | #ifdef UNITTEST_MINGW 8 | #ifndef __int64 9 | #define __int64 long long 10 | #endif 11 | #endif 12 | 13 | namespace UnitTest { 14 | 15 | class Timer 16 | { 17 | public: 18 | Timer(); 19 | void Start(); 20 | int GetTimeInMs() const; 21 | 22 | private: 23 | __int64 GetTime() const; 24 | 25 | void* m_threadId; 26 | 27 | #if defined(_WIN64) 28 | unsigned __int64 m_processAffinityMask; 29 | #else 30 | unsigned long m_processAffinityMask; 31 | #endif 32 | 33 | __int64 m_startTime; 34 | __int64 m_frequency; 35 | }; 36 | 37 | 38 | namespace TimeHelpers 39 | { 40 | void SleepMs (int ms); 41 | } 42 | 43 | 44 | } 45 | 46 | 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/UnitTest++/src/XmlTestReporter.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITTEST_XMLTESTREPORTER_H 2 | #define UNITTEST_XMLTESTREPORTER_H 3 | 4 | #include "DeferredTestReporter.h" 5 | 6 | #include 7 | 8 | namespace UnitTest 9 | { 10 | 11 | class XmlTestReporter : public DeferredTestReporter 12 | { 13 | public: 14 | explicit XmlTestReporter(std::ostream& ostream); 15 | 16 | virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed); 17 | 18 | private: 19 | XmlTestReporter(XmlTestReporter const&); 20 | XmlTestReporter& operator=(XmlTestReporter const&); 21 | 22 | void AddXmlElement(std::ostream& os, char const* encoding); 23 | void BeginResults(std::ostream& os, int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed); 24 | void EndResults(std::ostream& os); 25 | void BeginTest(std::ostream& os, DeferredTestResult const& result); 26 | void AddFailure(std::ostream& os, DeferredTestResult const& result); 27 | void EndTest(std::ostream& os, DeferredTestResult const& result); 28 | 29 | std::ostream& m_ostream; 30 | }; 31 | 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tests/main.cpp: -------------------------------------------------------------------------------- 1 | // openode_UnitTest++.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | #include 5 | 6 | int main() 7 | { 8 | return UnitTest::RunAllTests(); 9 | } 10 | -------------------------------------------------------------------------------- /resources/ode-0.11.1/tools/ode_convex_export.py: -------------------------------------------------------------------------------- 1 | #!BPY 2 | """ 3 | Name: 'ODE Convex...' 4 | Blender: 244 5 | Group: 'Export' 6 | Tooltip: 'Export to Open Dynamics.' 7 | """ 8 | __author__ = "Rodrigo Hernandez" 9 | __url__ = ("http://www.ode.org") 10 | __version__ = "0.1" 11 | __bpydoc__ = """\ 12 | ODE Convex Exporter 13 | This script Exports a Blender scene as a series of ODE Convex Geom data stored in a C header file. 14 | """ 15 | import Blender 16 | import bpy 17 | #import struct 18 | 19 | def WriteMesh(file,ob): 20 | mesh = ob.getData(mesh=1) 21 | # Write Point Count 22 | file.write("unsigned int %s_pointcount = %d;\n" % (ob.getName(),len(mesh.verts))) 23 | # Write Plane Count 24 | file.write("unsigned int %s_planecount = %d;\n" % (ob.getName(),len(mesh.faces))) 25 | # Write Points 26 | file.write("dReal %s_points[%d]={\n" % (ob.getName(),(len(mesh.verts)*3))) 27 | for vert in mesh.verts: 28 | if vert.index==(len(mesh.verts)-1): 29 | file.write("%f,%f,%f\n};\n" % (vert.co[0],vert.co[1],vert.co[2])) 30 | else: 31 | file.write("%f,%f,%f,\n" % (vert.co[0],vert.co[1],vert.co[2])) 32 | # Write Polygons 33 | file.write("unsigned int %s_polygons[]={\n" % ob.getName()) 34 | for face in mesh.faces: 35 | file.write("%d," % len(face.verts)) 36 | for vert in face.verts: 37 | file.write("%d," % vert.index) 38 | if face.index==(len(mesh.faces)-1): 39 | file.write("\n};\n"); 40 | else: 41 | file.write("\n"); 42 | # Write Planes 43 | file.write("dReal %s_planes[]={\n" % ob.getName()) 44 | for face in mesh.faces: 45 | # d calculated separatelly for code readability 46 | d = face.no[0]*face.verts[0].co[0]+face.no[1]*face.verts[0].co[1]+face.no[2]*face.verts[0].co[2] 47 | file.write("%f,%f,%f,%f,\n" % (face.no[0],face.no[1],face.no[2],d)) 48 | file.write("};\n"); 49 | 50 | # Entry Point 51 | sce = bpy.data.scenes.active 52 | in_editmode = Blender.Window.EditMode() 53 | if in_editmode: Blender.Window.EditMode(0) 54 | file = open("convex.h",mode='wt') 55 | for ob in sce.objects: 56 | if ob.getType()=='Mesh': 57 | WriteMesh(file,ob) 58 | file.close() 59 | if in_editmode: 60 | Blender.Window.EditMode(1) 61 | print "ODE Export Done" -------------------------------------------------------------------------------- /shared/Config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Networked Physics Demo 3 | Copyright © 2008-2011 Glenn Fiedler 4 | http://www.gafferongames.com/networking-for-game-programmers 5 | */ 6 | 7 | #ifndef CONFIG_H 8 | #define CONFIG_H 9 | 10 | #define LETTERBOX 11 | #define WIDESCREEN 12 | #define SHADOWS 13 | #define MULTISAMPLING 14 | //#define MULTITHREADED 15 | #define THREAD_STACK_SIZE 8 * 1024 * 1024 16 | 17 | //#define USE_SECONDARY_DISPLAY_IF_EXISTS 18 | //#define DEBUG_SHADOW_VOLUMES 19 | //#define FRUSTUM_CULLING 20 | //#define DISCOVER_KEY_CODES 21 | 22 | const int MaxPlayers = 2; 23 | 24 | const float ColorChangeTightness = 0.1f; 25 | const float ShadowAlphaThreshold = 0.25f; 26 | const float PositionSmoothingTightness = 0.075f; 27 | const float OrientationSmoothingTightness = 0.2f; 28 | const int MaxViewObjects = 1024; 29 | const int MaxShadowVertices = ( 6 * 4 ) * MaxViewObjects; 30 | const int MaxDynamicVertices = 24 * MaxViewObjects; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /shared/Game.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Networked Physics Demo 3 | Copyright © 2008-2011 Glenn Fiedler 4 | http://www.gafferongames.com/networking-for-game-programmers 5 | */ 6 | 7 | #include "PreCompiled.h" 8 | #include "Game.h" 9 | 10 | namespace game 11 | { 12 | // ... 13 | } 14 | -------------------------------------------------------------------------------- /shared/Simulation.h: -------------------------------------------------------------------------------- 1 | /* 2 | Networked Physics Demo 3 | Copyright © 2008-2011 Glenn Fiedler 4 | http://www.gafferongames.com/networking-for-game-programmers 5 | */ 6 | 7 | #ifndef SIMULATION_H 8 | #define SIMULATION_H 9 | 10 | #include "Config.h" 11 | 12 | namespace engine 13 | { 14 | // simulation config 15 | 16 | struct SimulationConfig 17 | { 18 | float ERP; 19 | float CFM; 20 | int MaxIterations; 21 | float Gravity; 22 | float LinearDrag; 23 | float AngularDrag; 24 | float Friction; 25 | float Elasticity; 26 | float ContactSurfaceLayer; 27 | float MaximumCorrectingVelocity; 28 | bool QuickStep; 29 | float RestTime; 30 | float LinearRestThresholdSquared; 31 | float AngularRestThresholdSquared; 32 | 33 | SimulationConfig() 34 | { 35 | ERP = 0.1f; 36 | CFM = 0.001f; 37 | MaxIterations = 12; 38 | MaximumCorrectingVelocity = 100.0f; 39 | ContactSurfaceLayer = 0.02f; 40 | Elasticity = 0.2f; 41 | LinearDrag = 0.0f; 42 | AngularDrag = 0.0f; 43 | Friction = 100.0f; 44 | Gravity = 20.0f; 45 | QuickStep = true; 46 | RestTime = 0.2f; 47 | LinearRestThresholdSquared = 0.2f * 0.2f; 48 | AngularRestThresholdSquared = 0.2f * 0.2f; 49 | } 50 | }; 51 | 52 | // new simulation state 53 | 54 | struct SimulationObjectState 55 | { 56 | bool enabled; 57 | float scale; 58 | math::Vector position; 59 | math::Quaternion orientation; 60 | math::Vector linearVelocity; 61 | math::Vector angularVelocity; 62 | }; 63 | 64 | // simulation class with dynamic object allocation 65 | 66 | class Simulation 67 | { 68 | static int * GetInitCount(); 69 | 70 | public: 71 | 72 | Simulation(); 73 | ~Simulation(); 74 | 75 | void Initialize( const SimulationConfig & config = SimulationConfig() ); 76 | 77 | void Update( float deltaTime, bool paused = false ); 78 | 79 | int AddObject( const SimulationObjectState & initialObjectState ); 80 | 81 | bool ObjectExists( int id ); 82 | 83 | float GetObjectMass( int id ); 84 | 85 | void RemoveObject( int id ); 86 | 87 | void GetObjectState( int id, SimulationObjectState & objectState ); 88 | 89 | void SetObjectState( int id, const SimulationObjectState & objectState, bool ignoreEnabledFlag = false ); 90 | 91 | const std::vector & GetObjectInteractions( int id ) const; 92 | 93 | int GetNumInteractionPairs() const; 94 | 95 | void ApplyForce( int id, const math::Vector & force ); 96 | 97 | void ApplyTorque( int id, const math::Vector & torque ); 98 | 99 | void AddPlane( const math::Vector & normal, float d ); 100 | 101 | void Reset(); 102 | 103 | private: 104 | 105 | struct SimulationImpl * impl; 106 | }; 107 | } 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /shared/ViewObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | Networked Physics Demo 3 | Copyright © 2008-2011 Glenn Fiedler 4 | http://www.gafferongames.com/networking-for-game-programmers 5 | */ 6 | 7 | #ifndef VIEW_OBJECT_H 8 | #define VIEW_OBJECT_H 9 | 10 | #include "shared/Config.h" 11 | 12 | namespace view 13 | { 14 | struct ObjectState 15 | { 16 | math::Quaternion orientation; 17 | math::Vector position; 18 | math::Vector linearVelocity; 19 | math::Vector angularVelocity; 20 | uint32_t pendingDeactivation : 1; 21 | uint32_t enabled : 1; 22 | uint32_t id : 20; 23 | uint32_t owner : 3; 24 | uint32_t authority : 3; 25 | float scale; 26 | 27 | ObjectState() 28 | { 29 | // NETHACK: do we really need a default construct for this? 30 | this->id = 0; 31 | owner = MaxPlayers; 32 | authority = MaxPlayers; 33 | position = math::Vector(0,0,0); 34 | orientation = math::Quaternion(1,0,0,0); 35 | linearVelocity = math::Vector(0,0,0); 36 | angularVelocity = math::Vector(0,0,0); 37 | scale = 1.0f; 38 | enabled = 1; 39 | pendingDeactivation = 0; 40 | } 41 | }; 42 | 43 | struct Packet 44 | { 45 | int droppedFrames; 46 | float netTime; 47 | float simTime; 48 | math::Vector origin; 49 | int objectCount; 50 | ObjectState object[MaxViewObjects]; 51 | 52 | Packet() 53 | { 54 | droppedFrames = 0; 55 | netTime = 0.0f; 56 | simTime = 0.0f; 57 | origin = math::Vector(0,0,0); 58 | objectCount = 0; 59 | } 60 | }; 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /vectorial/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Vectorial 3 | Copyright (c) 2010 Mikko Lehtonen 4 | Licensed under the terms of the two-clause BSD License (see LICENSE) 5 | */ 6 | #ifndef VECTORIAL_CONFIG_H 7 | #define VECTORIAL_CONFIG_H 8 | 9 | 10 | #ifndef VECTORIAL_FORCED 11 | #if defined(__SSE__) 12 | 13 | #define VECTORIAL_SSE 14 | 15 | #elif defined(__ARM_NEON__) 16 | 17 | #define VECTORIAL_NEON 18 | 19 | // Don't use gnu extension for arm, buggy with some gccs with armv6 and -Os, 20 | // Also doesn't seem perform as well 21 | #elif defined(__GNUC__) && !defined(__arm__) 22 | 23 | #define VECTORIAL_GNU 24 | 25 | #else 26 | 27 | #define VECTORIAL_SCALAR 28 | 29 | #endif 30 | #endif 31 | 32 | 33 | 34 | #ifdef VECTORIAL_SCALAR 35 | #define VECTORIAL_SIMD_TYPE "scalar" 36 | #endif 37 | 38 | #ifdef VECTORIAL_SSE 39 | #define VECTORIAL_SIMD_TYPE "sse" 40 | #endif 41 | 42 | #ifdef VECTORIAL_NEON 43 | #define VECTORIAL_SIMD_TYPE "neon" 44 | #endif 45 | 46 | #ifdef VECTORIAL_GNU 47 | #define VECTORIAL_SIMD_TYPE "gnu" 48 | #endif 49 | 50 | 51 | 52 | #if defined(VECTORIAL_FORCED) && !defined(VECTORIAL_SIMD_TYPE) 53 | #error VECTORIAL_FORCED set but no simd-type found, try f.ex. VECTORIAL_SCALAR 54 | #endif 55 | 56 | 57 | #define vectorial_inline static inline 58 | 59 | #if defined(__GNUC__) 60 | #if defined(__cplusplus) 61 | #define vectorial_restrict __restrict 62 | #endif 63 | #elif defined(_WIN32) 64 | #define vectorial_restrict 65 | #else 66 | #define vectorial_restrict restrict 67 | #endif 68 | // #define vectorial_restrict 69 | 70 | #ifdef __GNUC__ 71 | #define vectorial_pure __attribute__((pure)) 72 | #else 73 | #define vectorial_pure 74 | #endif 75 | 76 | 77 | #ifdef __cplusplus 78 | // Hack around msvc badness 79 | #define SIMD_PARAM(t, p) const t& p 80 | #else 81 | #define SIMD_PARAM(t, p) t p 82 | #endif 83 | 84 | #define VECTORIAL_PI 3.14159265f 85 | #define VECTORIAL_HALFPI 1.57079633f 86 | 87 | 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /vectorial/simd4f.h: -------------------------------------------------------------------------------- 1 | /* 2 | Vectorial 3 | Copyright (c) 2010 Mikko Lehtonen 4 | Licensed under the terms of the two-clause BSD License (see LICENSE) 5 | */ 6 | 7 | #ifndef VECTORIAL_SIMD4F_H 8 | #define VECTORIAL_SIMD4F_H 9 | 10 | #ifndef VECTORIAL_CONFIG_H 11 | #include "vectorial/config.h" 12 | #endif 13 | 14 | 15 | #ifdef VECTORIAL_SCALAR 16 | #include "simd4f_scalar.h" 17 | #elif defined(VECTORIAL_SSE) 18 | #include "simd4f_sse.h" 19 | #elif defined(VECTORIAL_GNU) 20 | #include "simd4f_gnu.h" 21 | #elif defined(VECTORIAL_NEON) 22 | #include "simd4f_neon.h" 23 | #else 24 | #error No implementation defined 25 | #endif 26 | 27 | #include "simd4f_common.h" 28 | 29 | 30 | 31 | #ifdef __cplusplus 32 | 33 | #ifdef VECTORIAL_OSTREAM 34 | #include 35 | 36 | vectorial_inline std::ostream& operator<<(std::ostream& os, const simd4f& v) { 37 | os << "simd4f(" << simd4f_get_x(v) << ", " 38 | << simd4f_get_y(v) << ", " 39 | << simd4f_get_z(v) << ", " 40 | << simd4f_get_w(v) << ")"; 41 | return os; 42 | } 43 | #endif 44 | 45 | #endif 46 | 47 | 48 | 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /vectorial/simd4f_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | Vectorial 3 | Copyright (c) 2010 Mikko Lehtonen 4 | Licensed under the terms of the two-clause BSD License (see LICENSE) 5 | */ 6 | #ifndef VECTORIAL_SIMD4F_COMMON_H 7 | #define VECTORIAL_SIMD4F_COMMON_H 8 | 9 | 10 | vectorial_inline simd4f simd4f_sum(simd4f v) { 11 | const simd4f s1 = simd4f_add(simd4f_splat_x(v), simd4f_splat_y(v)); 12 | const simd4f s2 = simd4f_add(s1, simd4f_splat_z(v)); 13 | const simd4f s3 = simd4f_add(s2, simd4f_splat_w(v)); 14 | return s3; 15 | } 16 | 17 | vectorial_inline simd4f simd4f_dot4(simd4f lhs, simd4f rhs) { 18 | return simd4f_sum( simd4f_mul(lhs, rhs) ); 19 | } 20 | 21 | vectorial_inline simd4f simd4f_dot3(simd4f lhs, simd4f rhs) { 22 | const simd4f m = simd4f_mul(lhs, rhs); 23 | const simd4f s1 = simd4f_add(simd4f_splat_x(m), simd4f_splat_y(m)); 24 | const simd4f s2 = simd4f_add(s1, simd4f_splat_z(m)); 25 | return s2; 26 | } 27 | 28 | vectorial_inline simd4f simd4f_dot2(simd4f lhs, simd4f rhs) { 29 | const simd4f m = simd4f_mul(lhs, rhs); 30 | const simd4f s1 = simd4f_add(simd4f_splat_x(m), simd4f_splat_y(m)); 31 | return s1; 32 | } 33 | 34 | 35 | vectorial_inline simd4f simd4f_length4(simd4f v) { 36 | return simd4f_sqrt( simd4f_dot4(v,v) ); 37 | } 38 | 39 | vectorial_inline simd4f simd4f_length3(simd4f v) { 40 | return simd4f_sqrt( simd4f_dot3(v,v) ); 41 | } 42 | 43 | vectorial_inline simd4f simd4f_length2(simd4f v) { 44 | return simd4f_sqrt( simd4f_dot2(v,v) ); 45 | } 46 | 47 | vectorial_inline simd4f simd4f_length4_squared(simd4f v) { 48 | return simd4f_dot4(v,v); 49 | } 50 | 51 | vectorial_inline simd4f simd4f_length3_squared(simd4f v) { 52 | return simd4f_dot3(v,v); 53 | } 54 | 55 | vectorial_inline simd4f simd4f_length2_squared(simd4f v) { 56 | return simd4f_dot2(v,v); 57 | } 58 | 59 | 60 | vectorial_inline simd4f simd4f_normalize4(simd4f a) { 61 | simd4f invlen = simd4f_rsqrt( simd4f_dot4(a,a) ); 62 | return simd4f_mul(a, invlen); 63 | } 64 | 65 | vectorial_inline simd4f simd4f_normalize3(simd4f a) { 66 | simd4f invlen = simd4f_rsqrt( simd4f_dot3(a,a) ); 67 | return simd4f_mul(a, invlen); 68 | } 69 | 70 | vectorial_inline simd4f simd4f_normalize2(simd4f a) { 71 | simd4f invlen = simd4f_rsqrt( simd4f_dot2(a,a) ); 72 | return simd4f_mul(a, invlen); 73 | } 74 | 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /vectorial/simd4x4f_gnu.h: -------------------------------------------------------------------------------- 1 | /* 2 | Vectorial 3 | Copyright (c) 2010 Mikko Lehtonen 4 | Licensed under the terms of the two-clause BSD License (see LICENSE) 5 | */ 6 | #ifndef VECTORIAL_SIMD4X4F_GNU_H 7 | #define VECTORIAL_SIMD4X4F_GNU_H 8 | 9 | 10 | 11 | vectorial_inline void simd4x4f_transpose_inplace(simd4x4f* s) { 12 | const _simd4f_union sx = { s->x }; 13 | const _simd4f_union sy = { s->y }; 14 | const _simd4f_union sz = { s->z }; 15 | const _simd4f_union sw = { s->w }; 16 | 17 | const simd4f dx = { sx.f[0], sy.f[0], sz.f[0], sw.f[0] }; 18 | const simd4f dy = { sx.f[1], sy.f[1], sz.f[1], sw.f[1] }; 19 | const simd4f dz = { sx.f[2], sy.f[2], sz.f[2], sw.f[2] }; 20 | const simd4f dw = { sx.f[3], sy.f[3], sz.f[3], sw.f[3] }; 21 | 22 | s->x = dx; 23 | s->y = dy; 24 | s->z = dz; 25 | s->w = dw; 26 | 27 | } 28 | 29 | vectorial_inline void simd4x4f_transpose(const simd4x4f *s, simd4x4f *out) { 30 | *out=*s; 31 | simd4x4f_transpose_inplace(out); 32 | } 33 | 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /vectorial/simd4x4f_neon.h: -------------------------------------------------------------------------------- 1 | /* 2 | Vectorial 3 | Copyright (c) 2010 Mikko Lehtonen 4 | Licensed under the terms of the two-clause BSD License (see LICENSE) 5 | */ 6 | #ifndef VECTORIAL_SIMD4X4F_NEON_H 7 | #define VECTORIAL_SIMD4X4F_NEON_H 8 | 9 | 10 | vectorial_inline void simd4x4f_transpose_inplace(simd4x4f* s) { 11 | const _simd4f_union sx = { s->x }; 12 | const _simd4f_union sy = { s->y }; 13 | const _simd4f_union sz = { s->z }; 14 | const _simd4f_union sw = { s->w }; 15 | 16 | const simd4f dx = simd4f_create( sx.f[0], sy.f[0], sz.f[0], sw.f[0] ); 17 | const simd4f dy = simd4f_create( sx.f[1], sy.f[1], sz.f[1], sw.f[1] ); 18 | const simd4f dz = simd4f_create( sx.f[2], sy.f[2], sz.f[2], sw.f[2] ); 19 | const simd4f dw = simd4f_create( sx.f[3], sy.f[3], sz.f[3], sw.f[3] ); 20 | 21 | s->x = dx; 22 | s->y = dy; 23 | s->z = dz; 24 | s->w = dw; 25 | 26 | } 27 | 28 | vectorial_inline void simd4x4f_transpose(const simd4x4f *s, simd4x4f *out) { 29 | *out=*s; 30 | simd4x4f_transpose_inplace(out); 31 | } 32 | 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /vectorial/simd4x4f_scalar.h: -------------------------------------------------------------------------------- 1 | /* 2 | Vectorial 3 | Copyright (c) 2010 Mikko Lehtonen 4 | Licensed under the terms of the two-clause BSD License (see LICENSE) 5 | */ 6 | #ifndef VECTORIAL_SIMD4X4F_SCALAR_H 7 | #define VECTORIAL_SIMD4X4F_SCALAR_H 8 | 9 | 10 | vectorial_inline void simd4x4f_transpose_inplace(simd4x4f *s) { 11 | simd4x4f d=*s; 12 | s->x.x = d.x.x; 13 | s->x.y = d.y.x; 14 | s->x.z = d.z.x; 15 | s->x.w = d.w.x; 16 | 17 | s->y.x = d.x.y; 18 | s->y.y = d.y.y; 19 | s->y.z = d.z.y; 20 | s->y.w = d.w.y; 21 | 22 | s->z.x = d.x.z; 23 | s->z.y = d.y.z; 24 | s->z.z = d.z.z; 25 | s->z.w = d.w.z; 26 | 27 | s->w.x = d.x.w; 28 | s->w.y = d.y.w; 29 | s->w.z = d.z.w; 30 | s->w.w = d.w.w; 31 | 32 | } 33 | 34 | vectorial_inline void simd4x4f_transpose(const simd4x4f *s, simd4x4f *out) { 35 | *out=*s; 36 | simd4x4f_transpose_inplace(out); 37 | } 38 | 39 | 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /vectorial/simd4x4f_sse.h: -------------------------------------------------------------------------------- 1 | /* 2 | Vectorial 3 | Copyright (c) 2010 Mikko Lehtonen 4 | Licensed under the terms of the two-clause BSD License (see LICENSE) 5 | */ 6 | #ifndef VECTORIAL_SIMD4X4F_SSE_H 7 | #define VECTORIAL_SIMD4X4F_SSE_H 8 | 9 | 10 | 11 | vectorial_inline void simd4x4f_transpose_inplace(simd4x4f *s) { 12 | _MM_TRANSPOSE4_PS(s->x, s->y, s->z, s->w); 13 | } 14 | 15 | vectorial_inline void simd4x4f_transpose(const simd4x4f *s, simd4x4f *out) { 16 | *out=*s; 17 | simd4x4f_transpose_inplace(out); 18 | } 19 | 20 | 21 | 22 | 23 | #endif 24 | --------------------------------------------------------------------------------