From: <me...@us...> - 2009-08-22 14:28:46
|
Revision: 2728 http://ogreaddons.svn.sourceforge.net/ogreaddons/?rev=2728&view=rev Author: melven2 Date: 2009-08-22 14:28:37 +0000 (Sat, 22 Aug 2009) Log Message: ----------- -some changes in the xcode-project file and the cmake files -PlayerController seems to work now (will still have some bugs!) -ConvexCast: added "NormalOnHitPoint" Modified Paths: -------------- branches/ogrenewt/newton20/Mac/OgreNewt.xcodeproj/project.pbxproj branches/ogrenewt/newton20/cmake/FindNewton.cmake branches/ogrenewt/newton20/inc/OgreNewt.h branches/ogrenewt/newton20/inc/OgreNewt_RayCast.h branches/ogrenewt/newton20/src/OgreNewt_Debugger.cpp branches/ogrenewt/newton20/src/OgreNewt_PlayerController.cpp branches/ogrenewt/newton20/src/OgreNewt_RayCast.cpp Modified: branches/ogrenewt/newton20/Mac/OgreNewt.xcodeproj/project.pbxproj =================================================================== --- branches/ogrenewt/newton20/Mac/OgreNewt.xcodeproj/project.pbxproj 2009-08-21 13:25:38 UTC (rev 2727) +++ branches/ogrenewt/newton20/Mac/OgreNewt.xcodeproj/project.pbxproj 2009-08-22 14:28:37 UTC (rev 2728) @@ -46,6 +46,7 @@ 487D45F90F47389A00D1D69F /* OgreNewt_Vehicle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 487D45E70F47389A00D1D69F /* OgreNewt_Vehicle.cpp */; }; 487D45FA0F47389A00D1D69F /* OgreNewt_World.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 487D45E80F47389A00D1D69F /* OgreNewt_World.cpp */; }; 48A94EC50F476C1700252666 /* libc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48A94EC10F476B1400252666 /* libc.dylib */; }; + 48FF24380FC9A27B00E71D4D /* libboost_system-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 48FF24370FC9A27B00E71D4D /* libboost_system-mt.dylib */; }; 8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; /* End PBXBuildFile section */ @@ -103,6 +104,7 @@ 487D45E80F47389A00D1D69F /* OgreNewt_World.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OgreNewt_World.cpp; path = ../src/OgreNewt_World.cpp; sourceTree = SOURCE_ROOT; }; 48A94EBE0F476A8700252666 /* libstdc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.dylib"; path = "usr/lib/i686-apple-darwin9/4.0.1/libstdc++.dylib"; sourceTree = SDKROOT; }; 48A94EC10F476B1400252666 /* libc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libc.dylib; path = usr/lib/libc.dylib; sourceTree = SDKROOT; }; + 48FF24370FC9A27B00E71D4D /* libboost_system-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_system-mt.dylib"; path = "/opt/local/lib/libboost_system-mt.dylib"; sourceTree = "<absolute>"; }; 8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; 8D07F2C80486CC7A007CD1D0 /* OgreNewt.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OgreNewt.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -115,6 +117,7 @@ 444EA9A30BD0D33B00C6D4A0 /* Ogre.framework in Frameworks */, 444EA9A70BD0D35800C6D4A0 /* libnewton32.a in Frameworks */, 48A94EC50F476C1700252666 /* libc.dylib in Frameworks */, + 48FF24380FC9A27B00E71D4D /* libboost_system-mt.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -132,12 +135,11 @@ 0867D691FE84028FC02AAC07 /* OgreNewt */ = { isa = PBXGroup; children = ( + 48FF24370FC9A27B00E71D4D /* libboost_system-mt.dylib */, 08FB77ACFE841707C02AAC07 /* Source */, 089C1665FE841158C02AAC07 /* Resources */, 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */, 034768DDFF38A45A11DB9C8B /* Products */, - 48A94EBE0F476A8700252666 /* libstdc++.dylib */, - 48A94EC10F476B1400252666 /* libc.dylib */, ); name = OgreNewt; sourceTree = "<group>"; @@ -145,6 +147,8 @@ 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( + 48A94EC10F476B1400252666 /* libc.dylib */, + 48A94EBE0F476A8700252666 /* libstdc++.dylib */, 444EA9A60BD0D35800C6D4A0 /* libnewton32.a */, 444EA9A20BD0D33B00C6D4A0 /* Ogre.framework */, ); @@ -351,16 +355,8 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ""; - HEADER_SEARCH_PATHS = ( - /Library/Frameworks/Ogre.framework/Headers, - /usr/local/include, - ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Library/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - /usr/local/lib, - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SDKROOT)/usr/lib/i686-apple-darwin9/4.0.1\""; LIBRARY_STYLE = DYNAMIC; MACH_O_TYPE = mh_dylib; @@ -386,13 +382,8 @@ GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ""; - HEADER_SEARCH_PATHS = /usr/local/include; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Library/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - /usr/local/lib, - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SDKROOT)/usr/lib/i686-apple-darwin9/4.0.1\""; LIBRARY_STYLE = DYNAMIC; MACH_O_TYPE = mh_dylib; @@ -409,9 +400,20 @@ 4FADC24708B4156D00ABE55E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = /Library/Frameworks/Ogre.framework/Headers; + HEADER_SEARCH_PATHS = ( + /opt/local/include, + /usr/local/include, + /Library/Frameworks/Ogre.framework/Headers, + ); + LIBRARY_SEARCH_PATHS = ( + /opt/local/lib, + /usr/local/lib, + /usr/lib, + ); PREBINDING = NO; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; @@ -420,12 +422,20 @@ 4FADC24808B4156D00ABE55E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( + /opt/local/include, /usr/local/include, /Library/Frameworks/Ogre.framework/Headers, ); + LIBRARY_SEARCH_PATHS = ( + /opt/local/lib, + /usr/local/lib, + /usr/lib, + ); PREBINDING = NO; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; Modified: branches/ogrenewt/newton20/cmake/FindNewton.cmake =================================================================== --- branches/ogrenewt/newton20/cmake/FindNewton.cmake 2009-08-21 13:25:38 UTC (rev 2727) +++ branches/ogrenewt/newton20/cmake/FindNewton.cmake 2009-08-22 14:28:37 UTC (rev 2728) @@ -20,6 +20,7 @@ ELSE(WIN32) SET(NEWTON_INCLUDE_SEARCH_DIRS /usr/include + /usr/include/newtonSDK /usr/local/include /opt/newton/include /opt/include INTERNAL) Modified: branches/ogrenewt/newton20/inc/OgreNewt.h =================================================================== --- branches/ogrenewt/newton20/inc/OgreNewt.h 2009-08-21 13:25:38 UTC (rev 2727) +++ branches/ogrenewt/newton20/inc/OgreNewt.h 2009-08-22 14:28:37 UTC (rev 2728) @@ -1,176 +1,178 @@ -/* - OgreNewt library - - connects Ogre with the Newton Game Dynamics physics library - - - by Walaber (http://walaber.com) - some changes by melven - - main header file. - - current version: 2.07.0 - - Newton version: 2.07 (beta) - - Ogre version: Shoggoth (1.6.x) - -*/ - -#ifndef _INCLUDE_OGRENEWT_ -#define _INCLUDE_OGRENEWT_ - - -#include "OgreNewt_World.h" -#include "OgreNewt_Collision.h" -#include "OgreNewt_Body.h" -#include "OgreNewt_CollisionPrimitives.h" -#include "OgreNewt_CollisionSerializer.h" -#include "OgreNewt_MaterialID.h" -#include "OgreNewt_MaterialPair.h" -#include "OgreNewt_ContactCallback.h" -#include "OgreNewt_ContactJoint.h" -#include "OgreNewt_Vehicle.h" -#include "OgreNewt_PlayerController.h" -#include "OgreNewt_RayCast.h" - -#include "OgreNewt_Joint.h" -#include "OgreNewt_BasicJoints.h" - -#include "OgreNewt_Tools.h" -#include "OgreNewt_BodyInAABBIterator.h" -#include "OgreNewt_Debugger.h" - -/*! \mainpage OgreNewt Library version 2.07.0 (for newton version 2.07) - - \section into_sec Introduction - - OgreNewt is an OOP wrapper for integrating the Newton Dynamics Physics SDK with OGRE. - - \section problems Problems and missing features in this version - - Problems and missing features in this version - - HeightFieldCollision - - PlayerController not finished - - player controller demo needs to be improved - - this library supports the newton functions for multithreading but there are several functions/classes in this - library itself, that are not thread safe (I don't need multiple threads) - - the copied MovableText class (in Tools::OgreAddons) seems to have some graphics error (it's used - to show the debugging information above each body) - - I didn't test several features: - - vehicle - - joints - - treecollision raycastcallback - - - \section new New in this version - - New in this version - - added player controller demo - - updated to newton 2.07 -- interface breaking changes! - - added shape-id parameters for collisions (you need to set the shape id if you create the collision, cannot be changed later) - - CustomJoint: - - added globalToLocal function - - feedbackCollector callback - - first attempts to support multithreading - - update the nodes of the bodies after the newton world update, because Ogre doesn't support multithreaded access to nodes - - linux: added a pthread-mutex for Ogre in OgreNewt::World, so it can be used for access to Ogre from multiple threads - - updated to newton 2.04 -- interface breaking changes (not compatible with newton 2.03!) - - set the collision id when creating a collision - - this version uses cmake > 2.6.2! - - shared pointers for collisions, if you don't want to use shared pointers define OGRENEWT_NO_COLLISION_SHAREDPTR - - uses Ogre::Any instead of void* as userdata, if you want to use void* define OGRENEWT_NO_OGRE_ANY - - several interface-breaking changes: - - the ContactCallback passes a ContactJoint as argument that can be used to iterate through all contacts - (the callback is not called for each contact any more, but for each pair of colliding bodies!) - - added a lots of new simple "iterators": - - for Bodies use body = World->getFirstBody() and body = body->getNext() - - for the - - BodyIterator renamed to BodyInAABBIterator, it does now only iterate through bodies in a specific AABB - - removed "Singleton-classes", the debugger and the BodyInAABBIterator are now part of a World - (call world->getDebugger() / world->getBodyInAABBIterator() to use these classes!) - - added support for trigger-volumes (ConvexCollision::setAsTriggerVolume ...) - - added support for convexcasts - - more than one contacts are now supported (removed the hack that prevented a segfault due to an error in newton) - - added additional debugging features: - - raycast/convexcast debugging - - information about each body as billboard above it - - a lot of minor changes and functions added and renamed - - - previous changes... - - updated to Newton version 2.0!! Many big improvements and changes to the library, and OgreNewt now supports it. - - several interface-breaking changes: - - updated to support multithreading support now native to Newton. - - MomentOfInertia namespace and helper functions removed entirely. Newton can now calculate inertia and center of - mass automatically, use ConvexCollision::calculateInertialMatrix, and multiply by objects Mass. - - Body::attachToNode has been renamed to attachNode, better implying the relationship between the body and the Ogre::Node. - - BodyIterator class has been upgraded to use boost::function, allowing the same callback flexibility as other callbacks. - - - bug fix - fixed problem with TreeCollisionSceneParser that wasn't adjusting to different scales properly. - - optimization - fixed several classes to only write debug data to the LOG when compiled in DEBUG mode: - - Custom2DJonit - - BasicFrameListener - - added the concept of "face-winding" to all TreeCollision classes. should not cause any breaking changes to code, but allows more flexibility to change the "direction" of a face in treecollisions. - - OgreNewt and it's demos are now fully compatible with Ogre 1.4.x (Eihort). - - Addition of script files for compiling under linux (Scons) - - slight modification to the ContactCallback class to allow access to Newton structures from the outside. - - some cosmetic changes to make the wrapper compile more easily under Linux and other non-windows platforms. - - updated to work with the release version of Ogre dagon (1.2) - - updated to work with version 1.53 of Newton - - raycast now has an optional pre-filter to ignore specific bodies from the raycast. - - various other clean-up! - - moved callback system to much more OOP-friendly "boost::function" system. callbacks can now be instance-specific member functions! - - several other small fixes to project files, etc. - - automatic convex hull generation system added to supplementary ragdoll class (see demo08). - - documentation updated. - - updated to Newton version 1.5 - - added this documentation! - - added buoyancy functionality. - - New Buoyancy demo. - - New Ragdoll demo, using a seperate class to implement ragdoll functionality. - - added basic classes for CustomJoints, and a simple demo showing how they work. - - added several prebuilt custom joints, including pulleys and gears, and a general 2D joint. - - added calculateInertialMatrix to ConvexCollision class. - - added set/getCenterOfMass to Body class - - changed angle-related functions in BasicJoint classes to use Ogre::Radian instead of Ogre::Real. - - added ConvexModifierCollision class, which allows for arbitrarily scaled collision primitives. - - added several low-level collision functions, see the CollisionTools namespace. - - fixed errors causing run-time crash on Slider and Universal joints. - - added LeaveWorldCallback functionality to World class. - - \section install Installation - - OgreNewt comes with a project for MSVC++ 7.1 and MSVC++ 8.0 (2005). unfortunately I have no other IDE's or compilers setup on my system, so I - cannot provide any other projects. the MSVC solution should build out of the box, assuming you take a few things into - consideration. - - unzip this in the ogreaddons directory alongside your "ogrenew" directory. to compile correctly, it also assumes you have the Newton SDK installed in another - directory alongside this one called "NewtonSDK". - - for example something like this: - - - c:/programming/Ogre/ogrenew <- ogre installation - - c:/programming/Ogre/ogreaddons/OgreNewt <- OgreNewt main directory. - - c:/programming/NewtonSDK <- Newton SDK. - - c:/programming/tinyxml <- tinyxml library (needed for ragdoll demo only) - - \section compiling Compiling - - OgreNewt compiles by default to a static library for linking to your project. However you can also compile OgreNewt into a dynamic DLL on the - Windows platform by using the Debug_DLL and Release_DLL solution build configurations in the MSVC solutions. - - \section license License - - OgreNewt basically has no license, you may use any or all of the library however you desire... I hope it can help you in any way. - - - well, that's about it! - have fun! - - -walaber - -*/ - -#endif - +/* + OgreNewt library + + connects Ogre with the Newton Game Dynamics physics library + + + by Walaber (http://walaber.com) + some changes by melven + + main header file. + + current version: 2.07.0 + + Newton version: 2.07 (beta) + + Ogre version: Shoggoth (1.6.x) + +*/ + +#ifndef _INCLUDE_OGRENEWT_ +#define _INCLUDE_OGRENEWT_ + + +#include "OgreNewt_World.h" +#include "OgreNewt_Collision.h" +#include "OgreNewt_Body.h" +#include "OgreNewt_CollisionPrimitives.h" +#include "OgreNewt_CollisionSerializer.h" +#include "OgreNewt_MaterialID.h" +#include "OgreNewt_MaterialPair.h" +#include "OgreNewt_ContactCallback.h" +#include "OgreNewt_ContactJoint.h" +#include "OgreNewt_Vehicle.h" +#include "OgreNewt_PlayerController.h" +#include "OgreNewt_RayCast.h" + +#include "OgreNewt_Joint.h" +#include "OgreNewt_BasicJoints.h" + +#include "OgreNewt_Tools.h" +#include "OgreNewt_BodyInAABBIterator.h" +#include "OgreNewt_Debugger.h" + +/*! \mainpage OgreNewt Library version 2.07.0 (for newton version 2.07) + + \section into_sec Introduction + + OgreNewt is an OOP wrapper for integrating the Newton Dynamics Physics SDK with OGRE. + + \section problems Problems and missing features in this version + + Problems and missing features in this version + - HeightFieldCollision + - PlayerController not finished + - player controller demo needs to be improved + - this library supports the newton functions for multithreading but there are several functions/classes in this + library itself, that are not thread safe (I don't need multiple threads) + - the copied MovableText class (in Tools::OgreAddons) seems to have some graphics error (it's used + to show the debugging information above each body) + - I didn't test several features: + - vehicle + - joints + - treecollision raycastcallback + + + \section new New in this version + + New in this version + - ConvexCast: + - added "NormalOnHitPoint" + - added player controller demo + - updated to newton 2.07 -- interface breaking changes! + - added shape-id parameters for collisions (you need to set the shape id if you create the collision, cannot be changed later) + - CustomJoint: + - added globalToLocal function + - feedbackCollector callback + - first attempts to support multithreading + - update the nodes of the bodies after the newton world update, because Ogre doesn't support multithreaded access to nodes + - linux: added a pthread-mutex for Ogre in OgreNewt::World, so it can be used for access to Ogre from multiple threads + - updated to newton 2.04 -- interface breaking changes (not compatible with newton 2.03!) + - set the collision id when creating a collision + - this version uses cmake > 2.6.2! + - shared pointers for collisions, if you don't want to use shared pointers define OGRENEWT_NO_COLLISION_SHAREDPTR + - uses Ogre::Any instead of void* as userdata, if you want to use void* define OGRENEWT_NO_OGRE_ANY + - several interface-breaking changes: + - the ContactCallback passes a ContactJoint as argument that can be used to iterate through all contacts + (the callback is not called for each contact any more, but for each pair of colliding bodies!) + - added a lots of new simple "iterators": + - for Bodies use body = World->getFirstBody() and body = body->getNext() + - for the + - BodyIterator renamed to BodyInAABBIterator, it does now only iterate through bodies in a specific AABB + - removed "Singleton-classes", the debugger and the BodyInAABBIterator are now part of a World + (call world->getDebugger() / world->getBodyInAABBIterator() to use these classes!) + - added support for trigger-volumes (ConvexCollision::setAsTriggerVolume ...) + - added support for convexcasts + - more than one contacts are now supported (removed the hack that prevented a segfault due to an error in newton) + - added additional debugging features: + - raycast/convexcast debugging + - information about each body as billboard above it + - a lot of minor changes and functions added and renamed + + + previous changes... + - updated to Newton version 2.0!! Many big improvements and changes to the library, and OgreNewt now supports it. + - several interface-breaking changes: + - updated to support multithreading support now native to Newton. + - MomentOfInertia namespace and helper functions removed entirely. Newton can now calculate inertia and center of + mass automatically, use ConvexCollision::calculateInertialMatrix, and multiply by objects Mass. + - Body::attachToNode has been renamed to attachNode, better implying the relationship between the body and the Ogre::Node. + - BodyIterator class has been upgraded to use boost::function, allowing the same callback flexibility as other callbacks. + + - bug fix - fixed problem with TreeCollisionSceneParser that wasn't adjusting to different scales properly. + - optimization - fixed several classes to only write debug data to the LOG when compiled in DEBUG mode: + - Custom2DJonit + - BasicFrameListener + - added the concept of "face-winding" to all TreeCollision classes. should not cause any breaking changes to code, but allows more flexibility to change the "direction" of a face in treecollisions. + - OgreNewt and it's demos are now fully compatible with Ogre 1.4.x (Eihort). + - Addition of script files for compiling under linux (Scons) + - slight modification to the ContactCallback class to allow access to Newton structures from the outside. + - some cosmetic changes to make the wrapper compile more easily under Linux and other non-windows platforms. + - updated to work with the release version of Ogre dagon (1.2) + - updated to work with version 1.53 of Newton + - raycast now has an optional pre-filter to ignore specific bodies from the raycast. + - various other clean-up! + - moved callback system to much more OOP-friendly "boost::function" system. callbacks can now be instance-specific member functions! + - several other small fixes to project files, etc. + - automatic convex hull generation system added to supplementary ragdoll class (see demo08). + - documentation updated. + - updated to Newton version 1.5 + - added this documentation! + - added buoyancy functionality. + - New Buoyancy demo. + - New Ragdoll demo, using a seperate class to implement ragdoll functionality. + - added basic classes for CustomJoints, and a simple demo showing how they work. + - added several prebuilt custom joints, including pulleys and gears, and a general 2D joint. + - added calculateInertialMatrix to ConvexCollision class. + - added set/getCenterOfMass to Body class + - changed angle-related functions in BasicJoint classes to use Ogre::Radian instead of Ogre::Real. + - added ConvexModifierCollision class, which allows for arbitrarily scaled collision primitives. + - added several low-level collision functions, see the CollisionTools namespace. + - fixed errors causing run-time crash on Slider and Universal joints. + - added LeaveWorldCallback functionality to World class. + + \section install Installation + + OgreNewt comes with a project for MSVC++ 7.1 and MSVC++ 8.0 (2005). unfortunately I have no other IDE's or compilers setup on my system, so I + cannot provide any other projects. the MSVC solution should build out of the box, assuming you take a few things into + consideration. + + unzip this in the ogreaddons directory alongside your "ogrenew" directory. to compile correctly, it also assumes you have the Newton SDK installed in another + directory alongside this one called "NewtonSDK". + + for example something like this: + + - c:/programming/Ogre/ogrenew <- ogre installation + - c:/programming/Ogre/ogreaddons/OgreNewt <- OgreNewt main directory. + - c:/programming/NewtonSDK <- Newton SDK. + - c:/programming/tinyxml <- tinyxml library (needed for ragdoll demo only) + + \section compiling Compiling + + OgreNewt compiles by default to a static library for linking to your project. However you can also compile OgreNewt into a dynamic DLL on the + Windows platform by using the Debug_DLL and Release_DLL solution build configurations in the MSVC solutions. + + \section license License + + OgreNewt basically has no license, you may use any or all of the library however you desire... I hope it can help you in any way. + + + well, that's about it! + have fun! + + -walaber + +*/ + +#endif + Modified: branches/ogrenewt/newton20/inc/OgreNewt_RayCast.h =================================================================== --- branches/ogrenewt/newton20/inc/OgreNewt_RayCast.h 2009-08-21 13:25:38 UTC (rev 2727) +++ branches/ogrenewt/newton20/inc/OgreNewt_RayCast.h 2009-08-22 14:28:37 UTC (rev 2728) @@ -227,12 +227,13 @@ class _OgreNewtExport ConvexcastContactInfo { public: - //Ogre::Real mDistance; //!< dist from point1 of the raycast, in range [0,1]. - OgreNewt::Body* mBody; //!< pointer to body intersected with - int mCollisionID; //!< collision ID of the primitive hit by the ray (for compound collision bodies) - Ogre::Vector3 mContactNormal; //!< normal of intersection. - Ogre::Vector3 mContactPoint; //!< point of the contact in global space - Ogre::Real mContactPenetration; //!< contact penetration at collision point + //Ogre::Real mDistance; //!< dist from point1 of the raycast, in range [0,1]. + OgreNewt::Body* mBody; //!< pointer to body intersected with + int mCollisionID; //!< collision ID of the primitive hit by the ray (for compound collision bodies) + Ogre::Vector3 mContactNormal; //!< normal of intersection. + Ogre::Vector3 mContactNormalOnHitPoint; //!< surface normal at the surface of the hit body + Ogre::Vector3 mContactPoint; //!< point of the contact in global space + Ogre::Real mContactPenetration; //!< contact penetration at collision point ConvexcastContactInfo(); ~ConvexcastContactInfo(); Modified: branches/ogrenewt/newton20/src/OgreNewt_Debugger.cpp =================================================================== --- branches/ogrenewt/newton20/src/OgreNewt_Debugger.cpp 2009-08-21 13:25:38 UTC (rev 2727) +++ branches/ogrenewt/newton20/src/OgreNewt_Debugger.cpp 2009-08-22 14:28:37 UTC (rev 2728) @@ -284,7 +284,6 @@ { m_recordraycasts = true; m_markhitbodies = markhitbodies; - clearRaycastsRecorded(); } bool Debugger::isRaycastRecording() Modified: branches/ogrenewt/newton20/src/OgreNewt_PlayerController.cpp =================================================================== --- branches/ogrenewt/newton20/src/OgreNewt_PlayerController.cpp 2009-08-21 13:25:38 UTC (rev 2727) +++ branches/ogrenewt/newton20/src/OgreNewt_PlayerController.cpp 2009-08-22 14:28:37 UTC (rev 2728) @@ -127,8 +127,7 @@ Ogre::Vector3 inertia; body->getMassMatrix(mass, inertia); - //if( mass != 0.0f || body == m_body ) - if( body == m_body ) + if( mass != 0.0f || body == m_body ) return false; for( int i = 0; i < filterBodies.size(); i++ ) @@ -500,7 +499,7 @@ targetVel -= m_gravity*timestep; Ogre::Vector3 floorNormal = staticConvexCast.getInfoAt(0).mContactNormal; Ogre::Vector3 gravityForce = m_gravity - floorNormal*(floorNormal.dotProduct(m_gravity)); - targetVel -= floorNormal * floorNormal.dotProduct(m_gravity) + gravityForce * timestep; + targetVel += gravityForce*timestep - floorNormal * floorNormal.dotProduct(targetVel); } // make sure the body velocity will not penetrate other bodies @@ -586,8 +585,8 @@ Ogre::Vector3 floorNormal = allBodyConvexCast.getInfoAt(0).mContactNormal; - isFuturePosInRamp = upDir.angleBetween(floorNormal) > m_maxSlope; - if( !isFuturePosInRamp ) + isFuturePosInRamp = upDir.angleBetween(floorNormal) < m_maxSlope; + if( isFuturePosInRamp ) { AllBodyConvexCast allBodyConvexCast2(this); Ogre::Vector3 castStart2, castTarget2; @@ -599,7 +598,7 @@ allBodyConvexCast2.go(m_bodyFloorSensorShape, castStart2, ori, castTarget2, 1, threadIndex, filterBodies); - if( distanceToFirstHit < allBodyConvexCast2.getDistanceToFirstHit() && allBodyConvexCast2.getContactsCount() > 0 ) + if( distanceToFirstHit >= allBodyConvexCast2.getDistanceToFirstHit() && allBodyConvexCast2.getContactsCount() > 0 ) { setPlayerState(PS_ONILLEGALRAMP); } @@ -610,7 +609,7 @@ int iterations, contactCount = 1; Ogre::Vector3 savedTargetVel; savedTargetVel = targetVel; - for( iterations = 0; iterations < m_maxCollisionsIteration && contactCount; iterations++ ) + for( iterations = 0; (iterations < m_maxCollisionsIteration) && contactCount; iterations++ ) { Ogre::Real projectVel; Ogre::Vector3 castStart3, castTarget3; @@ -658,14 +657,14 @@ targetVel = targetVel1; distanceToFirstHit = 0.0f; step = Ogre::Vector3::ZERO; - pos -= upDir*m_kinematicCushion; + castStart -= upDir*m_kinematicCushion; } } } } - Ogre::Vector3 newPos = pos + (castTarget - castStart)*distanceToFirstHit + upDir*m_kinematicCushion; + Ogre::Vector3 newPos = castStart + (castTarget - castStart)*distanceToFirstHit + upDir*m_kinematicCushion; newPos -= step; m_body->setPositionOrientation(newPos, ori); Modified: branches/ogrenewt/newton20/src/OgreNewt_RayCast.cpp =================================================================== --- branches/ogrenewt/newton20/src/OgreNewt_RayCast.cpp 2009-08-21 13:25:38 UTC (rev 2727) +++ branches/ogrenewt/newton20/src/OgreNewt_RayCast.cpp 2009-08-22 14:28:37 UTC (rev 2728) @@ -312,6 +312,9 @@ info.mContactNormal.x = mReturnInfoList[hitnum].m_normal[0]; info.mContactNormal.y = mReturnInfoList[hitnum].m_normal[1]; info.mContactNormal.z = mReturnInfoList[hitnum].m_normal[2]; + info.mContactNormalOnHitPoint.x = mReturnInfoList[hitnum].m_normalOnHitPoint[0]; + info.mContactNormalOnHitPoint.y = mReturnInfoList[hitnum].m_normalOnHitPoint[1]; + info.mContactNormalOnHitPoint.z = mReturnInfoList[hitnum].m_normalOnHitPoint[2]; info.mContactPoint.x = mReturnInfoList[hitnum].m_point[0]; info.mContactPoint.y = mReturnInfoList[hitnum].m_point[1]; info.mContactPoint.z = mReturnInfoList[hitnum].m_point[2]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |