Thread: [Python-ogre-commit] SF.net SVN: python-ogre: [442] trunk/python-ogre/ThirdParty/nxogre
Brought to you by:
andy_miller,
roman_yakovenko
From: <and...@us...> - 2007-10-19 07:11:28
|
Revision: 442 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=442&view=rev Author: andy_miller Date: 2007-10-19 00:11:32 -0700 (Fri, 19 Oct 2007) Log Message: ----------- Start of making NxOgre work under Linux - # ifdefs to remove fluid functions and enums # casting for Memorybuffers to NxStream Modified Paths: -------------- trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.cpp Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.cpp 2007-10-18 14:01:33 UTC (rev 441) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.cpp 2007-10-19 07:11:32 UTC (rev 442) @@ -569,7 +569,7 @@ NxThrow_Error(s.str()); } - mClothMesh = mOwner->getNxScene()->getPhysicsSDK().createClothMesh(MemoryReadBuffer(buf.data)); + mClothMesh = mOwner->getNxScene()->getPhysicsSDK().createClothMesh((NxStream)MemoryReadBuffer(buf.data)); #else @@ -730,7 +730,7 @@ NxThrow_Error(s.str()); } - mClothMesh = mOwner->getNxScene()->getPhysicsSDK().createClothMesh(MemoryReadBuffer(buf.data)); + mClothMesh = mOwner->getNxScene()->getPhysicsSDK().createClothMesh((NxStream)MemoryReadBuffer(buf.data)); #else @@ -1383,5 +1383,5 @@ return toVector3(vertices[vertex]); } -} //End of NxOgre namespace. +} //End of NxOgre namespace. ////#endif Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp 2007-10-18 14:01:33 UTC (rev 441) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp 2007-10-19 07:11:32 UTC (rev 442) @@ -71,12 +71,15 @@ case FT_NxSphericalJointFlag: return AsNxSphericalJointFlag(); break; case FT_NxPulleyJointFlag: return AsNxPulleyJointFlag(); break; case FT_NxContactPairFlag: return AsNxContactPairFlag(); break; + +#ifndef NX_DISABLE_FLUIDS case FT_NxFluidSimulationMethod: return AsNxFluidSimulationMethod(); break; case FT_NxFluidCollisionMethod: return AsNxFluidCollisionMethod(); break; case FT_NxFluidFlag: return AsNxFluidFlag(); break; + case FT_NxFluidEmitterFlag: return AsNxFluidEmitterFlag(); break; +#endif case FT_NxEmitterType: return AsNxEmitterType(); break; case FT_NxEmitterShape: return AsNxEmitterShape(); break; - case FT_NxFluidEmitterFlag: return AsNxFluidEmitterFlag(); break; case FT_NxClothFlag: return AsNxClothFlag(); break; case FT_NxForceFieldCoordinates: return AsNxForceFieldCoordinates(); break; case FT_NxSceneFlags: return AsNxSceneFlags(); break; @@ -567,6 +570,10 @@ } + + +#ifndef NX_DISABLE_FLUIDS + //////////////////////////////////////////////////////////////////////////////////////////////// StringList EnumsBlueprint::AsNxFluidSimulationMethod() { @@ -632,44 +639,8 @@ return l; } - //////////////////////////////////////////////////////////////////////////////////////////////// -StringList EnumsBlueprint::AsNxEmitterType() { - - StringList l; - - if (mEnum & NX_AF_DISABLE_COLLISION) - l.insert(NxString("NX_AF_DISABLE_COLLISION")); - - if (mEnum & NX_FE_CONSTANT_PRESSURE) - l.insert(NxString("NX_FE_CONSTANT_PRESSURE")); - - if (mEnum & NX_FE_CONSTANT_FLOW_RATE) - l.insert(NxString("NX_FE_CONSTANT_FLOW_RATE")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxEmitterShape() { - - StringList l; - - if (mEnum & NX_FE_RECTANGULAR) - l.insert(NxString("NX_FE_RECTANGULAR")); - - if (mEnum & NX_FE_ELLIPSE) - l.insert(NxString("NX_FE_ELLIPSE")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - StringList EnumsBlueprint::AsNxFluidEmitterFlag() { StringList l; @@ -716,8 +687,47 @@ } +#endif // NX_DISABLE_FLUIDS + + //////////////////////////////////////////////////////////////////////////////////////////////// +StringList EnumsBlueprint::AsNxEmitterType() { + + StringList l; + + if (mEnum & NX_AF_DISABLE_COLLISION) + l.insert(NxString("NX_AF_DISABLE_COLLISION")); + + if (mEnum & NX_FE_CONSTANT_PRESSURE) + l.insert(NxString("NX_FE_CONSTANT_PRESSURE")); + + if (mEnum & NX_FE_CONSTANT_FLOW_RATE) + l.insert(NxString("NX_FE_CONSTANT_FLOW_RATE")); + + return l; + +} + +//////////////////////////////////////////////////////////////////////////////////////////////// + +StringList EnumsBlueprint::AsNxEmitterShape() { + + StringList l; + + if (mEnum & NX_FE_RECTANGULAR) + l.insert(NxString("NX_FE_RECTANGULAR")); + + if (mEnum & NX_FE_ELLIPSE) + l.insert(NxString("NX_FE_ELLIPSE")); + + return l; + +} + + +//////////////////////////////////////////////////////////////////////////////////////////////// + StringList EnumsBlueprint::AsNxClothFlag() { StringList l; @@ -1188,4 +1198,4 @@ //////////////////////////////////////////////////////////////////////////////////////////////// } //End of Serialiser namespace. -} //End of NxOgre namespace. +} //End of NxOgre namespace. Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.h 2007-10-18 14:01:33 UTC (rev 441) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.h 2007-10-19 07:11:32 UTC (rev 442) @@ -49,12 +49,16 @@ FT_NxSphericalJointFlag, FT_NxPulleyJointFlag, FT_NxContactPairFlag, + + #ifndef NX_DISABLE_FLUIDS FT_NxFluidSimulationMethod, FT_NxFluidCollisionMethod, FT_NxFluidFlag, + FT_NxFluidEmitterFlag, + #endif + FT_NxEmitterType, FT_NxEmitterShape, - FT_NxFluidEmitterFlag, FT_NxClothFlag, FT_NxForceFieldCoordinates, FT_NxSceneFlags, @@ -102,12 +106,16 @@ StringList AsNxSphericalJointFlag(); StringList AsNxPulleyJointFlag(); StringList AsNxContactPairFlag(); + + #ifndef NX_DISABLE_FLUIDS StringList AsNxFluidSimulationMethod(); StringList AsNxFluidCollisionMethod(); StringList AsNxFluidFlag(); + StringList AsNxFluidEmitterFlag(); + #endif + StringList AsNxEmitterType(); StringList AsNxEmitterShape(); - StringList AsNxFluidEmitterFlag(); StringList AsNxClothFlag(); StringList AsNxForceFieldCoordinates(); StringList AsNxSceneFlags(); Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.cpp 2007-10-18 14:01:33 UTC (rev 441) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.cpp 2007-10-19 07:11:32 UTC (rev 442) @@ -171,7 +171,7 @@ NxThrow_Error(s.str()); } - mSoftBodyMesh = mOwner->getNxScene()->getPhysicsSDK().createSoftBodyMesh(MemoryReadBuffer(buf.data)); + mSoftBodyMesh = mOwner->getNxScene()->getPhysicsSDK().createSoftBodyMesh((NxStream)MemoryReadBuffer(buf.data)); #else @@ -320,7 +320,7 @@ NxThrow_Error(s.str()); } - mSoftBodyMesh = mOwner->getNxScene()->getPhysicsSDK().createSoftBodyMesh(MemoryReadBuffer(buf.data)); + mSoftBodyMesh = mOwner->getNxScene()->getPhysicsSDK().createSoftBodyMesh((NxStream)MemoryReadBuffer(buf.data)); #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2007-10-19 10:06:54
|
Revision: 443 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=443&view=rev Author: andy_miller Date: 2007-10-19 03:06:58 -0700 (Fri, 19 Oct 2007) Log Message: ----------- Linux fixes Modified Paths: -------------- trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.cpp Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.cpp 2007-10-19 07:11:32 UTC (rev 442) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.cpp 2007-10-19 10:06:58 UTC (rev 443) @@ -567,10 +567,13 @@ s << "Cloth Mesh failed to cook"; NxThrow_Error(s.str()); - } + } + + MemoryReadBuffer readbuffer (buf.data); + NxStream & streambuffer = dynamic_cast< NxStream & > (readbuffer); + + mClothMesh = mOwner->getNxScene()->getPhysicsSDK().createClothMesh(streambuffer); - mClothMesh = mOwner->getNxScene()->getPhysicsSDK().createClothMesh((NxStream)MemoryReadBuffer(buf.data)); - #else NxString filename; @@ -729,8 +732,9 @@ NxThrow_Error(s.str()); } - - mClothMesh = mOwner->getNxScene()->getPhysicsSDK().createClothMesh((NxStream)MemoryReadBuffer(buf.data)); + MemoryReadBuffer readbuffer (buf.data); + NxStream & streambuffer = dynamic_cast< NxStream & > (readbuffer); + mClothMesh = mOwner->getNxScene()->getPhysicsSDK().createClothMesh(streambuffer); #else Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp 2007-10-19 07:11:32 UTC (rev 442) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp 2007-10-19 10:06:58 UTC (rev 443) @@ -698,13 +698,13 @@ if (mEnum & NX_AF_DISABLE_COLLISION) l.insert(NxString("NX_AF_DISABLE_COLLISION")); - +#ifndef NX_DISABLE_FLUIDS if (mEnum & NX_FE_CONSTANT_PRESSURE) l.insert(NxString("NX_FE_CONSTANT_PRESSURE")); if (mEnum & NX_FE_CONSTANT_FLOW_RATE) l.insert(NxString("NX_FE_CONSTANT_FLOW_RATE")); - +#endif return l; } @@ -714,13 +714,13 @@ StringList EnumsBlueprint::AsNxEmitterShape() { StringList l; - +#ifndef NX_DISABLE_FLUIDS if (mEnum & NX_FE_RECTANGULAR) l.insert(NxString("NX_FE_RECTANGULAR")); if (mEnum & NX_FE_ELLIPSE) l.insert(NxString("NX_FE_ELLIPSE")); - + #endif return l; } Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.cpp 2007-10-19 07:11:32 UTC (rev 442) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.cpp 2007-10-19 10:06:58 UTC (rev 443) @@ -170,8 +170,10 @@ NxThrow_Error(s.str()); } - - mSoftBodyMesh = mOwner->getNxScene()->getPhysicsSDK().createSoftBodyMesh((NxStream)MemoryReadBuffer(buf.data)); + MemoryReadBuffer readbuffer (buf.data); + NxStream & streambuffer = dynamic_cast< NxStream & > (readbuffer); + + mSoftBodyMesh = mOwner->getNxScene()->getPhysicsSDK().createSoftBodyMesh(streambuffer); #else @@ -319,8 +321,10 @@ NxThrow_Error(s.str()); } + MemoryReadBuffer readbuffer (buf.data); + NxStream & streambuffer = dynamic_cast< NxStream & > (readbuffer); - mSoftBodyMesh = mOwner->getNxScene()->getPhysicsSDK().createSoftBodyMesh((NxStream)MemoryReadBuffer(buf.data)); + mSoftBodyMesh = mOwner->getNxScene()->getPhysicsSDK().createSoftBodyMesh(streambuffer); #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2007-12-26 14:29:56
|
Revision: 513 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=513&view=rev Author: andy_miller Date: 2007-12-26 06:29:56 -0800 (Wed, 26 Dec 2007) Log Message: ----------- nxogre update Modified Paths: -------------- trunk/python-ogre/ThirdParty/nxogre/NxOgre.h trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.h trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.h trunk/python-ogre/ThirdParty/nxogre/NxOgreClothRaycaster.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreContainer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCooking.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCooking.h trunk/python-ogre/ThirdParty/nxogre/NxOgreDebugRenderer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreDebugRenderer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreError.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreError.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFluid.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFluidMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreFluidMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreForceField.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreGlobalFunctions.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreGroup.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreGroup.h trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJoint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJoint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJointSet1.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJointSet2.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJointSet2.h trunk/python-ogre/ThirdParty/nxogre/NxOgreLog.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterial.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterial.h trunk/python-ogre/ThirdParty/nxogre/NxOgreParams.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgrePhysXDriver.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgrePhysXDriver.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePrerequisites.h trunk/python-ogre/ThirdParty/nxogre/NxOgreRaycaster.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreRaycaster.h trunk/python-ogre/ThirdParty/nxogre/NxOgreRemoteDebuggerConnection.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreScene.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreScene.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneContactController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShape.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShape.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintConvex.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintPrimitives.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintWheel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintWheel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeConvex.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeConvex.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapePrimitives.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapePrimitives.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeTerrain.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeTerrain.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeWheel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeWheel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSimpleShape.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSimpleShape.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSkeleton.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.h trunk/python-ogre/ThirdParty/nxogre/NxOgreStable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTesting.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTrigger.h trunk/python-ogre/ThirdParty/nxogre/NxOgreUserAllocator.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreUserAllocator.h trunk/python-ogre/ThirdParty/nxogre/NxOgreUserData.h trunk/python-ogre/ThirdParty/nxogre/NxOgreUserStream.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreUserStream.h trunk/python-ogre/ThirdParty/nxogre/NxOgreWorld.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreWorld.h Removed Paths: ------------- trunk/python-ogre/ThirdParty/nxogre/NxuStream2/ Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgre.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgre.h 2007-12-17 18:04:28 UTC (rev 512) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgre.h 2007-12-26 14:29:56 UTC (rev 513) @@ -1,22 +1,67 @@ -// -// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. -// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// +/** @mainpage NxOgre +@section licence Licence +<pre> +NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. +Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +</pre> + +@section whatisit What is it? +NxOgre is a physics connector library between the physics library PhysX and the Ogre 3D rendering system. +With a help of some short, fast and neat code you can have a quick physics system within your Ogre game +or engine within a matter of minutes. + +@section installing Installing +@subsection Ogre + +The SDK or Source versions will both work with NxOgre. You should have some knowledege with working Ogre. +If you can make a simple application that can show an Ogre head with a movement camera, you can work with +NxOgre. +\n\n +You will need to create an environmental variable called "OGRE_HOME" pointing to the ogremain directory +in your Ogre folder. Normally for SDK users this is automatically created by the installer, but it's work +checking, if you installed Ogre from the source you'll need to create one. + +[1] http://www.ogre3d.org/wiki/index.php/Installing_An_SDK \n +[2] http://www.ogre3d.org/wiki/index.php/Building_From_Source \n + +@subsection PhysX +The PhysX SDK can be downloaded from the Ageia Support Center, a user account is required to download the +SDK. Once your account has been registered (Accounts are processed by hand, so a wait of 1-2 business days +is common), download the PhysX SDK and the SystemSoftware. +\n\n +Install the SystemSoftware first, then the PhysX SDK. I recommend you install the PhysX SDK in the same +parent directory as Ogre. Once the installation is completed, create a Environmental variable called +"<code>PHYSX_DIR</code>" pointing to the PhysX SDK directory. +\n\n +[3] http://devsupport.ageia.com/ \n + +@subsection NxOgre + - Create a "NxOgre" folder, it should be in the parent of your Ogre or nearby + - Using Tortoise SVN or another Subversion client checkout the HEAD repositry + - Go to the parent directory of Ogre and the PhysX SDK i.e. (c:/dev/) + - New Folder, name as NxOgre, and go inside + - File, SVN, SVN Checkout + - Set the URL to http://latest.nxogre.org/nxogre3/ + - Click okay + - Open up the project and compile. + +*/ + #ifndef __NXOGRE_H__ #define __NXOGRE_H__ @@ -27,23 +72,34 @@ #include "NxOgrePhysXDriver.h" #include "NxOgreError.h" #include "NxOgreLog.h" +#include "NxOgreExtendedTypes.h" /////////////////////////////////////////// #include "NxOgreActor.h" #include "NxOgreActorBlueprint.h" #include "NxOgreBody.h" +#include "NxOgreContactStream.h" #include "NxOgreContainer.h" #include "NxOgreCooking.h" -#include "NxOgreCharacter.h" -#include "NxOgreCharacterController.h" -#include "NxOgreCharacterHitReport.h" +#if NX_USE_LEGACY_NXCONTROLLER +# include "NxOgreLegacyCharacter.h" +# include "NxOgreLegacyCharacterController.h" +# include "NxOgreLegacyCharacterHitReport.h" +#else +# include "NxOgreCharacterSystem.h" +# include "NxOgreCharacter.h" +# include "NxOgreCharacterModel.h" +# include "NxOgreCharacterMovementModel.h" +#endif #include "NxOgreCloth.h" #include "NxOgreClothRaycaster.h" #include "NxOgreCompound.h" #include "NxOgreDebugRenderer.h" #include "NxOgreDominanceGroup.h" +#include "NxOgreEngine.h" #include "NxOgreEnumsBlueprint.h" +#include "NxOgreFileResourceSystem.h" #include "NxOgreFluid.h" #include "NxOgreFluidMesh.h" #include "NxOgreForceField.h" @@ -51,19 +107,26 @@ #include "NxOgreHelpers.h" #include "NxOgreJointSet1.h" #include "NxOgreJointSet2.h" -#include "NxOgreHelper.h" #include "NxOgreIntersection.h" #include "NxOgreMaterial.h" -#include "NxOgreMotor.h" +#include "NxOgreMachine.h" +#include "NxOgreNodeRenderable.h" +#include "NxOgreResourceManager.h" +#include "NxOgreOgreResourceSystem.h" #include "NxOgreParams.h" #include "NxOgrePose.h" #include "NxOgreRaycaster.h" +#include "NxOgreRenderable.h" +#include "NxOgreRenderableSource.h" #include "NxOgreRemoteDebuggerConnection.h" +#include "NxOgreResourceSystem.h" +#include "NxOgreResourceStreamPtr.h" #include "NxOgreSerialiser.h" #include "NxOgreScene.h" #include "NxOgreSceneBlueprint.h" #include "NxOgreSceneController.h" #include "NxOgreSceneContactController.h" +#include "NxOgreSceneRenderer.h" #include "NxOgreShape.h" #include "NxOgreShapeBlueprint.h" #include "NxOgreShapeBlueprintConvex.h" @@ -82,9 +145,16 @@ #include "NxOgreStateMachine.h" #include "NxOgreTesting.h" #include "NxOgreTrigger.h" -#include "NxOgreUserStream.h" +#include "NxOgreMemoryStream.h" #include "NxOgreUserAllocator.h" +#include "NxOgreUserData.h" +#include "NxOgreWheelSet.h" #include "NxOgreWorld.h" #include "NxOgreWorldBlueprint.h" +/////////////////////////////////////////// + +#include "NxOgreOgreSceneRenderer.h" +#include "NxOgreOgreNodeRenderable.h" + #endif Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.cpp 2007-12-17 18:04:28 UTC (rev 512) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.cpp 2007-12-26 14:29:56 UTC (rev 513) @@ -30,44 +30,51 @@ #include "NxOgreContainer.h" // For Getting an ActorGroup #include "NxOgreActorBlueprint.h" // For Quick Duplication. +#include "OgreStringConverter.h" +#include "OgreRoot.h" +#include "OgreSingleton.h" +#include "OgreMatrix3.h" + namespace NxOgre { ////////////////////////////////////////////////////////// void ActorParams::setToDefault() { - mDensity = 0.0f; - mActorFlags = 0; - mGroupAsIndex = 0; - mGroupAsName = ""; + + mDensity = 0.0f; + mActorFlags = 0; + mGroupAsIndex = 0; + mGroupAsName = ""; #if NX_SDK_VERSION_NUMBER >= 272 - mDominanceGroupAsIndex = 0; - mDominanceGroupAsName = ""; + mDominanceGroupAsIndex = 0; + mDominanceGroupAsName = ""; #endif #if NX_SDK_VERSION_NUMBER >= 260 - mCompartment = NULL; + mCompartment = NULL; #endif - mMassLocalPose . id(); - mMassSpaceInertia . zero(); - mLinearVelocity . zero(); - mAngularVelocity . zero(); - mWakeUpCounter = 20.0f*0.02f; - mMass = 10.0f; - mLinearDamping = 0.0f; - mAngularDamping = 0.05f; - mMaxAngularVelocity = -1.0f; - mBodyFlags = NX_BF_VISUALIZATION; - mSleepLinearVelocity = -1.0f; - mSleepAngularVelocity = -1.0f; - mCCDMotionThreshold = 0.0f; - mSolverIterationCount = 4; - mBodyFlags = NX_BF_ENERGY_SLEEP_TEST; - mSleepEnergyThreshold = -1.0f; - mSleepDamping = 0.0f; + mMassLocalPose . id(); + mMassSpaceInertia . zero(); + mLinearVelocity . zero(); + mAngularVelocity . zero(); + mWakeUpCounter = 20.0f * 0.02f; + mMass = 10.0f; + mLinearDamping = 0.0f; + mAngularDamping = 0.05f; + mMaxAngularVelocity = -1.0f; + mBodyFlags = NX_BF_VISUALIZATION; + mBodyFlags |= NX_BF_ENERGY_SLEEP_TEST; + mSleepLinearVelocity = -1.0f; + mSleepAngularVelocity = -1.0f; + mCCDMotionThreshold = 0.0f; + mSolverIterationCount = 4; + mSleepEnergyThreshold = -1.0f; + mSleepDamping = 0.0f; - mNodeScale = Ogre::Vector3(1,1,1); - mNodeName = ""; - mNodeShadows = true; + mNodeScale = Ogre::Vector3(1,1,1); + mNodeName = ""; + mNodeShadows = true; + mNodePose . id(); } @@ -122,6 +129,8 @@ if (Set("node-scale", (*p), mNodeScale)) continue; if (Set("node-shadows", (*p), mNodeShadows)) continue; if (Set("node", (*p), mNodeName)) continue; + if (Set("node-orientation", (*p), mNodePose.q)) continue; + if (Set("node-offset", (*p), mNodePose.v)) continue; } @@ -176,11 +185,11 @@ ////////////////////////////////////////////////////////// -Actor::Actor(const NxString& name, Scene* scene, ShapeBlueprint *shape, const Pose& pose, ActorParams params) : mName(name), mOwner(scene) { +Actor::Actor(const NxString& name, Scene* scene, ShapeBlueprint *shape, const Pose& pose, ActorParams params) +: mName(name), mOwner(scene) { if (name.length() == 0) { mName = NxCreateID(scene->getNbActors(), "Actor"); - mVisualIdentifier = NxString(); } else { @@ -190,12 +199,9 @@ if (splitID.size() == 1) { identifier = name; - mVisualIdentifier = name; } else { identifier = splitID[0]; - mVisualIdentifier = splitID[1]; - Ogre::StringUtil::trim(mVisualIdentifier); } Ogre::StringUtil::trim(identifier); @@ -310,7 +316,7 @@ bd.wakeUpCounter = params.mWakeUpCounter; ad.body = &bd; } - + shape->_bindToActorDescription(this, 0, ad.shapes); mActor = mOwner->mScene->createActor(ad); @@ -334,7 +340,7 @@ i++; } -#if (OGRE_VERSION_MINOR >= 5) +#if (OGRE_VERSION_MAJOR >= 1) && (OGRE_VERSION_MINOR >= 5) mBirthFrame = Ogre::Root::getSingletonPtr()->getNextFrameNumber() - 1; #else mBirthFrame = Ogre::Root::getSingletonPtr()->getCurrentFrameNumber(); @@ -352,32 +358,6 @@ ////////////////////////////////////////////////////////// -void Actor::simulate(float dT) { - shapeSimulate(dT); -} - -////////////////////////////////////////////////////////// - -void Actor::render(float) { - // No. -} - -////////////////////////////////////////////////////////// - -void Actor::shapeSimulate(float t) { - for(Shape* shape = mDynamicCollisionModel.begin();shape = mDynamicCollisionModel.next();) - shape->simulate(t); -} - -////////////////////////////////////////////////////////// - -void Actor::shapeRender(float t) { - for(Shape* shape = mDynamicCollisionModel.begin();shape = mDynamicCollisionModel.next();) - shape->render(t); -} - -////////////////////////////////////////////////////////// - void Actor::setName(NxString name) { mOwner->mActors.rename(mName, name); mName = name; @@ -385,7 +365,7 @@ ////////////////////////////////////////////////////////// -NxString Actor::getName() { +NxString Actor::getName() const { return mName; } @@ -423,25 +403,25 @@ ////////////////////////////////////////////////////////// Ogre::Quaternion Actor::getGlobalOrientation() { - return toQuaternion(mActor->getGlobalOrientationQuat()); + return NxConvert<Ogre::Quaternion, NxQuat>(mActor->getGlobalOrientationQuat()); } ////////////////////////////////////////////////////////// void Actor::setGlobalOrientation(const Ogre::Quaternion& quat) { - mActor->setGlobalOrientation(toNxQuat(quat)); + mActor->setGlobalOrientation(NxConvert<NxQuat, Ogre::Quaternion>(quat)); } ////////////////////////////////////////////////////////// Ogre::Vector3 Actor::getGlobalPosition() { - return toVector3(mActor->getGlobalPosition()); + return NxConvert<Ogre::Vector3, NxVec3>(mActor->getGlobalPosition()); } ////////////////////////////////////////////////////////// void Actor::setGlobalPosition(const Ogre::Vector3& vec) { - mActor->setGlobalPosition(toNxVec3(vec)); + mActor->setGlobalPosition(NxConvert<NxVec3, Ogre::Vector3>(vec)); } ////////////////////////////////////////////////////////// @@ -453,13 +433,13 @@ ////////////////////////////////////////////////////////// void Actor::moveGlobalPosition(const Ogre::Vector3& vec) { - mActor->moveGlobalPosition(toNxVec3(vec)); + mActor->moveGlobalPosition(NxConvert<NxVec3, Ogre::Vector3>(vec)); } ////////////////////////////////////////////////////////// void Actor::moveGlobalOrientation(const Ogre::Quaternion& quat) { - mActor->moveGlobalOrientationQuat(toNxQuat(quat)); + mActor->moveGlobalOrientationQuat(NxConvert<NxQuat, Ogre::Quaternion>(quat)); } //////////////////////////////////////////////////////// @@ -474,6 +454,7 @@ //////////////////////////////////////////////////////// #if 0 + const ShapeBlueprint& Actor::createShapeDescription(const ShapeBlueprint& s) { NxUnderConstruction; return s; @@ -512,6 +493,7 @@ NxUnderConstruction; return NULL; } + #endif ////////////////////////////////////////////////////////// @@ -571,7 +553,7 @@ ////////////////////////////////////////////////////////// void Actor::setCMassOffsetLocalPosition(const Ogre::Vector3& vec) { - mActor->setCMassOffsetLocalPosition(toNxVec3(vec)); + mActor->setCMassOffsetLocalPosition(NxConvert<NxVec3, Ogre::Vector3>(vec)); } ////////////////////////////////////////////////////////// @@ -584,7 +566,6 @@ void Actor::setCMassOffsetLocalOrientation(const Ogre::Matrix3& vec) { NxUnderConstruction; - } ////////////////////////////////////////////////////////// @@ -596,7 +577,7 @@ ////////////////////////////////////////////////////////// void Actor::setCMassOffsetGlobalPosition(const Ogre::Vector3& vec) { - mActor->setCMassOffsetGlobalPosition(toNxVec3(vec)); + mActor->setCMassOffsetGlobalPosition(NxConvert<NxVec3, Ogre::Vector3>(vec)); } ////////////////////////////////////////////////////////// @@ -622,7 +603,7 @@ ////////////////////////////////////////////////////////// void Actor::setCMassGlobalPosition(const Ogre::Vector3& vec) { - mActor->setCMassGlobalPosition(toNxVec3(vec)); + mActor->setCMassGlobalPosition(NxConvert<NxVec3, Ogre::Vector3>(vec)); } ////////////////////////////////////////////////////////// @@ -644,13 +625,13 @@ ////////////////////////////////////////////////////////// Ogre::Vector3 Actor::getCMassLocalPosition() const { - return toVector3(mActor->getCMassLocalPosition()); + return NxConvert<Ogre::Vector3, NxVec3>(mActor->getCMassLocalPosition()); } ////////////////////////////////////////////////////////// Ogre::Quaternion Actor::getCMassLocalOrientation() const { - return toQuaternion(mActor->getCMassLocalOrientation()); + return NxConvert<Ogre::Quaternion, NxQuat>(mActor->getCMassLocalOrientation()); } ////////////////////////////////////////////////////////// @@ -664,7 +645,7 @@ ////////////////////////////////////////////////////////// Ogre::Vector3 Actor::getCMassGlobalPosition() const { - return toVector3(mActor->getCMassGlobalPosition()); + return NxConvert<Ogre::Vector3, NxVec3>(mActor->getCMassGlobalPosition()); } ////////////////////////////////////////////////////////// @@ -672,7 +653,7 @@ Ogre::Quaternion Actor::getCMassGlobalOrientation() const { NxQuat quat; mActor->getCMassGlobalOrientation().toQuat(quat); - return toQuaternion(quat); + return NxConvert<Ogre::Quaternion, NxQuat>(quat); } ////////////////////////////////////////////////////////// @@ -692,13 +673,13 @@ void Actor::setMassSpaceInertiaTensor(const Ogre::Vector3& vec) { - mActor->setMassSpaceInertiaTensor(toNxVec3(vec)); + mActor->setMassSpaceInertiaTensor(NxConvert<NxVec3, Ogre::Vector3>(vec)); } ////////////////////////////////////////////////////////// Ogre::Vector3 Actor::getMassSpaceInertiaTensor() const { - return toVector3(mActor->getMassSpaceInertiaTensor()); + return NxConvert<Ogre::Vector3, NxVec3>(mActor->getMassSpaceInertiaTensor()); } ////////////////////////////////////////////////////////// @@ -758,26 +739,26 @@ ////////////////////////////////////////////////////////// void Actor::setLinearVelocity(const Ogre::Vector3& vec) { - mActor->setLinearVelocity(toNxVec3(vec)); + mActor->setLinearVelocity(NxConvert<NxVec3, Ogre::Vector3>(vec)); } ////////////////////////////////////////////////////////// void Actor::setAngularVelocity(const Ogre::Vector3& vec) { - mActor->setAngularVelocity(toNxVec3(vec)); + mActor->setAngularVelocity(NxConvert<NxVec3, Ogre::Vector3>(vec)); } ////////////////////////////////////////////////////////// Ogre::Vector3 Actor::getLinearVelocity() const { - return toVector3(mActor->getLinearVelocity()); + return NxConvert<Ogre::Vector3, NxVec3>(mActor->getLinearVelocity()); } ////////////////////////////////////////////////////////// Ogre::Vector3 Actor::getAngularVelocity() const { - return toVector3(mActor->getAngularVelocity()); + return NxConvert<Ogre::Vector3, NxVec3>(mActor->getAngularVelocity()); } ////////////////////////////////////////////////////////// @@ -808,73 +789,91 @@ ////////////////////////////////////////////////////////// void Actor::setLinearMomentum(const Ogre::Vector3& vec) { - mActor->setLinearMomentum(toNxVec3(vec)); + mActor->setLinearMomentum(NxConvert<NxVec3, Ogre::Vector3>(vec)); } ////////////////////////////////////////////////////////// void Actor::setAngularMomentum(const Ogre::Vector3& vec) { - mActor->setAngularMomentum(toNxVec3(vec)); + mActor->setAngularMomentum(NxConvert<NxVec3, Ogre::Vector3>(vec)); } ////////////////////////////////////////////////////////// Ogre::Vector3 Actor::getLinearMomentum() const { - return toVector3(mActor->getLinearMomentum()); + return NxConvert<Ogre::Vector3, NxVec3>(mActor->getLinearMomentum()); } ////////////////////////////////////////////////////////// Ogre::Vector3 Actor::getAngularMomentum() const { - return toVector3(mActor->getAngularMomentum()); + return NxConvert<Ogre::Vector3, NxVec3>(mActor->getAngularMomentum()); } ////////////////////////////////////////////////////////// void Actor::addForceAtPos(const Ogre::Vector3& force, const Ogre::Vector3& pos, NxForceMode mode, bool wakeup) { - mActor->addForceAtPos(toNxVec3(force), toNxVec3(pos), mode, wakeup); + mActor->addForceAtPos(NxConvert<NxVec3, Ogre::Vector3>(force), NxConvert<NxVec3, Ogre::Vector3>(pos), mode, wakeup); } ////////////////////////////////////////////////////////// void Actor::addForceAtLocalPos(const Ogre::Vector3& force, const Ogre::Vector3& pos, NxForceMode mode, bool wakeup) { - mActor->addForceAtLocalPos(toNxVec3(force), toNxVec3(pos), mode, wakeup); + mActor->addForceAtLocalPos(NxConvert<NxVec3, Ogre::Vector3>(force), NxConvert<NxVec3, Ogre::Vector3>(pos), mode, wakeup); } ////////////////////////////////////////////////////////// void Actor::addLocalForceAtPos(const Ogre::Vector3& force, const Ogre::Vector3& pos, NxForceMode mode, bool wakeup) { - mActor->addLocalForceAtPos(toNxVec3(force), toNxVec3(pos), mode, wakeup); + mActor->addLocalForceAtPos(NxConvert<NxVec3, Ogre::Vector3>(force), NxConvert<NxVec3, Ogre::Vector3>(pos), mode, wakeup); } ////////////////////////////////////////////////////////// void Actor::addLocalForceAtLocalPos(const Ogre::Vector3& force, const Ogre::Vector3& pos, NxForceMode mode, bool wakeup) { - mActor->addLocalForceAtLocalPos(toNxVec3(force), toNxVec3(pos), mode, wakeup); + mActor->addLocalForceAtLocalPos(NxConvert<NxVec3, Ogre::Vector3>(force), NxConvert<NxVec3, Ogre::Vector3>(pos), mode, wakeup); } ////////////////////////////////////////////////////////// void Actor::addForce(const Ogre::Vector3& force, NxForceMode mode, bool wakeup) { - mActor->addForce(toNxVec3(force), mode, wakeup); + mActor->addForce(NxConvert<NxVec3, Ogre::Vector3>(force), mode, wakeup); } ////////////////////////////////////////////////////////// +void Actor::addForce(const NxVec3& force, NxForceMode mode, bool wakeup) { + mActor->addForce(force, mode, wakeup); +} + +////////////////////////////////////////////////////////// + +void Actor::addForce(NxReal x, NxReal y, NxReal z, NxForceMode mode, bool wakeup) { + mActor->addForce(NxVec3(x,y,z), mode, wakeup); +} + +////////////////////////////////////////////////////////// + void Actor::addLocalForce(const Ogre::Vector3& force, NxForceMode mode, bool wakeup) { - mActor->addLocalForce(toNxVec3(force), mode, wakeup); + mActor->addLocalForce(NxConvert<NxVec3, Ogre::Vector3>(force), mode, wakeup); } ////////////////////////////////////////////////////////// +void Actor::addTorque(const NxVec3& torque, NxForceMode mode, bool wakeup) { + mActor->addTorque(torque, mode, wakeup); +} + +////////////////////////////////////////////////////////// + void Actor::addTorque(const Ogre::Vector3& torque, NxForceMode mode, bool wakeup) { - mActor->addTorque(toNxVec3(torque), mode, wakeup); + mActor->addTorque(NxConvert<NxVec3, Ogre::Vector3>(torque), mode, wakeup); } ////////////////////////////////////////////////////////// void Actor::addLocalTorque(const Ogre::Vector3& torque, NxForceMode mode, bool wakeup) { - mActor->addLocalTorque(toNxVec3(torque), mode, wakeup); + mActor->addLocalTorque(NxConvert<NxVec3, Ogre::Vector3>(torque), mode, wakeup); } ////////////////////////////////////////////////////////// @@ -886,13 +885,13 @@ ////////////////////////////////////////////////////////// Ogre::Vector3 Actor::getPointVelocity(const Ogre::Vector3& vec) const { - return toVector3(mActor->getPointVelocity(toNxVec3(vec))); + return NxConvert<Ogre::Vector3, NxVec3>(mActor->getPointVelocity(NxConvert<NxVec3, Ogre::Vector3>(vec))); } ////////////////////////////////////////////////////////// Ogre::Vector3 Actor::getLocalPointVelocity(const Ogre::Vector3& vec) const { - return toVector3(mActor->getLocalPointVelocity(toNxVec3(vec))); + return NxConvert<Ogre::Vector3, NxVec3>(mActor->getLocalPointVelocity(NxConvert<NxVec3, Ogre::Vector3>(vec))); } ////////////////////////////////////////////////////////// @@ -990,7 +989,7 @@ #if NX_SUPPORT_SWEEP_API NxU32 Actor::linearSweep(const Ogre::Vector3& motion, NxU32 flags, void* userData, NxU32 nbShapeDescriptions, NxSweepQueryHit* shapes, NxUserEntityReport<NxSweepQueryHit>* callback, const NxSweepCache* sweepCache) { - return mActor->linearSweep(toNxVec3(motion), flags, userData, nbShapeDescriptions, shapes, callback, sweepCache); + return mActor->linearSweep(NxConvert<NxVec3, Ogre::Vector3>(motion), flags, userData, nbShapeDescriptions, shapes, callback, sweepCache); } #endif @@ -1083,6 +1082,12 @@ ////////////////////////////////////////////////////////// +NxActorUserData* Actor::getUserData() { + return mNxActorUserData; +} + +////////////////////////////////////////////////////////// + StringPairList Actor::saveCustom() { StringPairList l; l.insert("ActorType", "Actor"); @@ -1093,6 +1098,7 @@ ////////////////////////////////////////////////////////// void Actor::disable() { + mActor->raiseActorFlag(NX_AF_DISABLE_COLLISION); mActor->raiseActorFlag(NX_AF_DISABLE_RESPONSE); mActor->raiseActorFlag(NX_AF_FLUID_DISABLE_COLLISION); @@ -1103,7 +1109,7 @@ mActor->setLinearMomentum(NxVec3(0,0,0)); mActor->setLinearVelocity(NxVec3(0,0,0)); - disableVisualisation(); +// disableVisualisation(); } ////////////////////////////////////////////////////////// Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.h 2007-12-17 18:04:28 UTC (rev 512) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.h 2007-12-26 14:29:56 UTC (rev 513) @@ -23,11 +23,11 @@ #include "NxOgrePrerequisites.h" #include "NxOgreContainer.h" // For: mCollisionList #include "NxOgreParams.h" +#include "NxOgrePose.h" namespace NxOgre { - /** - \page actorparams ActorParams + /** \page actorparams ActorParams String base params are case and space insensitive. @@ -173,109 +173,180 @@ */ + /** ActorParams - See \ref actorparams for the full string argument documentation. + @see \ref actorparams for the full string argument documentation. */ class NxExport ActorParams : public Params { public: + /** @brief Class based params. + @note Faster, less readable and reusable. + @see \ref actorparams + @example + <code> + ActorParams ap; + ap.mMass = 10; + ap.mGroup = "myGroup"; + ..., ap, ... + </code> - ActorParams(){setToDefault();} - ActorParams(const char* p) {process(p);} - ActorParams(NxString p) {process(p);} + */ + ActorParams() { + setToDefault(); + } + /** @brief String based params. "mass: 10, group: myGroup" + @note Slower but readable. + @params String of params. + @see \ref actorparams + @example + <code> + ..., "mass: 10, group: myGroup", ... + </code> + */ + ActorParams(const char* p) { + process(p); + } + + /** @brief String based params. "mass: 10, group: myGroup" + @note Slower but readable. + @params + @see \ref actorparams + @example + <code> + ..., "mass: 10, group: myGroup", ... + </code> + */ + ActorParams(NxString p) { + process(p); + } + + /** @brief Set's the Params to default based on NxActorDesc and NxBodyDesc defaults. + */ void setToDefault(); - void parse(Parameters); + + /** @brief Set's the Params based from an NxActorDesc + */ void fromNxActorDesc(NxActorDesc&); + + /** @brief Set's the Params based from a NxBodyDesc + */ void fromNxBodyDesc(NxBodyDesc&); //////////////////////////////////////////////////////////////// #if NX_SDK_VERSION_NUMBER >= 260 - /// NxCompartment of the Actor to sit in. - /// @todo NxOgre-ify - /// @default NULL + /** NxCompartment of the Actor to sit in. + @todo NxOgre-ify + @default NULL + */ NxCompartment* mCompartment; #endif - /// Density, mass must be 0 when density is used. + /** Density, mass must be 0 when density is used. + @default 0 + @see ActorParams::mMass + */ NxReal mDensity; #if NX_SDK_VERSION_NUMBER >= 272 - /// DominanceGroup (as Name). - /// @default "" + /** @brief DominanceGroup (as Name). + @default "" (Resorts to dominance group with identifier "Default") + */ NxString mDominanceGroupAsName; - /// DominanceGroup (as Index) - /// @default 0 + /** @brief DominanceGroup (as Index) + @default 0 + */ NxDominanceGroup mDominanceGroupAsIndex; + #endif - /// Flags for the NxActor - /// @see NxActorFlags - /// @default 0 + /** @brief Flags for the NxActor + @see NxActorFlags + @default 0 + */ NxU32 mActorFlags; - /// Group to use as index. GroupAsName must be blank. - /// @default 0 + /** @brief Group to use as index. GroupAsName must be blank. + @default 0 + */ NxActorGroup mGroupAsIndex; - /// Group to use from name. GroupAsIndex must be 0. - /// @default Blank String + /** @brief Group to use from name. GroupAsIndex must be 0. + @default Blank String (Resorts to actor group with identifier "Default") + */ NxString mGroupAsName; //////////////////////////////////////////////////////////////// - /// Angular Damping + /** @brief Angular Damping + */ NxReal mAngularDamping; - /// Angular Velocity + /** @brief Angular Velocity + */ NxVec3 mAngularVelocity; - /// + /** @brief CCD Motion Threshold + */ NxReal mCCDMotionThreshold; - /// + /** @brief Flags for the Body portion of an Actor, assuming it is dynamic. + @see NxBodyDesc + */ NxU32 mBodyFlags; - /// + /** @brief Linear Damping of the Actor + */ NxReal mLinearDamping; - /// + /** @brief Initial linear velocity of the actor + */ NxVec3 mLinearVelocity; - /// Mass of the Actor. When used, make sure density is zero. + /** @brief Mass of the Actor. + @note When used, make sure density is zero. + @default 10 + */ NxReal mMass; - /// + /** @brief Mass Local Pose of the body portion of the Actor + @default NxMatrix34.id() + */ NxMat34 mMassLocalPose; - /// + /** @brief Mass Space Inertia of the body portion of the Actor + */ NxVec3 mMassSpaceInertia; - /// + /** @brief Maximum angular velocity of the Actor + */ NxReal mMaxAngularVelocity; - /// + /** + */ NxReal mSleepAngularVelocity; - /// + /** + */ NxReal mSleepDamping; @@ -307,10 +378,24 @@ /// Set the first Entity of the Visual based Actors to have shadows or not. bool mNodeShadows; + Pose mNodePose; + private: + + //! \internal + void parse(Parameters); + }; // End of ActorParams class + /** Actor + An Actor is a single unit of matter in the Scene. It is physically represented by a "Collision Model" or a shape. If the actor + has some mass then it is known as a Dynamic Actor, capable of scurrying around in the Scene. If the Actor has + no mass then it is a static actor which never ever moves. + + + + */ class NxExport Actor { public: @@ -329,14 +414,13 @@ ////////////////////////////////////////////////////////// + virtual NxShortHashIdentifier getType() const {return NxHashes_Actor; /* "NxOgre-Actor" */} + virtual NxString getStringType() const {return "NxOgre-Actor";} + virtual bool hasVisualisation() const {return false;} - virtual void simulate(float); - virtual void render(float); - virtual void shapeSimulate(float); - virtual void shapeRender(float); bool isDead() { return (mActor == NULL); } + - /** Duplicate this actor @param name Name of the new Actor @@ -359,7 +443,7 @@ ////////////////////////////////////////////////////////// void setName(NxString); - NxString getName(); + NxString getName() const; //////////////////////////////////////////////////////// @@ -473,8 +557,17 @@ void addForceAtLocalPos(const Ogre::Vector3& force, const Ogre::Vector3& pos, NxForceMode mode = NX_FORCE, bool wakeup = true); void addLocalForceAtPos(const Ogre::Vector3& force, const Ogre::Vector3& pos, NxForceMode mode = NX_FORCE, bool wakeup = true); void addLocalForceAtLocalPos(const Ogre::Vector3& force, const Ogre::Vector3& pos, NxForceMode mode = NX_FORCE, bool wakeup = true); + + void addForce(const Ogre::Vector3& force, NxForceMode mode = NX_FORCE, bool wakeup = true); + void addForce(const NxVec3& force, NxForceMode = NX_FORCE, bool wakeup = true); + void addForce(NxReal x, NxReal y, NxReal z, NxForceMode = NX_FORCE, bool wakeup = true); void addLocalForce(const Ogre::Vector3& force, NxForceMode mode = NX_FORCE, bool wakeup = true); + + void addTorque(NxReal x, NxReal y, NxReal z, NxForceMode mode = NX_FORCE, bool wakeup = true) { + addTorque(NxVec3(x,y,z), mode, wakeup); + } + void addTorque(const NxVec3& torque, NxForceMode mode = NX_FORCE, bool wakeup = true); void addTorque(const Ogre::Vector3& torque, NxForceMode mode = NX_FORCE, bool wakeup = true); void addLocalTorque(const Ogre::Vector3& torque, NxForceMode mode = NX_FORCE, bool wakeup = true); NxReal computeKineticEnergy() const; @@ -521,6 +614,7 @@ mDynamicCollisionModel; void* getNxActorUserData(); + NxActorUserData* getUserData(); /** joinWith @@ -543,8 +637,6 @@ */ void disable(); - virtual void disableVisualisation() {} - NxU32 getBirthFrame() {return mBirthFrame;} ////////////////////////////////////////////////////////// @@ -558,9 +650,8 @@ NxActor* mActor; NxString mName; NxActorUserData* mNxActorUserData; - NxString mVisualIdentifier; NxU32 mBirthFrame; - + private: Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.cpp 2007-12-17 18:04:28 UTC (rev 512) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.cpp 2007-12-26 14:29:56 UTC (rev 513) @@ -25,6 +25,13 @@ #include "NxOgreScene.h" // For: Actor::mOwner #include "NxOgreShapeBlueprint.h" #include "NxOgreContainer.h" +#include "NxOgreOgreNodeRenderable.h" +#include "NxOgreRenderable.h" +#include "NxOgreRenderableSource.h" +#include "NxOgreNodeRenderable.h" +#include "NxOgreSceneRenderer.h" +#include "NxOgreUserData.h" +#include "NxOgreHelpers.h" namespace NxOgre { @@ -37,11 +44,51 @@ ////////////////////////////////////////////////////////// Body::Body(const NxString& identifier, Scene* scene, ShapeBlueprint *firstShapeDescription, const Pose& pose, ActorParams params) -: mNode(0), mEntity(0), Actor(identifier, scene, firstShapeDescription, pose, params) +: Actor(identifier, scene, firstShapeDescription, pose, params) { + NodeRenderableParams visualParams; + visualParams.Identifier = identifier; + visualParams.IdentifierType = visualParams.IT_CREATE; + visualParams.Intent = getStringType(); + + std::vector<NxString> splitID = Ogre::StringUtil::split(identifier, ";", 2); + + NxString visualIdentifier; + + if (splitID.size() == 1) { + visualIdentifier = identifier; + } + else { + visualIdentifier = splitID[1]; + } + + Ogre::StringUtil::trim(visualIdentifier); + + if (Ogre::StringUtil::startsWith(visualIdentifier, "(reference)")) { + NxString entityName = visualIdentifier.substr(11, entityName.length() - 11); + Ogre::StringUtil::trim(entityName); + visualParams.GraphicsModel = entityName; + visualParams.GraphicsModelType = visualParams.GMT_EXISTING_REFERENCE; + } + else { + visualParams.GraphicsModel = visualIdentifier; + visualParams.GraphicsModelType = visualParams.GMT_RESOURCE_IDENTIFIER; + } + + setLevelOfDetail(LOD_High); + mRenderable = mOwner->getSceneRenderer()->createNodeRenderable(visualParams); + mNodeRenderable = static_cast<NodeRenderable*>(mRenderable); + mNxActorUserData->RenderPtr = this; + mDeltaPose = mLastPose = getGlobalPose(); + + + mOwner->getSceneRenderer()->registerSource(this); + +#if 0 + if (params.mNodeName.length() == 0) { mNode = mOwner->getSceneManager()->createSceneNode(); } @@ -77,13 +124,10 @@ NxString entityName = mVisualIdentifier.substr(8, entityName.length() - 8); Ogre::StringUtil::trim(entityName); mEntity = mOwner->getSceneManager()->getEntity(entityName); - mNode->attachObject(mEntity); - } else if (Ogre::StringUtil::endsWith(mVisualIdentifier, ".mesh")) { mEntity = mOwner->getSceneManager()->createEntity(mName + "-0", mVisualIdentifier); mEntity->setCastShadows(params.mNodeShadows); - mNode->attachObject(mEntity); } if (mActor->getMass() == 0 && mOwner->getStaticGeometry()) { @@ -91,6 +135,14 @@ mOwner->getStaticGeometry()->addSceneNode(mNode); } + if (params.mNodePose.isZero() && mEntity && mNode) { + mNode->attachObject(mEntity); + } + else if (mEntity && mNode) { + Ogre::SceneNode* childNode = mNode->createChildSceneNode(params.mNodePose.getVector3(), params.mNodePose.getQuaternion()); + childNode->attachObject(mEntity); + } + if (params.mNodeScale != Ogre::Vector3(1,1,1)) { mNode->scale(params.mNodeScale); } @@ -100,13 +152,39 @@ mNode->setOrientation(pose); } +#endif +} +Body::Body(const NxString& identifier, Scene* scene, ShapeBlueprint *firstShapeDescription, const Pose& pose, NodeRenderableParams visualParams, ActorParams params) +: Actor(identifier, scene, firstShapeDescription, pose, params) +{ + + if (visualParams.Intent.size() == 0) + visualParams.Intent = getStringType(); + + setLevelOfDetail(LOD_High); + setInterpolation(I_Absolute); + mLastPoseCount = 0; + mRenderable = mOwner->getSceneRenderer()->createNodeRenderable(visualParams); + mNodeRenderable = static_cast<NodeRenderable*>(mRenderable); + mNxActorUserData->RenderPtr = this; + + + mOwner->getSceneRenderer()->registerSource(this); } ////////////////////////////////////////////////////////// Body::~Body() { + mOwner->getSceneRenderer()->unregisterSource(this); + + if (mRenderable) { + delete mRenderable; + mRenderable = 0; + } + +#if 0 if (mNode == 0) return; @@ -129,26 +207,131 @@ if (mNode) mOwner->getSceneManager()->destroySceneNode(mNode->getName()); +#endif } ////////////////////////////////////////////////////////// -void Body::simulate(float dT) { - shapeSimulate(dT); +void Body::__renderSelf() { + + switch (mInterpolation) { + case I_Absolute: + { + mDeltaPose = getGlobalPose(); + mRenderable->setPose(mDeltaPose); + mLastPose = mDeltaPose; + } + break; + + case I_Linear: + { + Pose blended_pose = NxInterpolate(mLastPose, getGlobalPose(), mOwner->getLastAlphaValue()); + mLastPose = getGlobalPose(); + mRenderable->setPose(blended_pose); + } + break; + + case I_Linear_x4: + { + mLastPoseCount++; + + if (mLastPoseCount == 4) { + + mDeltaPose = getGlobalPose(); + + if (mDeltaPose.v != mLastPose.v) { + mDeltaPose = NxInterpolate(mDeltaPose, mLastPose); + mLastPose = getGlobalPose(); + mLastPoseCount = 0; + } + else { + mLastPoseCount--; + mDeltaPose = mLastPose; + } + + } + + mRenderable->setPose(mDeltaPose); + } + break; + + case I_Linear_x8: + { + mLastPoseCount++; + + if (mLastPoseCount == 8) { + + mDeltaPose = getGlobalPose(); + + if (mDeltaPose.v != mLastPose.v) { + mDeltaPose = NxInterpolate(mDeltaPose, mLastPose); + mLastPose = getGlobalPose(); + mLastPoseCount = 0; + } + else { + mLastPoseCount--; + mDeltaPose = mLastPose; + } + + } + + mRenderable->setPose(mDeltaPose); + } + break; + } + } ////////////////////////////////////////////////////////// -void Body::render(float) { +#if 0 +void Body::renderTo(const Pose& pose) { + mNode->setPosition(pose); + mNode->setOrientation(pose); +} +#endif + +////////////////////////////////////////////////////////// + + +/* +void Body::render(float dT) { + #if (NX_UNSTABLE_USE_SCENE_ACTIVE_TRANSFORM == 1) +#if (NX_UNSTABLE_ACCUMULATOR == 1) + + #define alpha dT + assert ( alpha >= 0.0f && alpha <= 1.0f ); + NxMat34 nm = mActor->getGlobalPose(); + NxVec3 destPos = nm.t; + NxQuat destOri = nm.M; + + NxVec3 renderPos = mPreviousPosition * ( 1.0f - alpha ) + destPos * alpha; + NxQuat renderOri; + renderOri.slerp( alpha , mPreviousOrientation, destOri ); + + mNode->setPosition( NxConvert<Ogre::Vector3, NxVec3>(renderPos) ); + mNode->setOrientation( NxConvert<Ogre::Quaternion, NxQuat>(renderOri) ); + + mPreviousPosition = destPos; + mPreviousOrientation = destOri; + + shapeRender(0.0f); + +#else + + NxMat34 nm = mActor->getGlobalPose(); NxVec3 nv(nm.t); NxQuat nq(nm.M); mNode->setPosition(nv.x, nv.y, nv.z); mNode->setOrientation(nq.w,nq.x,nq.y,nq.z); shapeRender(0); + +#endif + #else if (mActor && mNode) { mNode->setPosition(getGlobalPosition()); @@ -156,8 +339,10 @@ shapeRender(dT); } #endif + } - +*/ +#if 0 ////////////////////////////////////////////////////////// void Body::setNode(Ogre::SceneNode* node) { @@ -314,4 +499,24 @@ ////////////////////////////////////////////////////////// +#endif + + + +StringPairList Body::saveCustom() { + + // Temp + StringPairList l; + return l; +} + +////////////////////////////////////////////////////////// + +void Body::restoreCustom(StringPairList spl) { + + // TEMP +} + +////////////////////////////////////////////////////////// + } //End of NxOgre namespace. Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.h 2007-12-17 18:04:28 UTC (rev 512) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.h 2007-12-26 14:29:56 UTC (rev 513) @@ -22,35 +22,65 @@ #include "NxOgrePrerequisites.h" #include "NxOgreActor.h" // For: Body inherits Actor +#include "NxOgrePose.h" +#include "NxOgreRenderableSource.h" +#include "NxOgreRenderable.h" +#include "NxOgreNodeRenderable.h" namespace NxOgre { - class NxExport Body : public Actor { + class NxExport Body : public Actor, public RenderableSource { public: - Body(const NxString& name, Scene*); - Body(const NxString& name, Scene*, ShapeBlueprint*, const Pose&, ActorParams = ActorParams()); + Body(const NxString& NameAndOrShorthandVisualIdentifier, Scene*); + + /** @brief Body constructor with limited short-hand visualisation specification. + How the body is visualised is built into the identifier. + + - "myBody" + No Visualisation + + - "myBody; cow.mesh" + Visualisation as "cow.mesh" as the graphics model loading it from + the rendersystems resource system. + (Default behaviour) + + - "myBody; (reference) cow.mesh" + Visualisation as "cow.mesh" from a pre-existing model that has + already been loaded and in the scene already. + (Moving it from one visualisation node to this one) + */ + Body(const NxString& Identifier, Scene*, ShapeBlueprint*, const Pose&, ActorParams = ActorParams()); + + /** Body constructor with full visualisation. + + mSceneMgr->createBody("myBody", new CubeShape(2,2,2), Vector3(0,5,0), "model: cube.1m.mesh, scale: 2 2 2", "mass: 10"); + + */ + Body(const NxString& Identifier, Scene*, ShapeBlueprint*, const Pose&, NodeRenderableParams, ActorParams = ActorParams()); + + /** @brief Body destructor. If you hate memory leaks and crashes, use mScene->destroyActor(...); + */ + virtual ~Body(); - virtual bool hasVisualisation() const {return true;} - Ogre::SceneNode* getNode() {return mNode;} - Ogre::Entity* getEntity() {return mEntity;} - void setNode(Ogre::SceneNode*); - void setEntity(Ogre::Entity*); - void simulate(float); - void render(float); + NxShortHashIdentifier getType() const {return NxHashes_Body; /* "NxOgre-Example-Body" */} + NxString getStringType() const {return "NxOgre-Example-Body";} + StringPairList saveCustom(); void restoreCustom(StringPairList); - void disableVisualisation(); protected: - Ogre::SceneNode* mNode; - Ogre::Entity* mEntity; + void __renderSelf(); + NodeRenderable* mNodeRenderable; + + + }; }; Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp 2007-12-17 18:04:28 UTC (rev 512) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp 2007-12-26 14:29:56 UTC (rev 513) @@ -19,306 +19,77 @@ #include "NxOgreStable.h" -#if (NX_USE_CHARACTER_API == 1) +#if (NX_USE_LEGACY_NXCONTROLLER == 0) #include "NxOgreCharacter.h" -#include "NxOgrePose.h" // For: Character position and orientation -#include "NxOgreCharacterController.h" // For: HitReport and Character creation -#include "NxOgreScene.h" // For: getNxScene in Scene -#include "NxOgreHelpers.h" // For: NxVec3 to Vector3 conversion -#include "NxOgreUserData.h" // For: Actor's UserData +#include "NxOgreScene.h" +#include "NxOgreNxActorController.h" -#include "NxCharacter.h" -#include "NxBoxController.h" -#include "NxCapsuleController.h" +#if (NX_USE_CHARACTER_API == 1) +# include "NxOgreNxCharacterController.h" +#endif namespace NxOgre { -//////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////// -Character::Character(const NxString &name, Scene* scene, CharacterController* cc, Pose p , CharacterParams cp) -: mName(name), mScene(scene), mCharacterController(cc), mNode(0), mEntity(0) { - - mMoveVectorController = mCharacterController; - mCharacterController->_registerCharacter(mName, this); - mType = cp.mType; - mDimensions = cp.mDimensions; - mUpAxis = cp.mUpAxis; - mSlopeLimit = cp.mSlopeLimit; - mStepOffset = cp.mStepOffset; - mSkinWidth = cp.mSkinWidth; - mMove_ActiveGroupsMask = cp.mActiveGroupsMask; - mMove_Sharpness = cp.mSharpness; - mMove_GroupMask = cp.mGroupMask; - mNextMovementDirection.zero(); - mDirection.id(); - mMass = 100; /// TEMP. +void CharacterParams::setToDefault() { - if (mType == CharacterParams::CT_Box) { +#if (NX_USE_CHARACTER_API == 1) + mControllerType = CT_NXCONTROLLER; +#else + mControllerType = CT_NXACTOR; +#endif - NxBoxControllerDesc desc; - desc.setToDefault(); - desc.position.set(p.v.x,p.v.y,p.v.z); // 0,0,0 - desc.extents.set(mDimensions.x * 0.5f, mDimensions.y * 0.5f, mDimensions.z * 0.5f); // 0.5, 1, 0.5 - desc.upDirection = mUpAxis; // NX_Y - desc.slopeLimit = mSlopeLimit; // 0.707 - desc.stepOffset = mStepOffset; // 0.5 - desc.skinWidth = mSkinWidth; // 0.1 - desc.callback = mCharacterController; - desc.userData = this; - - mCharacter = mCharacterController->mControllerManager->createController(mScene->getNxScene(), desc); + mStepOffset = 0.0f; + mSlopeLimit = 0.0f; + mUpDirection = NX_AXIS_PLUS_Y; + //mGroupMask; + mControllerCollisionShape = 0; - } - else { +} - NxCapsuleControllerDesc desc; - desc.setToDefault(); - desc.radius = mDimensions.x; - desc.height = mDimensions.y; - desc.position.set(p.v.x,p.v.y,p.v.z); // 0,0,0 - desc.upDirection = mUpAxis; // NX_Y - desc.slopeLimit = mSlopeLimit; // 0.707 - desc.stepOffset = mStepOffset; // 0.5 - desc.skinWidth = mSkinWidth; // 0.1 - desc.callback = mCharacterController; - desc.userData = this; +///////////////////////////////////////////////////////////// - mCharacter = mCharacterController->mControllerManager->createController(mScene->getNxScene(), desc); - - } +Character::Character(NxString identifier, Pose pose, CharacterModel* model, CharacterParams params, CharacterController* character_controller, Scene* scene) { - if (mCharacter == 0) { - NxThrow_Error("Character '" + mName + "' could not be created."); + if (model == 0) { + NxThrow_Error("Character Model pointer is null!"); + mDead = true; return; } - mNxActorUserData = new NxActorUserData(this, NxActorUserData::T_Character); - mCharacter->getActor()->setGroup(0); - mCharacter->getActor()->userData = mNxActorUserData; - mCharacter->setCollision(true); - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -Character::~Character() { - - mCharacterController->_unregisterCharacter(mName); - mCharacterController->mControllerManager->releaseController(*mCharacter); - - if (mNode == 0) + if (params.mControllerType == CharacterParams::CT_CUSTOM && character_controller == 0) { + NxThrow_Error("ControllerType is Custom but pointer is null!"); + mDead = true; return; - - - Ogre::SceneNode::ObjectIterator object_it = mNode->getAttachedObjectIterator(); - Ogre::MovableObject *m; - while(object_it.hasMoreElements()) { - m = object_it.getNext(); - if (m->getMovableType() == "Entity") { - mScene->getSceneManager()->destroyEntity((Ogre::Entity*) m); - } - else { - mNode->detachObject(m); - mScene->getSceneManager()->getRootSceneNode()->attachObject(m); - } } - mNode->detachAllObjects(); - mNode->removeAndDestroyAllChildren(); - - if (mNode) - mScene->getSceneManager()->destroySceneNode(mNode->getName()); - - delete mNxActorUserData; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::simulate(float t) { - - NxVec3 moveVector, gravity; - moveVector.zero(); - mScene->getNxScene()->getGravity(gravity); - - // Calculate next movement. - mMoveVectorController->move(moveVector, mNextMovementDirection, mDirection, gravity, t, this); - - // Move it - mCharacter->move(moveVector, mMove_ActiveGroupsMask, mMove_MinDistance, mCollisionFlags, mMove_Sharpness, &mMove_GroupMask); - - // ...And reset. - mNextMovementDirection.zero(); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::render(float) { - if (mNode) { - mNode->setPosition(getGlobalPosition()); - mNode->setOrientation(getGlobalOrientation()); + mName = identifier; + + if (params.mControllerType == CharacterParams::CT_NXACTOR) { + mController = new NxActorController(pose.toMat34(), params.mControllerCollisionShape, scene->getNxScene()); } -} +#if (NX_USE_CHARACTER_API == 1) + else if (params.mControllerType == CharacterParams::CT_NXCONTROLLER) { + mController = new NxCharacterController(pose.toMat34(), params.mControllerCollisionShape, scene->getNxScene()); -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::createNode() { - if (mNode) - return; - mNode = mScene->getSceneManager()->getRootSceneNode()->createChildSceneNode(mName, toVector3(NxVec3(mCharacter->getPosition().x,mCharacter->getPosition().y,mCharacter->getPosition().z))); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::attachMesh(const NxString& meshName) { - - createNode(); - - if (mEntity == 0) { - mEntity = mScene->getSceneManager()->createEntity(mName, meshName); - mNode->attachObject(mEntity); } +#endif else { - Ogre::Entity* entity = mScene->getSceneManager()->createEntity(mName, meshName); - mNode->attachObject(entity); + mController = character_controller; } -} -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::attachSkeletonMesh(const NxString&) { - NxUnderConstruction; } -//////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////// -void Character::bindToAnimation(Movement, const NxString& AnimationName) { - NxUnderConstruction; -} +Character::~Character() { -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::bindFeet(const NxString& leftBone, const NxString& rightBone) { - NxUnderConstruction; } -//////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////// -void Character::unBindFeet() { - NxUnderConstruction; } -//////////////////////////////////////////////////////////////////////////////////////////////// - -Ogre::Vector3 Character::getGlobalPosition() { - return toVector3(NxVec3(mCharacter->getPosition().x, mCharacter->getPosition().y,mCharacter->getPosition().z)); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -Ogre::Quaternion Character::getGlobalOrientation() { - return toQuaternion(mDirection); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::setRawNextMovementDirection(const NxVec3& direction) { - mNextMovementDirection = direction; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::setDirection(const Ogre::Radian &r) { - mDirection.fromAngleAxis(r.valueAngleUnits(),NxVec3(0,1,0)); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::setDirection(const Ogre::Quaternion &q) { - mDirection = toNxQuat(q); - mDirection.x = 0; - mDirection.z = 0; - - mDirection.normalize(); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::addMovement(Direction m) { - - if (mUpAxis == NX_Y) { - - switch (m) { - case DR_Forward: - mNextMovementDirection -= NxVec3Axis[NX_X]; - return; - break; - - case DR_Backward: - mNextMovementDirection += NxVec3Axis[NX_X]; - return; - break; - - case DR_StepLeft: - mNextMovementDirection -= NxVec3Axis[NX_Z]; - return; - break; - - case DR_StepRight: - mNextMovementDirection += NxVec3Axis[NX_Z]; - return; - break; - - case DR_Jump_Up: - // jump inject code - mNextMovementDirection.zero(); - // jump timer++ - // pass jump timer onto move bit as well. - break; - - case DR_Ladder_Up: - mNextMovementDirection += NxVec3Axis[NX_Y]; - return; - break; - - case DR_Ladder_Down: - mNextMovementDirection -= NxVec3Axis[NX_Y]; - return; - break; - - } - - return; - } - else if (mUpAxis == NX_X) { - // TODO - } - else if (mUpAxis == NX_Z) { - // TODO - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::setMovementVectorController(CharacterMovementVectorController* cmvc) { - mMoveVectorController = cmvc; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void Character::setPosition(const Ogre::Vector3& v) { - mCharacter->setPosition(toNxExtendedVec3(v)); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void CharacterMovementVectorController::move(NxVec3 &out, NxVec3 &moveVector, NxQuat &direction, NxVec3 &g, float t, Character*) { - // TODO: Non NX_Y directions. - out = ((direction.rot(moveVector) * 1.5) + g) * t; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -} //End of NxOgre namespace. - -#endif +#endif Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h 2007-12-17 18:04:28 UTC (rev 512) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h 2007-12-26 14:29:56 UTC (rev 513) @@ -19,138 +19,176 @@ #ifndef __NXOGRE_CHARACTER_H__ #define __NXOGRE_CHARACTER_H__ -#if (NX_USE_CHARACTER_API == 1) #include "NxOgrePrerequisites.h" -#include "NxOgreContainer.h" // For: mCollisionList -#include "NxOgreParams.h" // For: CharacterParams +#if (NX_USE_LEGACY_NXCONTROLLER == 0) + +#incl... [truncated message content] |
From: <and...@us...> - 2008-01-16 13:00:36
|
Revision: 553 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=553&view=rev Author: andy_miller Date: 2008-01-16 05:00:40 -0800 (Wed, 16 Jan 2008) Log Message: ----------- NxOgre Updates Modified Paths: -------------- trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStreamPtr.h Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.cpp 2008-01-16 05:43:04 UTC (rev 552) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.cpp 2008-01-16 13:00:40 UTC (rev 553) @@ -30,14 +30,14 @@ ////////////////////////////////////////////////////////////////////////////////// -inline NxExtendedVec3 toNxExtendedVec3(const Ogre::Vector3& v) { +NxExtendedVec3 toNxExtendedVec3(const Ogre::Vector3& v) { return NxExtendedVec3(v.x,v.y,v.z); } ////////////////////////////////////////////////////////////////////////////////// // Generates a 8 digit ID, based on groupCount and type of object (typeHash) -inline NxString NxCreateID(unsigned int groupCount, NxString typeHash) { +NxString NxCreateID(unsigned int groupCount, NxString typeHash) { std::stringstream ss; ss << typeHash << "-" << std::hex << (rand() % 1024) << "-" << groupCount; return ss.str(); @@ -45,7 +45,7 @@ ////////////////////////////////////////////////////////////////////////////////// -inline NxMat33 toNxMat33(const Ogre::Matrix3& matrix) { +NxMat33 toNxMat33(const Ogre::Matrix3& matrix) { NxReal* c = new NxReal[9]; c[0] = matrix[0][0]; c[1] = matrix[1][0]; c[2] = matrix[2][0]; @@ -63,7 +63,7 @@ ////////////////////////////////////////////////////////////////////////////////// -inline NxMat34 toNxMat34(const Ogre::Matrix4& matrix) { +NxMat34 toNxMat34(const Ogre::Matrix4& matrix) { NxUnderConstruction; @@ -156,10 +156,10 @@ std::stringstream stream; stream << quat.w << " " << quat.x << " " << quat.y << " " << quat.z; return stream.str(); -} +} //////////////////////////////////////////////////////////////// - + template <typename Type> Type NxFromString(const NxString& string) { @@ -167,8 +167,8 @@ Type val = 0; str >> val; return val; -} - +} + //////////////////////////////////////////////////////////////// template <> @@ -206,7 +206,7 @@ return quaternion; -} +} //////////////////////////////////////////////////////////////// @@ -273,9 +273,9 @@ } //////////////////////////////////////////////////////////////// - -inline Pose NxInterpolate(Pose First, Pose Second, NxReal c) { +Pose NxInterpolate(Pose First, Pose Second, NxReal c) { + Pose r; r.v.x = First.v.x * (1 - c) + Second.v.x * c; @@ -287,5 +287,5 @@ } //////////////////////////////////////////////////////////////// - -}; //End of NxOgre namespace. + +}; //End of NxOgre namespace. Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.h 2008-01-16 05:43:04 UTC (rev 552) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.h 2008-01-16 13:00:40 UTC (rev 553) @@ -87,18 +87,18 @@ @result The rotated vector */ NxVec3 NxExport operator* (const NxQuat&, const NxVec3&); - - - // To Strings - - /** @brief Generic class/integral to String. - @note Uses STL stringstream for conversion. - @example - <code> - NxString str = NxToString<float>(1.2345f); - </code> - @result The converted string - */ + + + // To Strings + + /** @brief Generic class/integral to String. + @note Uses STL stringstream for conversion. + @example + <code> + NxString str = NxToString<float>(1.2345f); + </code> + @result The converted string + */ template <typename Type> NxString NxExport NxToString(const Type& type); @@ -281,8 +281,8 @@ /** @brief Interpolates */ - inline Pose NxExport NxInterpolate(Pose First, Pose Second, NxReal c = 0.5f); + Pose NxExport NxInterpolate(Pose First, Pose Second, NxReal c = 0.5f); }; -#endif +#endif Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.h 2008-01-16 05:43:04 UTC (rev 552) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.h 2008-01-16 13:00:40 UTC (rev 553) @@ -52,12 +52,12 @@ void fromMat33(const NxMat33&); NxMat33 toMat33() const; - inline Ogre::Vector3 getVector3() const; - inline NxVec3 getVec3() const; - inline Ogre::Quaternion getQuaternion() const; - inline NxQuat getQuat() const; + Ogre::Vector3 getVector3() const; + NxVec3 getVec3() const; + Ogre::Quaternion getQuaternion() const; + NxQuat getQuat() const; - inline NxString toString() const; + NxString toString() const; //////////////////////////////////////////////////////////////////////////////// @@ -100,4 +100,4 @@ }; -#endif +#endif Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStreamPtr.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStreamPtr.h 2008-01-16 05:43:04 UTC (rev 552) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStreamPtr.h 2008-01-16 13:00:40 UTC (rev 553) @@ -50,7 +50,7 @@ ResourceStreamPtr(); ResourceStreamPtr(ResourceIdentifier); - ResourceStreamPtr(ResourceIdentifier, void*); + //ResourceStreamPtr(ResourceIdentifier, void*); ResourceStreamPtr(const ResourceStreamPtr& r) : pStream(0), pUseCount(0) @@ -172,4 +172,4 @@ }; // End of namespace -#endif +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-06-20 06:56:10
|
Revision: 598 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=598&view=rev Author: andy_miller Date: 2008-06-19 23:56:17 -0700 (Thu, 19 Jun 2008) Log Message: ----------- nxogre cleanup Removed Paths: ------------- trunk/python-ogre/ThirdParty/nxogre/FireState.cpp trunk/python-ogre/ThirdParty/nxogre/FireState.h trunk/python-ogre/ThirdParty/nxogre/Flour.cpp Deleted: trunk/python-ogre/ThirdParty/nxogre/FireState.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/FireState.cpp 2008-06-20 06:54:10 UTC (rev 597) +++ trunk/python-ogre/ThirdParty/nxogre/FireState.cpp 2008-06-20 06:56:17 UTC (rev 598) @@ -1 +0,0 @@ -// FireState Deleted: trunk/python-ogre/ThirdParty/nxogre/FireState.h =================================================================== Deleted: trunk/python-ogre/ThirdParty/nxogre/Flour.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/Flour.cpp 2008-06-20 06:54:10 UTC (rev 597) +++ trunk/python-ogre/ThirdParty/nxogre/Flour.cpp 2008-06-20 06:56:17 UTC (rev 598) @@ -1 +0,0 @@ -junk \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-06-20 06:54:07
|
Revision: 597 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=597&view=rev Author: andy_miller Date: 2008-06-19 23:54:10 -0700 (Thu, 19 Jun 2008) Log Message: ----------- nxogre update Modified Paths: -------------- trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.cpp trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.h trunk/python-ogre/ThirdParty/nxogre/NxOgre.h trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.h trunk/python-ogre/ThirdParty/nxogre/NxOgreAllocator.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreAllocator.h trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.h trunk/python-ogre/ThirdParty/nxogre/NxOgreConfig.h trunk/python-ogre/ThirdParty/nxogre/NxOgreContactCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreContainer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreContainer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreDebugRenderer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreDualIdentifier.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreDualIdentifier.h trunk/python-ogre/ThirdParty/nxogre/NxOgreError.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreExtendedTypes.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFluid.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreFluid.h trunk/python-ogre/ThirdParty/nxogre/NxOgreForceField.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreGroup.h trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.h trunk/python-ogre/ThirdParty/nxogre/NxOgreIntersection.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreIntersection.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJoint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJoint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJointCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJointSet1.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJointSet2.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreLog.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreLog.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMachine.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMachine.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterial.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterial.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMeshRenderable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMeshRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreNodeRenderable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreNodeRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreNxActorController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreNxActorController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreMeshRenderable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreMeshRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreNodeRenderable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreNodeRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreSceneRenderer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreSceneRenderer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreParams.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreParams.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePerformer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgrePerformer.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePhysXDriver.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgrePhysXDriver.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePlatform.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePrerequisites.h trunk/python-ogre/ThirdParty/nxogre/NxOgreRaycaster.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreRaycaster.h trunk/python-ogre/ThirdParty/nxogre/NxOgreRemoteDebuggerConnection.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreRemoteDebuggerConnection.h trunk/python-ogre/ThirdParty/nxogre/NxOgreRenderable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreRenderableSource.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreRenderableSource.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceManager.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceManager.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceSystem.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceSystem.h trunk/python-ogre/ThirdParty/nxogre/NxOgreScene.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreScene.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneContactController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneRenderer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneRenderer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneTriggerController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneTriggerController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShape.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShape.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapePrimitives.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapePrimitives.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeTerrain.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeTerrain.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeWheel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeWheel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSheet.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSheet.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSimpleActor.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSimpleActor.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSimpleShape.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSimpleShape.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSkeleton.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSkeleton.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSleepCallback.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSleepCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.h trunk/python-ogre/ThirdParty/nxogre/NxOgreStable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreStable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTesting.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTesting.h trunk/python-ogre/ThirdParty/nxogre/NxOgreThrow.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTrigger.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTrigger.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTriggerCallback.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTriggerCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreUserAllocator.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreUserAllocator.h trunk/python-ogre/ThirdParty/nxogre/NxOgreWheelSet.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreWheelSet.h trunk/python-ogre/ThirdParty/nxogre/NxOgreWorld.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreWorld.h Added Paths: ----------- trunk/python-ogre/ThirdParty/nxogre/FireState.cpp trunk/python-ogre/ThirdParty/nxogre/Flour.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreDeletionCallback.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreDeletionCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResource.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResource.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResourceManager.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResourceManager.h trunk/python-ogre/ThirdParty/nxogre/NxOgreHeightfield.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreHeightfield.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJointCallback.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.h trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacterSweep.h trunk/python-ogre/ThirdParty/nxogre/NxOgreManualHeightfield.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreManualHeightfield.h trunk/python-ogre/ThirdParty/nxogre/NxOgreManualMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreManualMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreManualMeshUtil.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreManualMeshUtil.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterialAlias.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterialAlias.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMemoryResource.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMemoryResource.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMemoryResourceManager.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMemoryResourceManager.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMeshParams.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMeshParams.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePrerequisitesOgre.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResource.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResource.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceCallback.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeMeshes.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeMeshes.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTimeStep.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTimer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTimer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTriggerFunction.h trunk/python-ogre/ThirdParty/nxogre/NxOgreVoidPointer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreWheelContactCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreWhen.h Modified: trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.cpp 2008-06-17 04:38:24 UTC (rev 596) +++ trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.cpp 2008-06-20 06:54:10 UTC (rev 597) @@ -25,4 +25,629 @@ */ #include "NxOgreStable.h" -#include "BetajaenCC.h" \ No newline at end of file +#include "BetajaenCC.h" + +#if 0 + +BETAJAEN_CC_NAMESPACE_START + +/* + Flat + + \note Iterator is known as Type* in this file only. +*/ + +template< class Type, class AllocatorType > +Flat<Type, AllocatorType>::Flat(AllocatorPtr allocator, bool deleteAllocator) + : First(NULL), Last(NULL), End(NULL), Allocator(allocator), AutoDeleteAllocator(deleteAllocator) +{ +} + +///////////////////////////////////////////////////////////// + +template< class Type, class AllocatorType > +Flat<Type, AllocatorType>::~Flat() +{ + _deallocate(First); + if (AutoDeleteAllocator) + delete Allocator; +} + +///////////////////////////////////////////////////////////// + +template< class Type, class AllocatorType > +unsigned int Flat<Type, AllocatorType>::_size() const +{ + return (unsigned int) (Last - First); +} + +///////////////////////////////////////////////////////////// + +template< class Type, class AllocatorType > +unsigned int Flat<Type, AllocatorType>::_capacity() const +{ + return (unsigned int) (First == 0 ? 0 : End - First); +} + +///////////////////////////////////////////////////////////// + +template< class Type, class AllocatorType > +Type* Flat<Type, AllocatorType>::_allocate(unsigned int size) +{ + return (Type*) Allocator->Allocate(size * sizeof(Type)); +} + +///////////////////////////////////////////////////////////// + +template< class Type, class AllocatorType > +void Flat<Type, AllocatorType>::_deallocate(Type* p) +{ + if (p) + Allocator->Deallocate(p); +} + +///////////////////////////////////////////////////////////// + +template< class Type, class AllocatorType > +Type* Flat<Type, AllocatorType>::_reallocate(Type* p, unsigned int size) +{ + return (Iterator) Allocator->Reallocate(p, size * sizeof(Type)); +} + +///////////////////////////////////////////////////////////// + +template< class Type, class AllocatorType > +void Flat<Type, AllocatorType>::_clip(unsigned int size) +{ + + if (size < _size()) + return; + + Iterator new_first = _allocate(size); + _copy(First, Last, new_first); + _destroy(First, Last); + _deallocate(First); + End = new_first + size; + Last = new_first + _size(); + First = new_first; + +} + +///////////////////////////////////////////////////////////// + +template< class Type, class AllocatorType > +void Flat<Type, AllocatorType>::_reserve(unsigned int new_size) +{ + if (_capacity() >= new_size) + return; + + Iterator new_first = _allocate(new_size); + _copy(First, Last, new_first); + _destroy(First, Last); + _deallocate(First); + End = new_first + new_size; + Last = new_first + _size(); + First = new_first; + +} + +///////////////////////////////////////////////////////////// + +template< class Type, class AllocatorType > +Type* Flat<Type, AllocatorType>::_copy(Type* begin, Type* end, Type* dest) +{ + for (;begin != end; ++dest, ++begin) + *dest = *begin; + return dest; +} + +///////////////////////////////////////////////////////////// + +template< class Type, class AllocatorType > +void Flat<Type, AllocatorType>::_delete_range(Type* begin, Type* end) +{ + for (; begin != end; ++begin) { + BETAJAEN_CC_DELETE(*begin); + } +} + +///////////////////////////////////////////////////////////// + +template< class Type, class AllocatorType > +void Flat<Type, AllocatorType>::_destroy(Type* begin, Type* end) +{ + for (; begin != end; ++begin) { + BETAJAEN_CC_DESTRUCTOR(begin) + begin->~Type(); + } +} + +BETAJAEN_CC_NAMESPACE_END + + +/** + SharedList +*/ + +BETAJAEN_CC_NAMESPACE_START + +///////////////////////////////////////////////////////////// + +#define SharedListType SharedList<Type, AllocatorType> +#define TypePtr Type* + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +SharedList<Type, AllocatorType>::SharedList(AllocatorType* _allocator, bool _auto_delete_allocator) +{ + if (_allocator == NULL) + _allocator = new AllocatorType(); + + _Flat = new FlatType(_allocator, _auto_delete_allocator); + _Usage = new unsigned int(1); + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +SharedList<Type, AllocatorType>::SharedList(const SharedListType& other) +{ + + _Flat = other._Flat; + _Usage = other._Usage; + ++(*_Usage); + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +SharedListType& SharedList<Type, AllocatorType>::operator=(const SharedListType& other) +{ + + if (_Flat) + { + _Flat->_delete_range(_Flat->First, _Flat->Last); + delete _Flat; + } + + if (_Usage) + delete _Usage; + + _Flat = other._Flat; + _Usage = other._Usage; + ++(*_Usage); + + return *this; + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +TypePtr SharedList<Type, AllocatorType>::Get(size_t pos) +{ + if (pos > Size()) + return NULL; + + return *(_Flat->First + pos); +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +TypePtr SharedList<Type, AllocatorType>::operator[](size_t pos) +{ + if (pos > Size()) + return NULL; + + return *(_Flat->First + pos); +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +unsigned int SharedList<Type, AllocatorType>::WhereIs(TypePtr ptr) +{ + + if (_Flat->_size() == 0) + return 0; + + unsigned int i=0; + for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin, ++i) + { + if (ptr == (*begin)) + return i; + } + + return 0; +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +bool SharedList<Type, AllocatorType>::Has(TypePtr ptr) +{ + + if (_Flat->_size() == 0) + return false; + + for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) + { + if (ptr == (*begin)) + return true; + } + + return false; + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +unsigned SharedList<Type, AllocatorType>::Size() const +{ + return _Flat->_size(); +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +void SharedList<Type, AllocatorType>::Insert(Type* const & val) +{ + + if (_Flat->End <= _Flat->Last) + _Flat->_reserve( (1 + Size()) * 2); + + *_Flat->Last = val; + _Flat->Last++; + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +void SharedList<Type, AllocatorType>::Clean(unsigned int n) +{ + _Flat->_clip(_Flat->_size() + n); +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +void SharedList<Type, AllocatorType>::Destroy(unsigned int n) +{ + if (n == 0) + return Destroy(First); + + if (n == Size()) + return Destroy(Last); + + delete *(_Flat->First + n); + + _Flat->_destroy(_Flat->First + n, _Flat->First + n + 1); + _Flat->_copy(_Flat->First + n + 1, _Flat->Last, _Flat->First + n); + _Flat->Last--; + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +void SharedList<Type, AllocatorType>::DestroyAll() +{ + if (Size() == 0) + return; + + _Flat->_delete_range(_Flat->First, _Flat->Last); + // Could be iffy. + _Flat->Last = _Flat->First; + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +void SharedList<Type, AllocatorType>::Destroy(TypePtr val) { + unsigned int i = WhereIs(val); + Destroy(i); +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +void SharedList<Type, AllocatorType>::Destroy(AbsolutePosition position) +{ + + switch(position) { + + case First: + { + delete *_Flat->First; + _Flat->_copy(_Flat->First + 1, _Flat->Last + 1, _Flat->First); + _Flat->Last--; + } + break; + + case Last: + { + _Flat->Last--; + delete *_Flat->Last; + } + break; + + } + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +TypePtr SharedList<Type, AllocatorType>::Remove(unsigned int n) +{ + + if (n == 0) + return Remove(First); + + if (n == Size()) + return Remove(Last); + + TypePtr ptr = Get(n); + _Flat->_destroy(_Flat->First + n, _Flat->First + n + 1); + _Flat->_copy(_Flat->First + n + 1, _Flat->Last, _Flat->First + n); + _Flat->Last--; + + return ptr; +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +TypePtr SharedList<Type, AllocatorType>::Remove(AbsolutePosition position) +{ + + if (_Flat->_size() == 0) + return NULL; + + switch(position) { + + case First: + { + TypePtr t = *(_Flat->First); + _Flat->_copy(_Flat->First + 1, _Flat->Last + 1, _Flat->First); + _Flat->Last--; + return t; + } + + break; + + case Last: + { + _Flat->Last--; + return *(_Flat->Last); + } + break; + } + + return NULL; + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +TypePtr SharedList<Type, AllocatorType>::Begin() +{ + + if (_Flat->_size() == 0) + return NULL; + + _Iterator = _Flat->First; + return *_Iterator; + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +TypePtr SharedList<Type, AllocatorType>::Next() +{ + + if (_Flat->_size() == 0) + return NULL; + else if (_Iterator == _Flat->Last) + return NULL; + else + return (*_Iterator++); + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +TypePtr SharedList<Type, AllocatorType>::End() +{ + + if (_Flat->_size() == 0) + return NULL; + + _Iterator = _Flat->Last - 1; + return *_Iterator; + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +TypePtr SharedList<Type, AllocatorType>::Previous() +{ + + if (_Flat->_size() == 0) + return NULL; + else if (_Iterator == _Flat->First - 1) + return NULL; + else + return (*_Iterator--); + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)()) { + + if (_Flat->_size() == 0) + return; + + for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) { + (*begin->*MethodPtr)(); + } + +} + +///////////////////////////////////////////////////////////// + +template < typename Type, typename AllocatorType> +template < typename _A > +void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A), _A _1) { + + if (_Flat->_size() == 0) + return; + + for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) { + (*begin->*MethodPtr)(_1); + } + +} + +///////////////////////////////////////////////////////////// + +template < typename Type, typename AllocatorType> +template < typename _A, typename _B> +void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B), _A _1, _B _2) { + + if (_Flat->_size() == 0) + return; + + for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) + (*begin->*MethodPtr)(_1, _2); + +} + +///////////////////////////////////////////////////////////// + +template < typename Type, typename AllocatorType> +template <typename _A, typename _B, typename _C> +void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C), _A _1, _B _2, _C _3) +{ + + if (_Flat->_size() == 0) + return; + + for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) + (*begin->*MethodPtr)(_1, _2, _3); + +} + +///////////////////////////////////////////////////////////// + +template < typename Type, typename AllocatorType> +template <typename _A, typename _B, typename _C, typename _D> +void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4) +{ + + if (_Flat->_size() == 0) + return; + + for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) + (*begin->*MethodPtr)(_1, _2, _3, _4); + +} + +///////////////////////////////////////////////////////////// + +template < typename Type, typename AllocatorType> +template <typename _A, typename _B, typename _C, typename _D, typename _E> +void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5) { + + if (_Flat->_size() == 0) + return; + + for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) + (*begin->*MethodPtr)(_1, _2, _3, _4, _5); + +} + +///////////////////////////////////////////////////////////// + +template < typename Type, typename AllocatorType> +template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F> +void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5, _F _6) +{ + + if (_Flat->_size() == 0) + return; + + for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) + (*begin->*MethodPtr)(_1, _2, _3, _4, _5, _6); + +} + +///////////////////////////////////////////////////////////// + +template < typename Type, typename AllocatorType> +template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F, typename _G> +void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5, _F _6, _G _7) +{ + + if (_Flat->_size() == 0) + return; + + for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) + (*begin->*MethodPtr)(_1, _2, _3, _4, _5, _6, _7); + +} + +///////////////////////////////////////////////////////////// + +template < typename Type, typename AllocatorType> +template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F, typename _G, typename _H> +void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5, _F _6, _G _7, _H _8) +{ + + if (_Flat->_size() == 0) + return; + + for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) + (*begin->*MethodPtr)(_1, _2, _3, _4, _5, _6, _7, _8); + +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +unsigned int SharedList<Type, AllocatorType>::getUsageCount() const +{ + return *_Usage; +} + +///////////////////////////////////////////////////////////// + +template < class Type, class AllocatorType > +Flat<Type*, AllocatorType>* SharedList<Type, AllocatorType>::getFlat() const { + return _Flat; +} + +///////////////////////////////////////////////////////////// + +#undef SharedListType +#undef TypePtr + +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_END + + +#endif \ No newline at end of file Modified: trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.h 2008-06-17 04:38:24 UTC (rev 596) +++ trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.h 2008-06-20 06:54:10 UTC (rev 597) @@ -48,6 +48,18 @@ #define BETAJAEN_CC_TEMPLATE_CLASS_EXPORT __forceinline // #define BETAJAEN_CC_FUNCTION_EXPORT NxPublicFunction + +/** \brief Delete macro. Used if you have your own leak checker, etc. +*/ +// #define BETAJAEN_CC_DELETE(ptr) \ +// {::NxOgre::Allocator::getPtr()->watch_delete(static_cast<void*>(ptr));}; \ +// delete ptr; + +// /** \brief Called just before when a class is destroyed using it's destructor. +// */ +// #define BETAJAEN_CC_DESTRUCTOR(ptr) \ +// ::NxOgre::Allocator::getPtr()->watch_delete(begin); + ////////////////////////////////////////////////////////////////////////// #if (BETAJAEN_CC_DEBUG_COMMENTS == 1) @@ -73,11 +85,9 @@ #endif #if (_MSC_VER>=1000) -# define BETAJAEN_CC_INLINE -// __forceinline +# define BETAJAEN_CC_INLINE __forceinline #else -# define BETAJAEN_CC_INLINE -//inline +# define BETAJAEN_CC_INLINE inline #endif #ifndef BETAJAEN_CC_CLASS_EXPORT @@ -92,15 +102,24 @@ # define BETAJAEN_CC_FUNCTION_EXPORT #endif +#ifndef BETAJAEN_CC_DELETE +# define BETAJAEN_CC_DELETE(ptr) delete ptr; +#endif + +#ifndef BETAJAEN_CC_DESTRUCTOR +# define BETAJAEN_CC_DESTRUCTOR(ptr) +#endif + BETAJAEN_CC_NAMESPACE_END ////////////////////////////////////////////////////////////////////////// BETAJAEN_CC_NAMESPACE_START + class SharedAllocator; - template <class TypePtr, class AllocatorType = SharedAllocator> class Flat; +template <class BaseType, class AllocatorType = SharedAllocator> class Array; template <class BaseType, class AllocatorType = SharedAllocator> class SharedList; template <typename IdentifierType, class BaseType, class AllocatorType = SharedAllocator> class SharedMap; template <typename IdentifierType, class TypePtr> class Tree; @@ -264,9 +283,7 @@ BETAJAEN_CC_INLINE void _delete_range(Iterator begin, Iterator end) { for (; begin != end; ++begin) { - {::NxOgre::Allocator::getPtr()->watch_delete(static_cast<void*>(*begin));}; - delete *begin; - /** NxOgre Remove*/ // delete *begin; + BETAJAEN_CC_DELETE(*begin); } } @@ -275,15 +292,15 @@ BETAJAEN_CC_INLINE void _destroy(Iterator begin, Iterator end) { for (; begin != end; ++begin) { - /** NxOgre */ ::NxOgre::Allocator::getPtr()->watch_delete(begin); + BETAJAEN_CC_DESTRUCTOR(begin) begin->~Type(); } } ///////////////////////////////////////////////////////////// -private: AllocatorPtr Allocator; -private: bool AutoDeleteAllocator; +protected: AllocatorPtr Allocator; +protected: bool AutoDeleteAllocator; public: Iterator First, Last, End; }; // End of Flat<Type,AllocatorType> class. @@ -294,6 +311,68 @@ BETAJAEN_CC_NAMESPACE_START +template + < + class Type, /* Class to Store; A, myClassName, etc. */ + class AllocatorType /* Allocator to use, or leave blank for SharedAllocator */ + > +class BETAJAEN_CC_CLASS_EXPORT Array { + +public: + +typedef Type* TypePtr; +typedef Array<Type, AllocatorType> ArrayType; +typedef Flat<Type, AllocatorType> FlatType; +typedef FlatType* FlatPtr; + +BETAJAEN_CC_INLINE Array(AllocatorType* _allocator = NULL, bool _auto_delete_allocator = true) +{ + if (_allocator == NULL) + _allocator = new AllocatorType(); + + _Flat = new FlatType(_allocator, _auto_delete_allocator); + +} + +BETAJAEN_CC_INLINE ~Array() +{ + delete _Flat; +} + +BETAJAEN_CC_INLINE TypePtr getPtr() +{ + return _Flat->First; +} + +BETAJAEN_CC_INLINE unsigned int Size() +{ + return _Flat->_size(); +} + +BETAJAEN_CC_INLINE void Append(Type v) { + + if (_Flat->End <= _Flat->Last) + _Flat->_reserve( (1 + _Flat->_size()) * 2); + + *_Flat->Last = v; + _Flat->Last++; + +} + +BETAJAEN_CC_INLINE void Clip() { + _Flat->_clip(0); +} + +private: FlatPtr _Flat; + +}; + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_START + /** \brief A list of pointers with garbage collections and the ability to share the same list with similar lists. Like STL's Vector. @@ -616,7 +695,21 @@ } +// \brief Destroys everything +// +BETAJAEN_CC_INLINE void RemoveAll() +{ + if (Size() == 0) + return; + _Flat->_deallocate(_Flat->First); + + // Could be iffy. + _Flat->Last = _Flat->First; + +} + + /** \brief Places the Iterator at the beginning of the List */ BETAJAEN_CC_INLINE TypePtr Begin() @@ -869,6 +962,13 @@ }; +class BETAJAEN_CC_CLASS_EXPORT NodeIterator +{ +public: + NodePtr _Up[50]; + NodePtr _It; + int _Top; +}; /** \brief Tree constructor */ @@ -884,11 +984,16 @@ { } +public: BETAJAEN_CC_INLINE bool isEmpty() const { + return (_Root == 0); +} /** \brief Destroys all the nodes in the tree and deletes all of the values referenced in it. */ public: BETAJAEN_CC_INLINE void DestroyAll() { + if (_Root == NULL) + return; NodePtr iterator = _Root; NodePtr save = 0; @@ -911,6 +1016,7 @@ iterator = save; } + _Root = NULL; } @@ -918,6 +1024,10 @@ */ public: BETAJAEN_CC_INLINE void RemoveAll() { + + if (_Root == NULL) + return; + NodePtr iterator = _Root; NodePtr save = 0; @@ -933,11 +1043,14 @@ { save = iterator->_Children[1]; delete iterator; + iterator = NULL; } iterator = save; } + _Root = NULL; + } @@ -1011,9 +1124,68 @@ return 0; } +/** +*/ +public: BETAJAEN_CC_INLINE TypePtr First(NodeIterator* it) +{ + it->_It = _Root; + it->_Top = 0; + + if (it->_It != 0) { + while (it->_It->_Children[0] != 0) { + it->_Up[it->_Top++] = it->_It; + it->_It = it->_It->_Children[0]; + } + } + + if (it->_It != 0) + return it->_It->_Val; + else + return 0; + +} + /** */ +public: BETAJAEN_CC_INLINE TypePtr Next(NodeIterator* it) +{ + if (it->_It->_Children[1] != 0) { + it->_Up[it->_Top++] = it->_It; + it->_It = it->_It->_Children[1]; + + while (it->_It->_Children[0] != 0) { + it->_Up[it->_Top++] = it->_It; + it->_It = it->_It->_Children[0]; + } + + } + else { + NodePtr last; + + do { + + if (it->_Top == 0) { + it->_It = 0; + break; + } + + last = it->_It; + it->_It = it->_Up[--it->_Top]; + + } while (last == it->_It->_Children[1]); + + } + + if (it->_It != 0) + return it->_It->_Val; + else + return 0; + +} + +/** +*/ public: BETAJAEN_CC_INLINE bool Insert(NodeIdentifier target, TypePtr val) { Node* node = new Node(target, val); @@ -1051,6 +1223,7 @@ return true; } + private: NodePtr _Root; }; @@ -1116,11 +1289,1272 @@ BETAJAEN_CC_INLINE void DestroyAll() { + _Tree->DestroyAll(); +} +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_INLINE void RemoveAll() { + _Tree->RemoveAll(); } ///////////////////////////////////////////////////////////// +BETAJAEN_CC_INLINE void Destroy(IdentifierType); + +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_INLINE void Remove(IdentifierType); + +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_INLINE TypePtr Begin(); + +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_INLINE TypePtr Next(); + +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_INLINE TypePtr End(); + +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_INLINE TypePtr Previous(); + +///////////////////////////////////////////////////////////// + +/** \brief For each item in the list call it's own method. +*/ +BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)()) { + + if (_Tree->isEmpty()) + return; + + typename TreeType::NodeIterator iterator; + TypePtr ptr = _Tree->First(&iterator); + + while (ptr != 0) { + (ptr->*MethodPtr)(); + ptr = _Tree->Next(&iterator); + } +} + + +/** \brief For each item in the list call it's own method, with one argument. +*/ +template <typename _A> +BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A), _A _1) { + + if (_Tree->isEmpty()) + return; + + typename TreeType::NodeIterator iterator; + TypePtr ptr = _Tree->First(&iterator); + + while (ptr != 0) { + (ptr->*MethodPtr)(_1); + ptr = _Tree->Next(&iterator); + } +} +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_INLINE TreePtr getTree() const +{ + return _Tree; +} + +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_INLINE unsigned int getUsage() const +{ + return *_Usage; +} + +///////////////////////////////////////////////////////////// + +private: TreePtr _Tree; +private: unsigned int* _Usage; + +///////////////////////////////////////////////////////////// + +}; + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_START + +/** \brief Vector with two rows. +*/ +template < + typename Type + > +class BETAJAEN_CC_CLASS_EXPORT Vector2 +{ + +public: + +typedef Vector2<Type> ThisType; + +/* \brief First */ +Type i; + +/* \brief Second */ +Type j; + +BETAJAEN_CC_INLINE Vector2() +{ +} + +BETAJAEN_CC_INLINE Vector2(Type _i, Type _j) +: i(_i), j(_j) +{ +} + +BETAJAEN_CC_INLINE void swap(ThisType& other) +{ + Type First = i, Second = j; + i = other.i; other.i = First; + j = other.j; other.j = Second; +} + +BETAJAEN_CC_INLINE ThisType& operator = (const ThisType& other) +{ + i = other.i; j = other.j; + return *this; +} + +BETAJAEN_CC_INLINE ThisType& operator = (const Type& other) +{ + i = other; j = other; + return *this; +} + +BETAJAEN_CC_INLINE ThisType& operator *= (const Type& other) +{ + i *= other; j *= other; +} + +BETAJAEN_CC_INLINE ThisType& operator *= (const ThisType& other) +{ + i *= other.i; j *= other.j; +} + +BETAJAEN_CC_INLINE bool operator == (const ThisType& other) const +{ + return (i == other.i && j == other.j); +} + +BETAJAEN_CC_INLINE bool operator != (const ThisType& other) const +{ + return (i != other.i || j != other.j); +} + +}; + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_START + +/** \brief Vector with three rows. +*/ +template < + typename Type + > +class BETAJAEN_CC_CLASS_EXPORT Vector3 +{ + +public: + +typedef Vector3<Type> ThisType; + +/* \brief First */ +Type i; + +/* \brief Second */ +Type j; + +/* \brief Third */ +Type k; + + +BETAJAEN_CC_INLINE Vector3() +{ +} + +BETAJAEN_CC_INLINE Vector3(Type _i, Type _j, Type _k) +: i(_i), j(_j), k(_k) +{ +} + +BETAJAEN_CC_INLINE void swap(ThisType& other) +{ + Type First = i, Second = j, Third = k; + i = other.i; other.i = First; + j = other.j; other.j = Second; + k = other.k; other.k = Third; +} + +BETAJAEN_CC_INLINE ThisType& operator = (const ThisType& other) +{ + i = other.i; j = other.j; k = other.k; + return *this; +} + +BETAJAEN_CC_INLINE ThisType& operator = (const Type& other) +{ + i = other; j = other; k = other; + return *this; +} + +BETAJAEN_CC_INLINE ThisType& operator *= (const Type& other) +{ + i *= other; j *= other; k *= other; +} + +BETAJAEN_CC_INLINE ThisType& operator *= (const ThisType& other) +{ + i *= other.i; j *= other.j; k *= other.k; +} + +BETAJAEN_CC_INLINE bool operator == (const ThisType& other) const +{ + return (i == other.i && j == other.j && k == other.k); +} + +BETAJAEN_CC_INLINE bool operator != (const ThisType& other) const +{ + return (i != other.i || j != other.j || k != other.k); +} + +}; + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_START + +/** \brief Vector with four rows. +*/ +template < + typename Type + > +class BETAJAEN_CC_CLASS_EXPORT Vector4 { + +public: + +typedef Vector4<Type> ThisType; + +/* \brief First */ +Type i; + +/* \brief Second */ +Type j; + +/* \brief Third */ +Type k; + +/* \brief Fourth */ +Type l; + +BETAJAEN_CC_INLINE Vector4() +{ +} + +BETAJAEN_CC_INLINE Vector4(Type _i, Type _j, Type _k, Type _l) +: i(_i), j(_j), k(_k), l(_l) +{ +} + +BETAJAEN_CC_INLINE void swap(ThisType& other) +{ + Type First = i, Second = j, Third = k, Fourth = l; + i = other.i; other.i = First; + j = other.j; other.j = Second; + k = other.k; other.k = Third; + l = other.l; other.l = Fourth; +} + +BETAJAEN_CC_INLINE ThisType& operator = (const ThisType& other) { + i = other.i; j = other.j; k = other.k; l = other.l; + return *this; +} + +BETAJAEN_CC_INLINE ThisType& operator *= (const Type& other) +{ + i *= other; j *= other; k *= other; l *= other; +} + +BETAJAEN_CC_INLINE ThisType& operator *= (const ThisType& other) +{ + i *= other.i; j *= other.j; k *= other.k; l *= other.l; +} + +BETAJAEN_CC_INLINE bool operator == (const ThisType& other) const { + return (i == other.i && j == other.j && k == other.k && l == other.l); +} + +BETAJAEN_CC_INLINE bool operator != (const ThisType& other) const { + return (i != other.i || j != other.j || k != other.k || l != other.l); +} + +}; + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_START + +template <typename Type> +class BETAJAEN_CC_CLASS_EXPORT Vector { + + public: + typedef Type* TypePtr; + + TypePtr j; + unsigned int jSize; + + Vector(unsigned int j_size) + { + + } + + ~Vector() + { + + } + +}; + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +#if 0 +BETAJAEN_CC_NAMESPACE_START + +template <typename Type> +class BETAJAEN_CC_TEMPLATE_CLASS_EXPORT Matrix { + +public: + typedef Type* TypePtr; + + TypePtr ij; + unsigned int iSize, + jSize; + + class MatrixIterator { + public: + + enum IteratorRole { + IR_COLUMN, + IR_ROW + }; + + MatrixIterator(Matrix* _matrix, IteratorRole _role, unsigned int _iterator = 0) + mMatrix(_matrix), mRole(_role), mIterator(_iterator) + { + } + + Matrix* mMatrix; + IteratorRole mRole; + unsigned int mIterator; + + }; + + class RowIterator { + public: + RowIterator(TypePtr ijPtr, unsigned int row, unsigned int i_size, unsigned j_size) + : ij(ijPtr), r(row), iSize(i_size), jSize(j_size) + { + } + + Type& operator[] (unsigned int column) + { + return ij[(column * iSize) + r]; + } + + + RowIterator& operator=(Type _f) { + + // Doesn't work. + for (unsigned int i=r * iSize;i < (r * iSize) + iSize;i++) { + printf("i=%i\n", i); + ij[i] = _f; + } + printf("Done.\n"); + return *this; + } + + TypePtr ij; + unsigned int r, iSize, jSize; + + }; + + class ColumnIterator { + + public: + + ColumnIterator(TypePtr ijPtr, unsigned int col, unsigned int i_size, unsigned j_size) + : ij(ijPtr), c(col), iSize(i_size), jSize(j_size) + { + } + + Type& operator[] (unsigned int row) + { + if (row > i_size) + row = i_size; + + return ij[(c * iSize) + row]; + } + + + ColumnIterator& operator=(Type _f) { + for (unsigned int i=c;i < c + jSize;i++) { + printf("i=%i\n", i); + ij[i] = _f; + } + printf("Done.\n"); + return *this; + } + + TypePtr ij; + unsigned int c, iSize, jSize; + }; + + class All { + public: + + All() + { + } + + All(TypePtr ijPtr, unsigned int i_size, unsigned int j_size) + : ij(ijPtr), iSize(i_size), jSize(j_size) + { + } + + All& operator=(Type _f) { + for (unsigned int i=0;i < iSize;i++) + for (unsigned int j=0;j < jSize;j++) + ij[(j * jSize) + i] = _f; + return *this; + } + + All& operator*=(Type _f) { + for (unsigned int i=0;i < iSize;i++) + for (unsigned int j=0;j < jSize;j++) + ij[(j * jSize) + i] *= _f; + return *this; + } + + All& operator/=(Type _f) { + for (unsigned int i=0;i < iSize;i++) + for (unsigned int j=0;j < jSize;j++) + ij[(j * jSize) + i] /= _f; + return *this; + } + + All& operator+=(Type _f) { + for (unsigned int i=0;i < iSize;i++) + for (unsigned int j=0;j < jSize;j++) + ij[(j * jSize) + i] += _f; + return *this; + } + + All& operator-=(Type _f) { + for (unsigned int i=0;i < iSize;i++) + for (unsigned int j=0;j < jSize;j++) + ij[(j * jSize) + i] -= _f; + return *this; + } + + All& operator++(int) { + for (unsigned int i=0;i < iSize;i++) + for (unsigned int j=0;j < jSize;j++) + ij[(j * jSize) + i]++; + return *this; + } + + + TypePtr ij; + unsigned iSize, jSize; + }; + + All all; + +Matrix(unsigned int nbRows, unsigned int nbColumns) +: iSize(nbRows), jSize(nbColumns) +{ + ij = new Type[iSize * jSize]; + for (unsigned int i = 0;i < (iSize * jSize);i++) + ij[i] = 0; + + all = All(ij, iSize, jSize); + + BETAJAEN_CC_PRINTF("Matrix created with %i", nbColumns); +} + +~Matrix() +{ + if (iSize || jSize) + delete [] ij; +} + +RowIterator operator[] (unsigned int row) +{ + return RowIterator(ij, row, iSize, jSize); +} + +ColumnIterator operator() (unsigned col) +{ + return ColumnIterator(ij, col, iSize, jSize); +} + +void dump() +{ + for (unsigned int i=0;i < iSize;i++) { + for (unsigned int j=0;j < jSize;j++) { + printf("%f\t", ij[(j * jSize) + i]); + } + printf("\n"); + } + +} + +}; +BETAJAEN_CC_NAMESPACE_END +#endif + +////////////////////////////////////////////////////////////////////////// + +#endif + + +#if 0 +/* + +Betajaen's Container Classes + +Copyright (c) 2007 Robin Southern, http://www.nxogre.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +*/ + +#ifndef BETAJAENS_CC_H +#define BETAJAENS_CC_H + +#include "NxOgrePlatform.h" +#include "NxOgreAllocator.h" + +// Configuration + +/** \brief Namespace to place the Containers in. Comment out if you want it in the global namespace. +*/ +#define BETAJAEN_CC_NAMESPACE Betajaen + + +/** \brief Enable debug comments. Set to zero to disable, 1 to enable +*/ +#define BETAJAEN_CC_DEBUG_COMMENTS 1 + + +/** \brief Export Class Macro, replace value with your export macro +*/ +#define BETAJAEN_CC_CLASS_EXPORT __declspec(dllexport) +#define BETAJAEN_CC_TEMPLATE_CLASS_EXPORT __forceinline +// #define BETAJAEN_CC_FUNCTION_EXPORT NxPublicFunction + + +/** \brief Delete macro. Used if you have your own leak checker, etc. +*/ +#define BETAJAEN_CC_DELETE(ptr) \ + {::NxOgre::Allocator::getPtr()->watch_delete(static_cast<void*>(ptr));}; \ + delete ptr; + +/** \brief Called just before when a class is destroyed using it's destructor. +*/ +#define BETAJAEN_CC_DESTRUCTOR(ptr) \ + ::NxOgre::Allocator::getPtr()->watch_delete(begin); + +////////////////////////////////////////////////////////////////////////// + +#if (BETAJAEN_CC_DEBUG_COMMENTS == 1) +# include <stdio.h> +#endif + +#ifdef BETAJAEN_CC_NAMESPACE +# define BETAJAEN_CC_NAMESPACE_START namespace BETAJAEN_CC_NAMESPACE { +# define BETAJAEN_CC_NAMESPACE_END } +#else +# define BETAJAEN_CC_NAMESPACE_START /**/ +# define BETAJAEN_CC_NAMESPACE_END /**/ +#endif + +BETAJAEN_CC_NAMESPACE_START + +#if (BETAJAEN_CC_DEBUG_COMMENTS == 1) +# define BETAJAEN_CC_PRINT(x) printf(x "\n"); +# define BETAJAEN_CC_PRINTF(x, y) printf(x "\n",y); +#else +# define BETAJAEN_CC_PRINT(x) /* x */ +# define BETAJAEN_CC_PRINTF(x,y) /* x, y*/ +#endif + +#if (_MSC_VER>=1000) +# define BETAJAEN_CC_INLINE __forceinline +#else +# define BETAJAEN_CC_INLINE inline +#endif + +#ifndef BETAJAEN_CC_CLASS_EXPORT +# define BETAJAEN_CC_CLASS_EXPORT +#endif + +#ifndef BETAJAEN_CC_TEMPLATE_CLASS_EXPORT +# define BETAJAEN_CC_TEMPLATE_CLASS_EXPORT +#endif + +#ifndef BETAJAEN_CC_FUNCTION_EXPORT +# define BETAJAEN_CC_FUNCTION_EXPORT +#endif + +#ifndef BETAJAEN_CC_DELETE +# define BETAJAEN_CC_DELETE(ptr) delete ptr; +#endif + +#ifndef BETAJAEN_CC_DESTRUCTOR +# define BETAJAEN_CC_DESTRUCTOR(ptr) +#endif + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_START + +template <class TypePtr, class AllocatorType = SharedAllocator> class Flat; +class SharedAllocator; +template <class BaseType, class AllocatorType = SharedAllocator> class SharedList; +template <typename IdentifierType, class BaseType, class AllocatorType = SharedAllocator> class SharedMap; +template <typename IdentifierType, class TypePtr> class Tree; +template <typename> class Vector2; +template <typename> class Vector3; +template <typename> class Vector4; + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_START + +class BETAJAEN_CC_CLASS_EXPORT SharedAllocator { + +public: + +///////////////////////////////////////////////////////////// + +void* Allocate(size_t size) +{ + return malloc(size); +} + +///////////////////////////////////////////////////////////// + +void Deallocate(void* mem) +{ + if (mem) + free(mem); +} + +///////////////////////////////////////////////////////////// + +void* Reallocate(void* mem, size_t size) +{ + return realloc(mem, size); +} + +///////////////////////////////////////////////////////////// + +}; // End of the SharedAllocator class. + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_START + +template + < + class Type, + class AllocatorType + > +class BETAJAEN_CC_CLASS_EXPORT Flat +{ + +public: + +typedef Type * Iterator; +typedef AllocatorType* AllocatorPtr; + +BETAJAEN_CC_INLINE Flat(AllocatorPtr allocator, bool deleteAllocator); +BETAJAEN_CC_INLINE ~Flat(); +BETAJAEN_CC_INLINE unsigned int _size() const; +BETAJAEN_CC_INLINE unsigned int _capacity() const; +BETAJAEN_CC_INLINE Type* _allocate(unsigned int size); +BETAJAEN_CC_INLINE void _deallocate(Type* p); +BETAJAEN_CC_INLINE Iterator _reallocate(Iterator p, unsigned int size); +BETAJAEN_CC_INLINE void _clip(unsigned int size); +BETAJAEN_CC_INLINE void _reserve(unsigned int new_size); +BETAJAEN_CC_INLINE Iterator _copy(Iterator begin, Iterator end, Iterator dest); +BETAJAEN_CC_INLINE void _delete_range(Iterator begin, Iterator end); +BETAJAEN_CC_INLINE void _destroy(Iterator begin, Iterator end); + +private: AllocatorPtr Allocator; +private: bool AutoDeleteAllocator; +public: Iterator First, Last, End; + +}; // End of Flat<Type,AllocatorType> class. + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_START + +/** \brief A list of pointers with garbage collections and the ability to + share the same list with similar lists. Like STL's Vector. + + \example + <code> + class A; + + SharedList<A> aList; + a.Insert(new A()); + a.Remove(a.Last); + </code> + +*/ +template + < + class Type, /* Class to Store; A, myClassName, etc. */ + class AllocatorType /* Allocator to use, or leave blank for SharedAllocator */ + > +class BETAJAEN_CC_CLASS_EXPORT SharedList { + +public: + +typedef Type* TypePtr; +typedef TypePtr* Iterator; +typedef SharedList<Type, AllocatorType> SharedListType; +typedef Flat<TypePtr, AllocatorType> FlatType; +typedef FlatType* FlatPtr; + +///////////////////////////////////////////////////////////// + +enum AbsolutePosition +{ + First, + Last +}; + +/** + Constructor with optional custom allocator +*/ +BETAJAEN_CC_INLINE SharedList(AllocatorType* _allocator = NULL, bool _auto_delete_allocator = true); + +/** \brief Copy Constructor between SharedList's. The Flat will not be copied but referenced. + Any action on this list will effect all lists using the same Flat. Clean up will only + happen on the destruction of the last surviving list. + + \example + <code> + typedef SharedList<A> AList; + AList a; + AList b(a); + </code> +*/ +BETAJAEN_CC_INLINE SharedList(const SharedListType& other); + +/** \brief Copy Operator. Functions the same as Copy Constructor but deletes the set that this + may already have. + + \example + <code> + typedef SharedList<A> AList; + AList a; + AList b; + b = a; + </code> +*/ +BETAJAEN_CC_INLINE SharedListType& operator=(const SharedListType& other); + + +/** \brief Destructor. If this is the last of all SharedLists sharing the same set, + the set will be destroyed otherwise the Flat will be ignored and this SharedList + dies gracefully. +*/ +BETAJAEN_CC_INLINE ~SharedList() { + + if (--(*_Usage) == 0) + { + _Flat->_delete_range(_Flat->First, _Flat->Last); + delete _Flat; + delete _Usage; + } + +} + +/** \brief Gets the pointer to the nth Type in the list. Alternate interface to operator[]. +*/ +BETAJAEN_CC_INLINE TypePtr Get(size_t pos); + +/** \brief Gets the pointer to the nth TypePtr in the list. +*/ +BETAJAEN_CC_INLINE TypePtr operator[](size_t pos); + +/** \brief Where is something in the list. +*/ +BETAJAEN_CC_INLINE unsigned int WhereIs(TypePtr ptr); + +/** \brief Is this pointer in the list? +*/ +BETAJAEN_CC_INLINE bool Has(TypePtr ptr); + +/** \brief The size of the SharedList. +*/ +BETAJAEN_CC_INLINE unsigned Size() const; + +/** \brief Insert something into the list +*/ +BETAJAEN_CC_INLINE void Insert(const TypePtr& val); + +/** \brief Resize the capacity of the list to size + n. +*/ +BETAJAEN_CC_INLINE void Clean(unsigned int n = 4); + +/** \brief Destroy something nth position into the list. +*/ +BETAJAEN_CC_INLINE void Destroy(unsigned int n); + +// \brief Destroys everything +// +BETAJAEN_CC_INLINE void DestroyAll(); + +/** \brief Destroys something in the list based on the pointer in the list. +*/ +BETAJAEN_CC_INLINE void Destroy(TypePtr val); + +/** \brief Deletes something from the list based on AbsolutePosition +*/ +BETAJAEN_CC_INLINE void Destroy(AbsolutePosition position); + +/** \brief Removes something from the list based on numerical position. +*/ +BETAJAEN_CC_INLINE TypePtr Remove(unsigned int n); + +/** \brief Removes something from the list based on AbsolutePosition +*/ +BETAJAEN_CC_INLINE TypePtr Remove(AbsolutePosition position); + +/** \brief Places the Iterator at the beginning of the List +*/ +BETAJAEN_CC_INLINE TypePtr Begin(); + +/** \brief Advances the Iterator forward by one, and returns the value of the list or NULL + \returns The next item in the list, or NULL if it has reached the end of it. +*/ +BETAJAEN_CC_INLINE TypePtr Next(); + +/** \brief Places the iterator at the end of the List +*/ +BETAJAEN_CC_INLINE TypePtr End(); + +/** \brief Advances the Iterator backwards by one, and returns the value of the list or NULL + \returns The previous item in the list, or NULL if it has reached the beginning of it. +*/ +BETAJAEN_CC_INLINE TypePtr Previous(); + +/** \brief For each item in the list call it's own method. +*/ +BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)()); + +/** \brief For each item in the list call it's own method, with one argument. +*/ +template <typename _A> +BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A), _A); + +/** \brief For each item in the list call it's own method, with two arguments. +*/ +template <typename _A, typename _B> +BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B), _A, _B); + +/** \brief For each item in the list call it's own method, with three arguments. +*/ +template <typename _A, typename _B, typename _C> +BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C), _A, _B, _C); + +/** \brief For each item in the list call it's own method, with four arguments. +*/ +template <typename _A, typename _B, typename _C, typename _D> +BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A, _B, _C, _D); + +/** \brief For each item in the list call it's own method, with five arguments. +*/ +template <typename _A, typename _B, typename _C, typename _D, typename _E> +BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A, _B, _C, _D, _E); + +/** \brief For each item in the list call it's own method, with six arguments. +*/ +template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F> +BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A, _B, _C, _D, _E, _F); + +/** \brief For each item in the list call it's own method, with seven arguments. +*/ +template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F, typename _G> +BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A, _B, _C, _D, _E, _F, _G); + +/** \brief For each item in the list call it's own method, with eight arguments. +*/ +template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F, typename _G, typename _H> +BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A, _B, _C, _D, _E, _F, _G, _H); + +/** \brief Returns the pointer to the working set. +*/ +BETAJAEN_CC_INLINE FlatPtr getFlat() const; + +/** \brief Returns the number of SharedLists using this set. +*/ +BETAJAEN_CC_INLINE unsigned int getUsageCount() const; + +private: unsigned int* _Usage; +private: FlatPtr _Flat; +private: Iterator _Iterator; + +}; // End of SharedList<Type, AllocatorType> Class. + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_START + + +/** \brief Binary Tree with variable identifer and storage type. + +*/ +template <typename NodeIdentifier, class Type> +class BETAJAEN_CC_CLASS_EXPORT Tree +{ + // Much of this Tree was from the excellent tutorial by Julienne Walker + // http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_bst1.aspx + +public: + +class Node; +typedef Node* NodePtr; +typedef Type* TypePtr; + +/** \brief A tree is made up of nodes. +*/ +class BETAJAEN_CC_CLASS_EXPORT Node +{ + +public: + +Node(NodeIdentifier id, TypePtr val) : _ID(id), _Val(val) +{ + _Children[0] = NULL; + _Children[1] = NULL; +} + +void Replace(Node* n) +{ + _ID = n->_ID; + _Val = n->_Val; +} + +NodeIdentifier _ID; +TypePtr _Val; +NodePtr _Children[2]; + +}; + + +/** \brief Tree constructor +*/ +public: BETAJAEN_CC_INLINE Tree() : _Root(NULL) +{ +} + + +/** \brief Tree destructor. + \note Does not remove or destroy the contents of the tree. +*/ +public: BETAJAEN_CC_INLINE ~Tree() +{ +} + + +/** \brief Destroys all the nodes in the tree and deletes all of the values referenced in it. +*/ +public: BETAJAEN_CC_INLINE void DestroyAll() +{ + + NodePtr iterator = _Root; + NodePtr save = 0; + + while (iterator != NULL) + { + if (iterator->_Children[0] != NULL) + { + save = iterator->_Children[0]; + iterator->_Children[0] = save->_Children[1]; + save->_Children[1] = iterator; + } + else + { + save = iterator->_Children[1]; + delete iterator->_Val; + delete iterator; + } + + iterator = save; + } + +} + + +/** \brief Destroys all the nodes in the tree, but not all of the values referenced in it. +*/ +public: BETAJAEN_CC_INLINE void RemoveAll() +{ + NodePtr iterator = _Root; + NodePtr save = 0; + + while (iterator != NULL) + { + if (iterator->_Children[0] != NULL) + { + save = iterator->_Children[0]; + iterator->_Children[0] = save->_Children[1]; + save->_Children[1] = iterator; + } + else + { + save = iterator->_Children[1]; + delete iterator; + } + + iterator = save; + } + +} + + +/** \brief Remove a Node based of an identifier +*/ +public: BETAJAEN_CC_INLINE void Remove(NodeIdentifier id) +{ + + if (_Root == NULL) + return; + + Node head = {0}; + NodePtr iterator = &head; + NodePtr *f = 0, *p = 0; + int direction = 1; + + iterator->_Children[1] = _Root; + + //while (iterator = + +} + + + +/** \brief Removes a ranges of nodes based on max. and min. identifiers. + \note This operates based on the "operator <" of the TypeIdentifier the class, + which defines if the type is in the range or not. Types such as ints, or reals + aren't a problem but things like strings or complicated classes may produce + strange results. +*/ +public: BETAJAEN_CC_INLINE void RemoveRange(NodeIdentifier id_min, NodeIdentifier id_max) +{ + + +} + + +/** +*/ +public: BETAJAEN_CC_INLINE void Destroy(NodeIdentifier id) +{ + +} + + +/** +*/ +public: BETAJAEN_CC_INLINE void DestroyRange(NodeIdentifier id_min, NodeIdentifier id_max) +{ + +} + + +/** +*/ +public: BETAJAEN_CC_INLINE TypePtr Find(NodeIdentifier target) +{ + NodePtr iterator = _Root; + while (iterator != NULL) + { + if (iterator->_ID == target) + { + return iterator->_Val; + } + else + { + iterator = iterator->_Children[int(iterator->_ID < target)]; + } + } + + return 0; +} + + +/** +*/ +public: BETAJAEN_CC_INLINE bool Insert(NodeIdentifier target, TypePtr val) +{ + Node* node = new Node(target, val); + + + if (_Root == NULL) + { + _Root = node; + return true; + } + else + { + Node* iterator = _Root; + unsigned int direction; + + for ( ; ; ) + { + direction = iterator->_ID < target; + + if (iterator->_ID == target) + { + delete node; + return false; + } + else if (iterator->_Children[direction] == NULL) + break; + + + iterator = iterator->_Children[direction]; + } + + iterator->_Children[direction] = node; + } + + return true; +} + +private: NodePtr _Root; + +}; + +BETAJAEN_CC_NAMESPACE_END + +////////////////////////////////////////////////////////////////////////// + +BETAJAEN_CC_NAMESPACE_START + +template < + typename IdentifierType, + class Type, + class AllocatorType + > +class BETAJAEN_CC_CLASS_EXPORT SharedMap +{ + +public: + +typedef Type* TypePtr; +typedef Tree<IdentifierType, Type> TreeType; +typedef TreeType* TreePtr; + + +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_INLINE SharedMap() +{ + _Tree = new TreeType(); +} + +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_INLINE ~SharedMap() +{ + _Tree->DestroyAll(); + delete _Tree; +} + +///////////////////////////////////////////////////////////// + +BETAJAEN_CC_INLINE TypePt... [truncated message content] |
From: <and...@us...> - 2008-06-22 06:25:05
|
Revision: 602 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=602&view=rev Author: andy_miller Date: 2008-06-21 23:25:12 -0700 (Sat, 21 Jun 2008) Log Message: ----------- Added missing nxogre files Added Paths: ----------- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.h trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacterSweep.h Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp 2008-06-22 06:25:12 UTC (rev 602) @@ -0,0 +1,186 @@ +/** \file NxOgreCharacter.cpp + * \see NxOgreCharacter.h + * \version 1.0-20 + * + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "NxOgreStable.h" + +#if (NX_USE_LEGACY_NXCONTROLLER == 0) + +#include "NxOgreCharacter.h" +#include "NxOgreScene.h" +#include "NxOgreNxActorController.h" +#include "NxOgreKinematicCharacter.h" + +#include "NxOgreCharacterModel.h" +#include "NxOgreCharacterMovementModel.h" + +#include "NxOgreVoidPointer.h" +#include "NxOgreTimeStep.h" + +namespace NxOgre { +namespace CharacterSystem { + +///////////////////////////////////////////////////////////// + +void CharacterParams::setToDefault() { + +#if (NX_USE_CHARACTER_API == 1) + mControllerType = CT_KINEMATIC; +#else + mControllerType = CT_NXACTOR; +#endif + + mControllerPtr = 0; + mStepOffset = 0.0f; + mSlopeLimit = 0.0f; + mUpDirection = NX_AXIS_PLUS_Y; + //mGroupMask; + mControllerCollisionShape = 0; + +} + +///////////////////////////////////////////////////////////// + +Character::Character(const NxString& identifier, Pose pose, CharacterModel* model, CharacterParams params, Scene* scene) +: mName(identifier), mModel(model), mOwner(scene), mVoidPointer(0) +{ + + if (model == 0) { + NxThrow("Character Model pointer is null!"); + mDead = true; + return; + } + + if (params.mControllerType == params.CT_PTR && params.mControllerPtr == 0) { + NxThrow("ControllerType is custom but given pointer is null!"); + mDead = true; + return; + } + + mVoidPointer = new VoidPointer(this, NxOgreClass_Character); + + // (TODO) Pass on voidpointer to controllers here. + if (params.mControllerType == CharacterParams::CT_NXACTOR) { + mController = NxNew(NxActorController)(pose, params.mControllerCollisionShape, scene, mVoidPointer); + } +#if (NX_USE_CHARACTER_API == 1) + else if (params.mControllerType == CharacterParams::CT_KINEMATIC) { + mController = NxNew(KinematicCharacter)(pose, params.mControllerCollisionShape, scene, mVoidPointer); + } +#endif + else { + mController = params.mControllerPtr; + NxWatch(CharacterController, mController); + } + + // Watch Model and set the garbage collection mode. + NxWatch(CharacterModel, mModel); + mModel->setGC(); + + // Current movement model to default. + mCurrentMovement = mModel->mDefaultMovementModel; + + // Reset all movemenet models to this. + for (CharacterMovementModel* model = mModel->mMovementModels.begin(); model = mModel->mMovementModels.next();) { + model->reset(this); + } + + mCurrentMovement->enter(0, mController->getPose()); + + mOwner->_registerCharacter(mName, this); +} + +///////////////////////////////////////////////////////////// + +Character::~Character() { + + mOwner->_unregisterCharacter(mName); + + mCurrentMovement->exit(); + + // Delete bleh bleh here. + if (mModel->mDeletionPolicy == GC_Delete) + NxDelete(mModel); + + + delete mController; + delete mVoidPointer; + +} + +///////////////////////////////////////////////////////////// + +void Character::simulate(const TimeStep& ts) { + + mCurrentMovement->simulate(ts.Delta); + + // get new movement vector + const NxVec3 movementVector = mCurrentMovement->getGlobalMovementVector(ts.Delta); + + // get controller to move that vector. + mController->move(movementVector); + + mCurrentMovement->setPose(mController->getPose()); + mCurrentMovement->simulateAfter(ts.Delta); + +} + +///////////////////////////////////////////////////////////// + +void Character::forward() { + mCurrentMovement->forward(); +} + +///////////////////////////////////////////////////////////// + +void Character::backward() { + mCurrentMovement->backward(); +} + +///////////////////////////////////////////////////////////// + +void Character::left() { + mCurrentMovement->left(); +} + +///////////////////////////////////////////////////////////// + +void Character::right() { + mCurrentMovement->right(); +} + +///////////////////////////////////////////////////////////// + +void Character::up() { + mCurrentMovement->up(); +} + +///////////////////////////////////////////////////////////// + +void Character::down() { + mCurrentMovement->down(); +} + +///////////////////////////////////////////////////////////// + +}; // End of Character namespace. +}; // End of NxOgre namespace. + +#endif Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h 2008-06-22 06:25:12 UTC (rev 602) @@ -0,0 +1,199 @@ +/** \file NxOgreCharacter.h + * \brief Header for the CharacterParams and Character classes. + * \version 1.0-20 + * + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __NXOGRE_CHARACTER_H__ +#define __NXOGRE_CHARACTER_H__ + +#include "NxOgrePrerequisites.h" + +#if (NX_USE_LEGACY_NXCONTROLLER == 0) + +#include "NxOgreParams.h" +#include "NxOgrePose.h" + +namespace NxOgre { +namespace CharacterSystem { + + + class NxPublicClass CharacterParams : public Params { + + public: + + CharacterParams() { + setToDefault(); + } + + CharacterParams(const char* p) { + process(p); + } + + CharacterParams(NxString p) { + process(p); + } + + void setToDefault(); + + enum ControllerType { +#if (NX_USE_CHARACTER_API == 1) + CT_KINEMATIC, +#endif + CT_NXACTOR, + CT_PTR + }; + + ControllerType mControllerType; + CharacterController* mControllerPtr; + + NxReal mStepOffset; + NxRadian mSlopeLimit; + NxAxisType mUpDirection; + NxGroupsMask mGroupMask; + + /** \brief Collision shape for NxActor and NxCharacter controllers. + \note The function "setToDefault" sets the pointer to zero. You + have to assign one after setting the basic params using + the new operator or the SimpleShape::createShapeFromString method + + \see Controllers for what shapes they can and cannot use + \see SimpleShape::createShapeFromString + + + */ + + SimpleShape* mControllerCollisionShape; + + + }; + + ///////////////////////////////////////////////////////// + + /** Character + + */ + class NxPublicClass Character { + + public: + + enum LocalMovementDirection { + LMD_FORWARD = 0, + LMD_BACKWARD = 1, + LMD_LEFT = 2, + LMD_RIGHT = 3, + LMB_UP = 4, + LMB_DOWN = 5 + }; + + Character(const NxString& identifier, Pose, CharacterModel*, CharacterParams, Scene*); + virtual ~Character(); + + NxString getName() const {return mName;} + + virtual void simulate(const TimeStep&); + + CharacterController* getController() const { + return mController; + } + + CharacterModel* getModel() const { + return mModel; + } + + CharacterMovementModel* getCurrentMovementModel() const { + return mCurrentMovement; + } + + void setModel(CharacterModel* newModel) { + mModel = newModel; + resetMovement(); + } + + void resetMovement() {} + void setMovement(NxString movement); + void setMovement(Ogre::Vector3 movementVector); + void setLocalMovement(Ogre::Vector3 movementVector); + + inline void forward(); + inline void backward(); + inline void left(); + inline void right(); + inline void up(); + inline void down(); + + void injectMovement(LocalMovementDirection); + void setDirection(const NxQuat& orientation); + void setDirection(const Ogre::Quaternion& orientation); + void moveTowards(Ogre::Vector3 globalPosition, NxReal force); + void setYaw(NxRadian Yaw); + void setYaw(Ogre::Radian Yaw); + void setPitch(NxRadian Pitch); + void setPitch(Ogre::Radian Pitch); + void setRoll(NxRadian Roll); + void setRoll(Ogre::Radian Roll); + + + /** \brief Forces height to a new one, without a transitional movement period. + Forces the local height of the character shape to a new one whilst moving + the character to half-height below. + + \param height Height of the character + */ + void setHeight(NxReal height); + + + /** \brief Forces height to a new one, with a transitional movement period. + Forces the local height of the character shape to a new one whilst leaving it + at the existing position. Naturaly gravity or a custom vector will kick in and + move the character into the correct new position over the upcoming frames. + + \param height Height of the character + */ + void changeHeight(NxReal height); + + void setSize(const NxVec3& size); + void setSize(const float2& size); + + void setGravityEnabled(bool); + bool isGravityEnabled(); + + bool isDead() const {return mDead;} + + protected: + + CharacterController* mController; + CharacterModel* mModel; + CharacterMovementModel* mCurrentMovement; + + NxString mName; + Scene* mOwner; + VoidPointer* mVoidPointer; + + private: + + bool mDead; + + }; + + //////////////////////////////////////////// +};// End of CharacterSystem +};// End of namespace + +#endif +#endif Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.cpp 2008-06-22 06:25:12 UTC (rev 602) @@ -0,0 +1,45 @@ +/** \file NxOgreCharacterController.cpp + * \see NxOgreCharacterController.h + * \version 1.0-20 + * + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "NxOgreStable.h" + +#include "NxOgreCharacterController.h" + +namespace NxOgre { +namespace CharacterSystem { + +//////////////////////////////////////////////////// + +CharacterController::CharacterController(Scene* scene, VoidPointer*) +: mScene(scene) { + +} + +//////////////////////////////////////////////////// + +CharacterController::~CharacterController() { + +} + +//////////////////////////////////////////////////// + +}; // End of CharacterSystem namespace. +}; // End of NxOgre namespace. Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.h (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.h 2008-06-22 06:25:12 UTC (rev 602) @@ -0,0 +1,96 @@ +/** \file NxOgreCharacterController.h + * \brief Header for the CharacterController class. + * \version 1.0-20 + * + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +#ifndef __NXOGRE_CHARACTER_CONTROLLER_H__ +#define __NXOGRE_CHARACTER_CONTROLLER_H__ + +#include "NxOgrePrerequisites.h" + +#if (NX_USE_LEGACY_NXCONTROLLER == 0) + +namespace NxOgre { +namespace CharacterSystem { + + class NxPublicClass CharacterController { + + friend class Character; + + public: + + CharacterController(Scene*, VoidPointer*); + virtual ~CharacterController(); + + virtual NxActorGroup getActorGroup() {return 0;} + virtual NxCollisionGroup getCollisionGroup() {return 0;} + + virtual void setActorGroup(NxActorGroup) {} + virtual void setCollisionGroup(NxCollisionGroup) {} + + virtual void init(NxMat34 pose) {} + + virtual void move(const NxVec3& direction) {} + + virtual void setPosition(const NxVec3& position) {} + virtual NxVec3 getPosition() const {return NxVec3(0,0,0);} + + virtual void setOrientation(const NxQuat& orientation) {} + virtual NxQuat getOrientation() const {NxQuat quat;quat.id();return quat;} + + virtual NxMat34 getPose() const {NxMat34 m;m.id();return m;} + + virtual void setSize(const NxVec3& size) {} + virtual void getSize(NxVec3& size) {} + + virtual void setSize(const float2& size) {} + virtual void getSize(float2& size) {} + + virtual void setStepSize(NxReal stepSize) {} + virtual NxReal getStepSize() const {return 0;} + + virtual void setSlopeLimit(NxRadian slopeLimit) {} + virtual NxRadian getSlopeLimit() const {return 0;} + + virtual void setGravityEnabled(bool gravity) {} + virtual bool getGravityEnabled() const {return false;} + + virtual void setUpDirection(NxVec3 upDirection) {} + virtual NxVec3 getUpDirection() const {return NxVec3(0,0,0);} + + + virtual NxString getType() { return NxString("CharacterController"); }; + + ///////////////////////////////////////////////// + + Scene* mScene; + + private: + + + }; + + //////////////////////////////////////////// + +};// End of CharacterSystem namespace. +};// End of NxOgre namespace. + +#endif +#endif Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.cpp 2008-06-22 06:25:12 UTC (rev 602) @@ -0,0 +1,26 @@ +/** \file NxOgreCharacterModel.cpp + * \see NxOgreCharacterModel.h + * \version 1.0-20 + * + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "NxOgreStable.h" + +#if (NX_USE_LEGACY_NXCONTROLLER == 0) +# include "NxOgreCharacterModel.h" +#endif Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.h (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.h 2008-06-22 06:25:12 UTC (rev 602) @@ -0,0 +1,63 @@ +/** \file NxOgreCharacterModel.h + * \brief Header for the CharacterModel class. + * \version 1.0-20 + * + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __NXOGRE_CHARACTER_MODEL_H__ +#define __NXOGRE_CHARACTER_MODEL_H__ + +#include "NxOgrePrerequisites.h" + +#if (NX_USE_LEGACY_NXCONTROLLER == 0) + +#include "NxOgreContainer.h" + +namespace NxOgre { +namespace CharacterSystem { + + class NxPublicClass CharacterModel { + + friend class Character; + + public: + + virtual ~CharacterModel() {} + + CharacterMovementModel* mDefaultMovementModel; + CharacterMovementModels mMovementModels; + + protected: + + virtual void setGC() { + mDeletionPolicy = GC_Delete; + } + + GarbageCollectionPolicy mDeletionPolicy; + + private: + + }; + + //////////////////////////////////////////// + +}; // End of CharacterSystem namespace. +}; // End of NxOgre namespace. + +#endif +#endif Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.cpp 2008-06-22 06:25:12 UTC (rev 602) @@ -0,0 +1,28 @@ +/** \file NxOgreCharacterMovementModel.cpp + * \see NxOgreCharacterMovementModel.h + * \version 1.0-20 + * + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include "NxOgreStable.h" + +#if (NX_USE_LEGACY_NXCONTROLLER == 0) + +#include "NxOgreCharacterMovementModel.h" + + +#endif Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.h (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.h 2008-06-22 06:25:12 UTC (rev 602) @@ -0,0 +1,95 @@ +/** \file NxOgreCharacterMovementModel.h + * \brief Header for the CharacterMovementModel class. + * \version 1.0-20 + * + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __NXOGRE_CHARACTER_MOVEMENT_MODEL_H__ +#define __NXOGRE_CHARACTER_MOVEMENT_MODEL_H__ + +#include "NxOgrePrerequisites.h" + +#if (NX_USE_LEGACY_NXCONTROLLER == 0) + +#include "NxOgreHelpers.h" + +namespace NxOgre { +namespace CharacterSystem { + + class NxPublicClass CharacterMovementModel { + + public: + + virtual void enter(CharacterMovementModel* from, NxMat34 pose) {mPose = pose;mMovement.zero();mOrientation.id();} + virtual NxMat34 exit() {return mPose;} + + virtual void simulate(NxReal dTime) {} + virtual void simulateAfter(NxReal dTime) {} + virtual void reset(Character* c) {mCharacter = c;}// mPose = c->getPose();} + virtual void forward() {} + virtual void backward() {} + virtual void left() {} + virtual void right() {} + virtual void up() {} + virtual void down() {} + + virtual void setYaw(NxRadian yaw) { + // mOrientation + } + + void setPose(NxMat34 pose) {mPose = pose;} + virtual void setPitch(NxRadian pitch) {} + virtual void setRoll(NxRadian roll) {} + + virtual void setOrientation(NxQuat orientation) {} + virtual NxQuat getOrientation() { NxQuat quat; + mPose.M.toQuat(quat); + return quat;} + + virtual NxString getType() {return NxString("Default");} + + virtual NxVec3 getGlobalMovementVector(NxReal dT) { + return (mOrientation * mMovement) * dT; + } + + virtual NxVec3 getMovementVector() { + return mMovement; + } + + virtual NxQuat getGlobalOrientation() { + return mOrientation; + } + + protected: + + Character* mCharacter; + NxMat34 mPose; + NxVec3 mMovement; + NxQuat mOrientation; + + private: + + }; + + //////////////////////////////////////////// + +}; // End of CharacterSystem namespace. +}; // End of NxOgre namespace. + +#endif +#endif Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.cpp 2008-06-22 06:25:12 UTC (rev 602) @@ -0,0 +1,204 @@ +/** \file NxOgreKinematicCharacter.cpp + * \see NxOgreKinematicCharacter.h + * \version 1.0-21 + * + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "NxOgreStable.h" + +#if (NX_USE_LEGACY_NXCONTROLLER == 0) + +#include "NxOgreKinematicCharacter.h" +#include "NxOgreSimpleShape.h" +#include "NxOgreVoidPointer.h" +#include "NxOgreScene.h" + +// BoxController.cpp, 42 +#define NX_KINEMATIC_CHARACTER_SHAPE_DELTA 0.8 + +namespace NxOgre { +namespace CharacterSystem { + +//////////////////////////////////////////////////// + +KinematicCharacter::KinematicCharacter(NxMat34 pose, SimpleShape* shape, Scene* scene, VoidPointer* vptr) +: CharacterController(scene, vptr), mActor(0), mUserData(0), mShapeUserData(0) +{ + NxActorDesc a_desc; + NxBodyDesc b_desc; + a_desc.body = &b_desc; + + if (shape->getType() == SimpleShape::SST_Box) { + + SimpleBox* box = shape->getAsBox(); + NxBoxShapeDesc shape_desc; + shape_desc.dimensions = (box->getDimensionsAsNxVec3() * 0.5f) * NX_KINEMATIC_CHARACTER_SHAPE_DELTA; + mShapeUserData = NxNew(VoidPointer)(vptr->Ptr, NxOgreClass_CharacterShape, vptr->RenderPtr); + shape_desc.userData = mShapeUserData; + a_desc.shapes.pushBack(&shape_desc); + + } + else if (shape->getType() == SimpleShape::SST_Capsule) { + + SimpleCapsule* capsule = shape->getAsCapsule(); + NxCapsuleShapeDesc shape_desc; + shape_desc.radius = capsule->getRadius() * NX_KINEMATIC_CHARACTER_SHAPE_DELTA; + shape_desc.height = capsule->getHeight() * NX_KINEMATIC_CHARACTER_SHAPE_DELTA; + mShapeUserData = NxNew(VoidPointer)(vptr->Ptr, NxOgreClass_CharacterShape, vptr->RenderPtr); + shape_desc.userData = mShapeUserData; + a_desc.shapes.pushBack(&shape_desc); + + } + else { + NxThrow("Invalid shape passed to KinematicCharacter must be capsule or box"); + return; + } + + a_desc.density = 10.0f; + a_desc.globalPose = pose; + b_desc.flags |= NX_BF_KINEMATIC; + a_desc.userData = (void*) vptr; + + NxDelete(shape); + + mActor = mScene->getNxScene()->createActor(a_desc); + +} + +//////////////////////////////////////////////////// + +KinematicCharacter::~KinematicCharacter() { + NxDelete(mShapeUserData); + if (mActor) + mScene->getNxScene()->releaseActor(*mActor); +} + +//////////////////////////////////////////////////// + +void KinematicCharacter::init(NxMat34 pose) { + // move mActor to pose. +} + +//////////////////////////////////////////////////// + +void KinematicCharacter::move(const NxVec3& direction) { + // Ahhh. So temp, so very temp. + mActor->moveGlobalPosition(getPosition() + direction); +} + +//////////////////////////////////////////////////// + +void KinematicCharacter::setPosition(const NxVec3& position) { + +} + +//////////////////////////////////////////////////// + +NxVec3 KinematicCharacter::getPosition() const { + // Temp. + return mActor->getGlobalPosition(); +} + +//////////////////////////////////////////////////// + +void KinematicCharacter::setOrientation(const NxQuat& orientation) { + +} + +//////////////////////////////////////////////////// + +NxQuat KinematicCharacter::getOrientation() const { + NxQuat q;q.id(); + return q; +} + +//////////////////////////////////////////////////// + +NxMat34 KinematicCharacter::getPose() const { + // Temp. + return mActor->getGlobalPose(); +} + +//////////////////////////////////////////////////// + +void KinematicCharacter::setSize(const NxVec3& size) { + +} + +//////////////////////////////////////////////////// + +NxVec3 KinematicCharacter::getSize() const { + return NxVec3(0,0,0); +} + +//////////////////////////////////////////////////// + +void KinematicCharacter::setStepSize(NxReal stepSize) { + +} + +//////////////////////////////////////////////////// + +NxReal KinematicCharacter::getStepSize() const { + return 0; +} + +//////////////////////////////////////////////////// + +void KinematicCharacter::setSlopeLimit(NxRadian slopeLimit) { + +} + +//////////////////////////////////////////////////// + +NxRadian KinematicCharacter::getSlopeLimit() const { + return 0; +} + +//////////////////////////////////////////////////// + +void KinematicCharacter::setGravityEnabled(bool gravity) { + +} + +//////////////////////////////////////////////////// + +bool KinematicCharacter::getGravityEnabled() const { + return false; +} + +//////////////////////////////////////////////////// + +void KinematicCharacter::setUpDirection(NxVec3 upDirection) { + +} + +//////////////////////////////////////////////////// + +NxVec3 KinematicCharacter::getUpDirection() const { + return NxVec3(0,0,0); +} + +//////////////////////////////////////////////////// + +}; // End of CharacterSystem namespace. +}; // End of NxOgre namespace. + +#undef NX_KINEMATIC_CHARACTER_SHAPE_DELTA + +#endif Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.h (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.h 2008-06-22 06:25:12 UTC (rev 602) @@ -0,0 +1,107 @@ +/** \file NxOgreKinematicCharacter.h + * \brief Header for the KinematicCharacter class. + * \version 1.0-21 + * + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __NXOGRE_KINEMATIC_CHARACTER_H__ +#define __NXOGRE_KINEMATIC_CHARACTER_H__ + +#include "NxOgrePrerequisites.h" + +#if (NX_USE_LEGACY_NXCONTROLLER == 0) + +#include "NxOgreCharacterController.h" + +namespace NxOgre { +namespace CharacterSystem { + + /** \brief Kinematic based Character. + */ + class NxPublicClass KinematicCharacter : public CharacterController { + + friend class Character; + + protected: + + KinematicCharacter(NxMat34 pose, SimpleShape*, Scene*, VoidPointer*); + + public: + + virtual ~KinematicCharacter(); + + + NxActorGroup getActorGroup() {return 0;} + NxCollisionGroup getCollisionGroup() {return 0;} + + void setActorGroup(NxActorGroup) {} + void setCollisionGroup(NxCollisionGroup) {} + + NxActor* getActor() { + return mActor; + } + + VoidPointer* getUserData() { + return mUserData; + } + + protected: + + void init(NxMat34 pose); + + void move(const NxVec3& direction); + + void setPosition(const NxVec3& position); + NxVec3 getPosition() const; + + void setOrientation(const NxQuat& orientation); + NxQuat getOrientation() const; + + NxMat34 getPose() const; + + void setSize(const NxVec3& size); + NxVec3 getSize() const; + + void setStepSize(NxReal stepSize); + NxReal getStepSize() const; + + void setSlopeLimit(NxRadian slopeLimit); + NxRadian getSlopeLimit() const; + + void setGravityEnabled(bool gravity); + bool getGravityEnabled() const; + + void setUpDirection(NxVec3 upDirection); + NxVec3 getUpDirection() const; + + virtual NxString getType() const { return NxString("NxActorController"); }; + + private: + + NxActor* mActor; + VoidPointer* mUserData; + VoidPointer* mShapeUserData; + NxVec3 mUpDirection; + + }; + +}; // End of CharacterSystem namespace. +}; // End of NxOgre namespace. + +#endif +#endif Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacterSweep.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacterSweep.h (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacterSweep.h 2008-06-22 06:25:12 UTC (rev 602) @@ -0,0 +1,41 @@ +/** \file NxOgreKinematicCharacter.h + * \brief Header for the KinematicCharacter class. + * \version 1.0-21 + * + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __NXOGRE_KINEMATIC_CHARACTER_SWEEP_H__ +#define __NXOGRE_KINEMATIC_CHARACTER_SWEEP_H__ + +#include "NxOgrePrerequisites.h" + +#if (NX_USE_LEGACY_NXCONTROLLER == 0) + +#include "NxOgreCharacterController.h" + +namespace NxOgre { +namespace CharacterSystem { +namespace Kinematic { + // Lots of classes, defines, structs and what not go in here. + +}; // End of Kinematic namespace. +}; // End of CharacterSystem namespace. +}; // End of NxOgre namespace + +#endif +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-06-22 06:20:15
|
Revision: 601 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=601&view=rev Author: andy_miller Date: 2008-06-21 23:20:23 -0700 (Sat, 21 Jun 2008) Log Message: ----------- Tyring (again) to get my nxogre source cleaned up.. Removed Paths: ------------- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterSystem.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterSystem.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCollisionModel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCompound.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCompound.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCooking.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCooking.h trunk/python-ogre/ThirdParty/nxogre/NxOgreDynamicMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreDynamicMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsDefinesTypedefs.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResourceStream.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResourceStream.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResourceSystem.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResourceSystem.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFluidMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreFluidMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreGlobalFunctions.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreInflatable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJSON.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJSON.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJSONCollection.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJSONRead.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJSONSchema.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJSONWrite.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.h trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacterSweep.h trunk/python-ogre/ThirdParty/nxogre/NxOgreLegacyCharacter.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreLegacyCharacter.h trunk/python-ogre/ThirdParty/nxogre/NxOgreLegacyCharacterController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreLegacyCharacterController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreLegacyCharacterHitReport.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreLegacyCharacterHitReport.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMemoryStream.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMemoryStream.h trunk/python-ogre/ThirdParty/nxogre/NxOgreNXM.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreNXM.h trunk/python-ogre/ThirdParty/nxogre/NxOgreNxCharacterController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreNxCharacterController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreNxSerialiser.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreNxSerialiser.h trunk/python-ogre/ThirdParty/nxogre/NxOgreNxuStreamSerialiser.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOBJStream.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreOBJStream.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreResourceStream.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreResourceStream.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreResourceSystem.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreResourceSystem.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceManager_Cloth.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceManager_Convex.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceManager_Triangle.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStream.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStream.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStreamPtr.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStreamPtr.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSerialiser.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSerialiser.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeConvex.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeConvex.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreState.h trunk/python-ogre/ThirdParty/nxogre/NxOgreStateMachine.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTestIdea.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTransitionalMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTransitionalMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreUserData.h trunk/python-ogre/ThirdParty/nxogre/NxOgreUserStream.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreUserStream.h Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp 2008-06-22 06:20:23 UTC (rev 601) @@ -1,186 +0,0 @@ -/** \file NxOgreCharacter.cpp - * \see NxOgreCharacter.h - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "NxOgreStable.h" - -#if (NX_USE_LEGACY_NXCONTROLLER == 0) - -#include "NxOgreCharacter.h" -#include "NxOgreScene.h" -#include "NxOgreNxActorController.h" -#include "NxOgreKinematicCharacter.h" - -#include "NxOgreCharacterModel.h" -#include "NxOgreCharacterMovementModel.h" - -#include "NxOgreVoidPointer.h" -#include "NxOgreTimeStep.h" - -namespace NxOgre { -namespace CharacterSystem { - -///////////////////////////////////////////////////////////// - -void CharacterParams::setToDefault() { - -#if (NX_USE_CHARACTER_API == 1) - mControllerType = CT_KINEMATIC; -#else - mControllerType = CT_NXACTOR; -#endif - - mControllerPtr = 0; - mStepOffset = 0.0f; - mSlopeLimit = 0.0f; - mUpDirection = NX_AXIS_PLUS_Y; - //mGroupMask; - mControllerCollisionShape = 0; - -} - -///////////////////////////////////////////////////////////// - -Character::Character(const NxString& identifier, Pose pose, CharacterModel* model, CharacterParams params, Scene* scene) -: mName(identifier), mModel(model), mOwner(scene), mVoidPointer(0) -{ - - if (model == 0) { - NxThrow("Character Model pointer is null!"); - mDead = true; - return; - } - - if (params.mControllerType == params.CT_PTR && params.mControllerPtr == 0) { - NxThrow("ControllerType is custom but given pointer is null!"); - mDead = true; - return; - } - - mVoidPointer = new VoidPointer(this, NxOgreClass_Character); - - // (TODO) Pass on voidpointer to controllers here. - if (params.mControllerType == CharacterParams::CT_NXACTOR) { - mController = NxNew(NxActorController)(pose, params.mControllerCollisionShape, scene, mVoidPointer); - } -#if (NX_USE_CHARACTER_API == 1) - else if (params.mControllerType == CharacterParams::CT_KINEMATIC) { - mController = NxNew(KinematicCharacter)(pose, params.mControllerCollisionShape, scene, mVoidPointer); - } -#endif - else { - mController = params.mControllerPtr; - NxWatch(CharacterController, mController); - } - - // Watch Model and set the garbage collection mode. - NxWatch(CharacterModel, mModel); - mModel->setGC(); - - // Current movement model to default. - mCurrentMovement = mModel->mDefaultMovementModel; - - // Reset all movemenet models to this. - for (CharacterMovementModel* model = mModel->mMovementModels.begin(); model = mModel->mMovementModels.next();) { - model->reset(this); - } - - mCurrentMovement->enter(0, mController->getPose()); - - mOwner->_registerCharacter(mName, this); -} - -///////////////////////////////////////////////////////////// - -Character::~Character() { - - mOwner->_unregisterCharacter(mName); - - mCurrentMovement->exit(); - - // Delete bleh bleh here. - if (mModel->mDeletionPolicy == GC_Delete) - NxDelete(mModel); - - - delete mController; - delete mVoidPointer; - -} - -///////////////////////////////////////////////////////////// - -void Character::simulate(const TimeStep& ts) { - - mCurrentMovement->simulate(ts.Delta); - - // get new movement vector - const NxVec3 movementVector = mCurrentMovement->getGlobalMovementVector(ts.Delta); - - // get controller to move that vector. - mController->move(movementVector); - - mCurrentMovement->setPose(mController->getPose()); - mCurrentMovement->simulateAfter(ts.Delta); - -} - -///////////////////////////////////////////////////////////// - -void Character::forward() { - mCurrentMovement->forward(); -} - -///////////////////////////////////////////////////////////// - -void Character::backward() { - mCurrentMovement->backward(); -} - -///////////////////////////////////////////////////////////// - -void Character::left() { - mCurrentMovement->left(); -} - -///////////////////////////////////////////////////////////// - -void Character::right() { - mCurrentMovement->right(); -} - -///////////////////////////////////////////////////////////// - -void Character::up() { - mCurrentMovement->up(); -} - -///////////////////////////////////////////////////////////// - -void Character::down() { - mCurrentMovement->down(); -} - -///////////////////////////////////////////////////////////// - -}; // End of Character namespace. -}; // End of NxOgre namespace. - -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h 2008-06-22 06:20:23 UTC (rev 601) @@ -1,199 +0,0 @@ -/** \file NxOgreCharacter.h - * \brief Header for the CharacterParams and Character classes. - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __NXOGRE_CHARACTER_H__ -#define __NXOGRE_CHARACTER_H__ - -#include "NxOgrePrerequisites.h" - -#if (NX_USE_LEGACY_NXCONTROLLER == 0) - -#include "NxOgreParams.h" -#include "NxOgrePose.h" - -namespace NxOgre { -namespace CharacterSystem { - - - class NxPublicClass CharacterParams : public Params { - - public: - - CharacterParams() { - setToDefault(); - } - - CharacterParams(const char* p) { - process(p); - } - - CharacterParams(NxString p) { - process(p); - } - - void setToDefault(); - - enum ControllerType { -#if (NX_USE_CHARACTER_API == 1) - CT_KINEMATIC, -#endif - CT_NXACTOR, - CT_PTR - }; - - ControllerType mControllerType; - CharacterController* mControllerPtr; - - NxReal mStepOffset; - NxRadian mSlopeLimit; - NxAxisType mUpDirection; - NxGroupsMask mGroupMask; - - /** \brief Collision shape for NxActor and NxCharacter controllers. - \note The function "setToDefault" sets the pointer to zero. You - have to assign one after setting the basic params using - the new operator or the SimpleShape::createShapeFromString method - - \see Controllers for what shapes they can and cannot use - \see SimpleShape::createShapeFromString - - - */ - - SimpleShape* mControllerCollisionShape; - - - }; - - ///////////////////////////////////////////////////////// - - /** Character - - */ - class NxPublicClass Character { - - public: - - enum LocalMovementDirection { - LMD_FORWARD = 0, - LMD_BACKWARD = 1, - LMD_LEFT = 2, - LMD_RIGHT = 3, - LMB_UP = 4, - LMB_DOWN = 5 - }; - - Character(const NxString& identifier, Pose, CharacterModel*, CharacterParams, Scene*); - virtual ~Character(); - - NxString getName() const {return mName;} - - virtual void simulate(const TimeStep&); - - CharacterController* getController() const { - return mController; - } - - CharacterModel* getModel() const { - return mModel; - } - - CharacterMovementModel* getCurrentMovementModel() const { - return mCurrentMovement; - } - - void setModel(CharacterModel* newModel) { - mModel = newModel; - resetMovement(); - } - - void resetMovement() {} - void setMovement(NxString movement); - void setMovement(Ogre::Vector3 movementVector); - void setLocalMovement(Ogre::Vector3 movementVector); - - inline void forward(); - inline void backward(); - inline void left(); - inline void right(); - inline void up(); - inline void down(); - - void injectMovement(LocalMovementDirection); - void setDirection(const NxQuat& orientation); - void setDirection(const Ogre::Quaternion& orientation); - void moveTowards(Ogre::Vector3 globalPosition, NxReal force); - void setYaw(NxRadian Yaw); - void setYaw(Ogre::Radian Yaw); - void setPitch(NxRadian Pitch); - void setPitch(Ogre::Radian Pitch); - void setRoll(NxRadian Roll); - void setRoll(Ogre::Radian Roll); - - - /** \brief Forces height to a new one, without a transitional movement period. - Forces the local height of the character shape to a new one whilst moving - the character to half-height below. - - \param height Height of the character - */ - void setHeight(NxReal height); - - - /** \brief Forces height to a new one, with a transitional movement period. - Forces the local height of the character shape to a new one whilst leaving it - at the existing position. Naturaly gravity or a custom vector will kick in and - move the character into the correct new position over the upcoming frames. - - \param height Height of the character - */ - void changeHeight(NxReal height); - - void setSize(const NxVec3& size); - void setSize(const float2& size); - - void setGravityEnabled(bool); - bool isGravityEnabled(); - - bool isDead() const {return mDead;} - - protected: - - CharacterController* mController; - CharacterModel* mModel; - CharacterMovementModel* mCurrentMovement; - - NxString mName; - Scene* mOwner; - VoidPointer* mVoidPointer; - - private: - - bool mDead; - - }; - - //////////////////////////////////////////// -};// End of CharacterSystem -};// End of namespace - -#endif -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.cpp 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.cpp 2008-06-22 06:20:23 UTC (rev 601) @@ -1,45 +0,0 @@ -/** \file NxOgreCharacterController.cpp - * \see NxOgreCharacterController.h - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "NxOgreStable.h" - -#include "NxOgreCharacterController.h" - -namespace NxOgre { -namespace CharacterSystem { - -//////////////////////////////////////////////////// - -CharacterController::CharacterController(Scene* scene, VoidPointer*) -: mScene(scene) { - -} - -//////////////////////////////////////////////////// - -CharacterController::~CharacterController() { - -} - -//////////////////////////////////////////////////// - -}; // End of CharacterSystem namespace. -}; // End of NxOgre namespace. Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.h 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.h 2008-06-22 06:20:23 UTC (rev 601) @@ -1,96 +0,0 @@ -/** \file NxOgreCharacterController.h - * \brief Header for the CharacterController class. - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#ifndef __NXOGRE_CHARACTER_CONTROLLER_H__ -#define __NXOGRE_CHARACTER_CONTROLLER_H__ - -#include "NxOgrePrerequisites.h" - -#if (NX_USE_LEGACY_NXCONTROLLER == 0) - -namespace NxOgre { -namespace CharacterSystem { - - class NxPublicClass CharacterController { - - friend class Character; - - public: - - CharacterController(Scene*, VoidPointer*); - virtual ~CharacterController(); - - virtual NxActorGroup getActorGroup() {return 0;} - virtual NxCollisionGroup getCollisionGroup() {return 0;} - - virtual void setActorGroup(NxActorGroup) {} - virtual void setCollisionGroup(NxCollisionGroup) {} - - virtual void init(NxMat34 pose) {} - - virtual void move(const NxVec3& direction) {} - - virtual void setPosition(const NxVec3& position) {} - virtual NxVec3 getPosition() const {return NxVec3(0,0,0);} - - virtual void setOrientation(const NxQuat& orientation) {} - virtual NxQuat getOrientation() const {NxQuat quat;quat.id();return quat;} - - virtual NxMat34 getPose() const {NxMat34 m;m.id();return m;} - - virtual void setSize(const NxVec3& size) {} - virtual void getSize(NxVec3& size) {} - - virtual void setSize(const float2& size) {} - virtual void getSize(float2& size) {} - - virtual void setStepSize(NxReal stepSize) {} - virtual NxReal getStepSize() const {return 0;} - - virtual void setSlopeLimit(NxRadian slopeLimit) {} - virtual NxRadian getSlopeLimit() const {return 0;} - - virtual void setGravityEnabled(bool gravity) {} - virtual bool getGravityEnabled() const {return false;} - - virtual void setUpDirection(NxVec3 upDirection) {} - virtual NxVec3 getUpDirection() const {return NxVec3(0,0,0);} - - - virtual NxString getType() { return NxString("CharacterController"); }; - - ///////////////////////////////////////////////// - - Scene* mScene; - - private: - - - }; - - //////////////////////////////////////////// - -};// End of CharacterSystem namespace. -};// End of NxOgre namespace. - -#endif -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.cpp 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.cpp 2008-06-22 06:20:23 UTC (rev 601) @@ -1,26 +0,0 @@ -/** \file NxOgreCharacterModel.cpp - * \see NxOgreCharacterModel.h - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "NxOgreStable.h" - -#if (NX_USE_LEGACY_NXCONTROLLER == 0) -# include "NxOgreCharacterModel.h" -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.h 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.h 2008-06-22 06:20:23 UTC (rev 601) @@ -1,63 +0,0 @@ -/** \file NxOgreCharacterModel.h - * \brief Header for the CharacterModel class. - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __NXOGRE_CHARACTER_MODEL_H__ -#define __NXOGRE_CHARACTER_MODEL_H__ - -#include "NxOgrePrerequisites.h" - -#if (NX_USE_LEGACY_NXCONTROLLER == 0) - -#include "NxOgreContainer.h" - -namespace NxOgre { -namespace CharacterSystem { - - class NxPublicClass CharacterModel { - - friend class Character; - - public: - - virtual ~CharacterModel() {} - - CharacterMovementModel* mDefaultMovementModel; - CharacterMovementModels mMovementModels; - - protected: - - virtual void setGC() { - mDeletionPolicy = GC_Delete; - } - - GarbageCollectionPolicy mDeletionPolicy; - - private: - - }; - - //////////////////////////////////////////// - -}; // End of CharacterSystem namespace. -}; // End of NxOgre namespace. - -#endif -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.cpp 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.cpp 2008-06-22 06:20:23 UTC (rev 601) @@ -1,28 +0,0 @@ -/** \file NxOgreCharacterMovementModel.cpp - * \see NxOgreCharacterMovementModel.h - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#include "NxOgreStable.h" - -#if (NX_USE_LEGACY_NXCONTROLLER == 0) - -#include "NxOgreCharacterMovementModel.h" - - -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.h 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.h 2008-06-22 06:20:23 UTC (rev 601) @@ -1,95 +0,0 @@ -/** \file NxOgreCharacterMovementModel.h - * \brief Header for the CharacterMovementModel class. - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __NXOGRE_CHARACTER_MOVEMENT_MODEL_H__ -#define __NXOGRE_CHARACTER_MOVEMENT_MODEL_H__ - -#include "NxOgrePrerequisites.h" - -#if (NX_USE_LEGACY_NXCONTROLLER == 0) - -#include "NxOgreHelpers.h" - -namespace NxOgre { -namespace CharacterSystem { - - class NxPublicClass CharacterMovementModel { - - public: - - virtual void enter(CharacterMovementModel* from, NxMat34 pose) {mPose = pose;mMovement.zero();mOrientation.id();} - virtual NxMat34 exit() {return mPose;} - - virtual void simulate(NxReal dTime) {} - virtual void simulateAfter(NxReal dTime) {} - virtual void reset(Character* c) {mCharacter = c;}// mPose = c->getPose();} - virtual void forward() {} - virtual void backward() {} - virtual void left() {} - virtual void right() {} - virtual void up() {} - virtual void down() {} - - virtual void setYaw(NxRadian yaw) { - // mOrientation - } - - void setPose(NxMat34 pose) {mPose = pose;} - virtual void setPitch(NxRadian pitch) {} - virtual void setRoll(NxRadian roll) {} - - virtual void setOrientation(NxQuat orientation) {} - virtual NxQuat getOrientation() { NxQuat quat; - mPose.M.toQuat(quat); - return quat;} - - virtual NxString getType() {return NxString("Default");} - - virtual NxVec3 getGlobalMovementVector(NxReal dT) { - return (mOrientation * mMovement) * dT; - } - - virtual NxVec3 getMovementVector() { - return mMovement; - } - - virtual NxQuat getGlobalOrientation() { - return mOrientation; - } - - protected: - - Character* mCharacter; - NxMat34 mPose; - NxVec3 mMovement; - NxQuat mOrientation; - - private: - - }; - - //////////////////////////////////////////// - -}; // End of CharacterSystem namespace. -}; // End of NxOgre namespace. - -#endif -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterSystem.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterSystem.cpp 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterSystem.cpp 2008-06-22 06:20:23 UTC (rev 601) @@ -1,70 +0,0 @@ -/** \file NxOgreCharacterSystem.cpp - * \see NxOgreCharacterSystem.h - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "NxOgreStable.h" - -#if (NX_USE_LEGACY_NXCONTROLLER == 0 && NX_USE_CHARACTER_API == 1) - -#include "NxOgreCharacterSystem.h" - -namespace NxOgre { - -///////////////////////////////////////////////////////////// - -CharacterSystem::CharacterSystem(World* world) : mWorld(world) { - -} - -///////////////////////////////////////////////////////////// - -CharacterSystem::~CharacterSystem() { - mCharacters.destroyAllOwned(); -} - -///////////////////////////////////////////////////////////// - -void CharacterSystem::createCharacter(NxString identifier, Pose, CharacterModel*, CharacterParams params) { - -} - -///////////////////////////////////////////////////////////// - -void CharacterSystem::createPerformer(NxString visualIdentifier, Pose, CharacterModel*, CharacterParams params) { - -} - -///////////////////////////////////////////////////////////// - -void CharacterSystem::destroyCharacter(NxString identifier) { - -} - -///////////////////////////////////////////////////////////// - -Character* CharacterSystem::getCharacter(NxString identifier) { - return mCharacters.get(identifier); -} - -///////////////////////////////////////////////////////////// - -}; - -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterSystem.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterSystem.h 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterSystem.h 2008-06-22 06:20:23 UTC (rev 601) @@ -1,81 +0,0 @@ -/** \file NxOgreCharacterSystem.h - * \brief Header for the CharacterSystem class. - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __NXOGRE_CHARACTER_SYSTEM_H__ -#define __NXOGRE_CHARACTER_SYSTEM_H__ - -#include "NxOgrePrerequisites.h" - -#if (NX_USE_LEGACY_NXCONTROLLER == 0) - -#include "NxOgreContainer.h" -#include "NxOgreCharacter.h" - -#if (NX_USE_CHARACTER_API == 1) -# include "NxControllerManager.h" -#endif - -namespace NxOgre { - - //////////////////////////////////////////////////////////////////////// - - class NxPublicClass CharacterSystem { - - public: - - CharacterSystem(World*); - ~CharacterSystem(); - -#if (NX_USE_CHARACTER_API == 1) - /** Return's a copy of the instance of the Controller Manager - \return NxControllerManager - */ - NxControllerManager* getControllerManager() { - return mControllerManager; - } -#endif - - void createCharacter(NxString identifier, Pose, CharacterModel*, CharacterParams = CharacterParams()); - void createPerformer(NxString visualIdentifier, Pose, CharacterModel*, CharacterParams = CharacterParams()); - - void destroyCharacter(NxString identifier); - Character* getCharacter(NxString identifier); - - protected: - - Characters mCharacters; - - private: - -#if (NX_USE_CHARACTER_API == 1) - NxControllerManager* mControllerManager; -#endif - - World* mWorld; - - }; - - //////////////////////////////////////////////////////////////////////// - -};// End of namespace - -#endif -#endif \ No newline at end of file Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCollisionModel.h =================================================================== Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCompound.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCompound.cpp 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCompound.cpp 2008-06-22 06:20:23 UTC (rev 601) @@ -1,20 +0,0 @@ -// -// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. -// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// - -#include "NxOgreStable.h" Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCompound.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCompound.h 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCompound.h 2008-06-22 06:20:23 UTC (rev 601) @@ -1,24 +0,0 @@ -// -// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. -// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// - - - -// -// Reserved for Compound Actors. -// Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCooking.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCooking.cpp 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCooking.cpp 2008-06-22 06:20:23 UTC (rev 601) @@ -1,270 +0,0 @@ -/** \file NxOgreCooking.cpp - * \see NxOgreCooking.h - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "NxOgreStable.h" -#include "NxOgreCooking.h" -#include "NxOgreMemoryStream.h" -#include "NxCooking.h" -#include "NxOgreHelpers.h" - -#include "OgreImage.h" -#include "OgreResourceGroupManager.h" -#include "OgreRoot.h" -#include "OgreSingleton.h" -#include "OgreMesh.h" -#include "OgreSubMesh.h" -#include "OgreVector3.h" - -namespace NxOgre { - - -#if 0 -//////////////////////////////////////////////////////////////////////////////////////////////// - -NxHeightField* NxGenerateHeightFieldFromImage(const NxString& imageFilename, unsigned int nbRows,NxScene *scene) { - - Ogre::Image img; - img.load(imageFilename, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); - - unsigned int imageSize = img.getWidth(); - - NxHeightFieldDesc heightFieldDesc; - heightFieldDesc.nbColumns = nbRows; - heightFieldDesc.nbRows = nbRows; - heightFieldDesc.verticalExtent = -1000; - heightFieldDesc.convexEdgeThreshold = 0; - - // Allocate storage for heightfield samples - heightFieldDesc.samples = new NxU32[imageSize * imageSize]; - heightFieldDesc.sampleStride = sizeof(NxU32); - - char* currentByte = (char*) heightFieldDesc.samples; - int gMatrixSize = 3; - NxReal sixtyFourKb = 65536.0; - NxReal thirtyTwoKb = 32768.0; - - NxMaterialIndex gMatrix[9][3] = { - // {tesselation, material0, material1} - {0,1,1}, {0,1,1}, {0,1,1}, - {0,1,1}, {0,1,1}, {0,1,1}, - {0,1,1}, {0,1,1}, {0,1,1} - }; - const Ogre::uchar* pSrc = img.getData(); - - for (NxU32 row = 0; row < nbRows; row++) { - for (NxU32 column = 0; column < nbRows; column++) { - - NxU32 matrixOffset = (row % gMatrixSize) * gMatrixSize + (column % gMatrixSize); - - NxReal s = NxReal(row) / NxReal(nbRows); - NxReal t = NxReal(column) / NxReal(nbRows); - - NxHeightFieldSample* currentSample = (NxHeightFieldSample*)currentByte; - float colorValue = img.getColourAt (row, column,0).r; - - currentSample->height = img.getColourAt (row, column,0).r * 32768.0f; - - currentSample->materialIndex0 = gMatrix[matrixOffset][1]; - currentSample->materialIndex1 = gMatrix[matrixOffset][2]; - currentSample->tessFlag = gMatrix[matrixOffset][0]; - - currentByte += heightFieldDesc.sampleStride; - } - } - - NxHeightField *hf = scene->getPhysicsSDK().createHeightField(heightFieldDesc); - - delete [] heightFieldDesc.samples; - - return hf; - -} -#endif -//////////////////////////////////////////////////////////////////////////////////////////////// - -NxHeightField* NxGenerateHeightFieldFromImage(const NxString& imageFilename, NxScene* scene) { - - Ogre::Image img; - img.load(imageFilename, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); - - NxU32 imageWidth = img.getWidth(); - NxU32 imageHeight = img.getHeight(); - - NxHeightFieldDesc heightFieldDesc; - - heightFieldDesc.nbRows = imageWidth; - heightFieldDesc.nbColumns = imageHeight; - heightFieldDesc.verticalExtent = -1000; - heightFieldDesc.convexEdgeThreshold = 0; - - // Allocate storage for heightfield samples - heightFieldDesc.samples = new NxU32[imageWidth * imageHeight]; - heightFieldDesc.sampleStride = sizeof(NxU32); - - char* currentByte = (char*) heightFieldDesc.samples; - int gMatrixSize = 3; - - NxMaterialIndex gMatrix[9][3] = { - // {tesselation, material0, material1} - {0,1,1}, {0,1,1}, {0,1,1}, - {0,1,1}, {0,1,1}, {0,1,1}, - {0,1,1}, {0,1,1}, {0,1,1} - }; - const Ogre::uchar* pSrc = img.getData(); - NxReal colourValue = 0; - - for (NxU32 row = 0; row < imageWidth; row++) { - for (NxU32 column = 0; column < imageHeight; column++) { - - NxU32 matrixOffset = (row % gMatrixSize) * gMatrixSize + (column % gMatrixSize); - - NxReal s = NxReal(row) / NxReal(imageWidth); - NxReal t = NxReal(column) / NxReal(imageHeight); - - NxHeightFieldSample* currentSample = (NxHeightFieldSample*) currentByte; - colourValue = img.getColourAt (row, column,0).r; - - currentSample->height = colourValue * 32768.0f; - - currentSample->materialIndex0 = gMatrix[matrixOffset][1]; - currentSample->materialIndex1 = gMatrix[matrixOffset][2]; - currentSample->tessFlag = gMatrix[matrixOffset][0]; - - currentByte += heightFieldDesc.sampleStride; - } - } - - NxHeightField *hf = scene->getPhysicsSDK().createHeightField(heightFieldDesc); - -#ifdef NX_PLATFORM_LINUX - delete [] (NxU32*) heightFieldDesc.samples; -#else - delete [] heightFieldDesc.samples; -#endif - - return hf; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -NxHeightField* NxGenerateHeightFieldFromRaw(const NxString& imageFilename, NxScene* scene) { - - Ogre::MemoryDataStreamPtr mRawData; - mRawData.setNull(); - - Ogre::DataStreamPtr stream = Ogre::ResourceGroupManager::getSingleton().openResource(imageFilename); - mRawData = Ogre::MemoryDataStreamPtr(new Ogre::MemoryDataStream(imageFilename, stream)); - - // Work out the Image size by the size of the file. This algorithm only works if the texture is square. But since - // Ogre terrain works this way as well, it isn't much of a problem. - NxU32 fileLength = mRawData->size(); - NxReal width = NxMath::sqrt(NxReal(fileLength)); - bool is8bit = true; - - // Check to see if the image is 16-bit. The square root of all image filesizes which are 16-bit, produce a non-integer - // number. To get the real imageWidth, the fileLength is halfed and square-rooted again, which produces an integer. - if (NxU32(NxMath::floor(width)) != width) { - width = NxMath::sqrt(NxReal(fileLength * 0.5f)); - is8bit = false; - } - - /// And here we go. - - NxHeightFieldDesc heightFieldDesc; - heightFieldDesc.nbColumns = width; - heightFieldDesc.nbRows = width; - heightFieldDesc.verticalExtent = -1000; - heightFieldDesc.convexEdgeThreshold = 0; - - // Allocate storage for heightfield samples - heightFieldDesc.samples = new NxU32[heightFieldDesc.nbRows * heightFieldDesc.nbColumns]; - heightFieldDesc.sampleStride = sizeof(NxU32); - - char* currentByte = (char*) heightFieldDesc.samples; - NxU32 gMatrixSize = 3; - - NxMaterialIndex gMatrix[9][3] = { - // {tesselation, material0, material1} - - {0,1,1}, {0,1,1}, {0,1,1}, - - {0,1,1}, {0,1,1}, {0,1,1}, - - {0,1,1}, {0,1,1}, {0,1,1} - - }; - - const Ogre::uchar* pSrc = mRawData->getPtr(); - - NxU32 i = 0; - NxReal height = 0; - NxI16 short_height = 0; - - for (NxU32 row = 0; row < width; row++) { - for (NxU32 column = 0; column < width; column++) { - - NxU32 matrixOffset = (row % gMatrixSize) * gMatrixSize + (column % gMatrixSize); - - NxReal s = NxReal(row) / NxReal(width); - NxReal t = NxReal(column) / NxReal(width); - - NxHeightFieldSample* currentSample = (NxHeightFieldSample*)currentByte; - - i = row + (column * width); - - if (is8bit) { - height = pSrc[i]; - height *= 257.0f; - short_height = height; - short_height -= 32768; - } - else { - i*=2; - short_height = pSrc[i]; - short_height += pSrc[i + 1] << 8; - short_height -= 32768; - } - - currentSample->height = short_height; - currentSample->materialIndex0 = gMatrix[matrixOffset][1]; - currentSample->materialIndex1 = gMatrix[matrixOffset][2]; - currentSample->tessFlag = gMatrix[matrixOffset][0]; - - currentByte += heightFieldDesc.sampleStride; - } - } - - NxHeightField *hf = scene->getPhysicsSDK().createHeightField(heightFieldDesc); - -#ifdef NX_PLATFORM_LINUX - delete [] (NxU32*) heightFieldDesc.samples; -#else - delete [] heightFieldDesc.samples; -#endif - - return hf; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -}; //End of NxOgre namespace. - Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCooking.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCooking.h 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCooking.h 2008-06-22 06:20:23 UTC (rev 601) @@ -1,36 +0,0 @@ -/** \file NxOgreCooking.h - * \brief Header for the NxGenerateHeightField functions. - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#ifndef __NXOGRE_COOKING_H__ -#define __NXOGRE_COOKING_H__ - -#include "NxOgrePrerequisites.h" - -namespace NxOgre { - - // Heightfields - NxPublicClass NxHeightField* NxGenerateHeightFieldFromImage(const NxString& imageFilename, NxScene*); - NxPublicClass NxHeightField* NxGenerateHeightFieldFromRaw(const NxString& imageFilename, NxScene*); - -}; - -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreDynamicMesh.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreDynamicMesh.cpp 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreDynamicMesh.cpp 2008-06-22 06:20:23 UTC (rev 601) @@ -1,208 +0,0 @@ -/** \file NxOgreDynamicMesh.cpp - * \see NxOgreDynamicMesh.h - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "NxOgreStable.h" -#include "NxOgreDynamicMesh.h" -#include "NxOgreResourceMesh.h" - -namespace NxOgre { - -///////////////////////////////////////////////////////////////////// - -DynamicMesh::DynamicMesh() -: mNbVertices(0), mVertices(0), mNbNormals(0), - mNormals(0), mNbIndices(0), mIndices(0), - mNbTextureCoordinates(0), mTextureCoordinates(0) -{ - // Empty Constructor -} - -///////////////////////////////////////////////////////////////////// - -DynamicMesh::~DynamicMesh() { - if (mNbTextureCoordinates) - free(mTextureCoordinates); - - if (mNbNormals) - free(mNormals); -} - -///////////////////////////////////////////////////////////////////// - -void DynamicMesh::replaceVertices(NxVec3* vertices, NxU32 nbVertices) { - - if (mVertices == 0) { - mVertices = (NxVec3*) malloc(nbVertices * sizeof(NxVec3)); - mNbVertices = nbVertices; - } - else if (nbVertices != mNbVertices) { - free(mVertices); - mVertices = (NxVec3*) malloc(nbVertices * sizeof(NxVec3)); - mNbVertices = nbVertices; - } - - memcpy(mVertices, vertices, sizeof(NxVec3) * nbVertices); - -} - -///////////////////////////////////////////////////////////////////// - -void DynamicMesh::replaceNormals(NxVec3* normals, NxU32 nbNormals) { - - if (mNormals == 0) { - mNormals = (NxVec3*) malloc(nbNormals * sizeof(NxVec3)); - mNbNormals = nbNormals; - } - else if (nbNormals != mNbNormals) { - free(mNormals); - mNormals = (NxVec3*) malloc(nbNormals * sizeof(NxVec3)); - mNbNormals = nbNormals; - } - - memcpy(mNormals, normals, sizeof(NxVec3) * nbNormals); - -} - -///////////////////////////////////////////////////////////////////// - -void DynamicMesh::replaceIndices(NxU32* indices, NxU32 nbIndices) { - - if (mIndices == 0) { - mIndices = (NxU32*) malloc(nbIndices * sizeof(NxU32)); - mNbIndices = nbIndices; - } - else if (nbIndices != mNbIndices) { - free(mIndices); - mIndices = (NxU32*) malloc(nbIndices * sizeof(NxU32)); - mNbIndices = nbIndices; - } - - memcpy(mIndices, indices, sizeof(NxU32) * nbIndices); - -} - -///////////////////////////////////////////////////////////////////// - -void DynamicMesh::replaceTextureCoordinates(float2* coords, NxU32 nbCoords) { - - if (mTextureCoordinates == 0) { - mTextureCoordinates = (float2*) malloc(nbCoords * sizeof(float2)); - mNbTextureCoordinates = nbCoords; - } - else if (nbCoords != mNbTextureCoordinates) { - free(mTextureCoordinates); - mTextureCoordinates = (float2*) malloc(nbCoords * sizeof(float2)); - mNbTextureCoordinates = nbCoords; - } - - memcpy(mTextureCoordinates, coords, sizeof(float2) * nbCoords); - -} - -///////////////////////////////////////////////////////////////////// - -void DynamicMesh::referenceVertices(NxVec3* vertices, NxU32 nbVertices, bool gc) { - - if (gc && mVertices) - free(mVertices); - - mVertices = vertices; - mNbVertices = nbVertices; - -} - -///////////////////////////////////////////////////////////////////// - -void DynamicMesh::referenceNormals(NxVec3* normals, NxU32 nbNormals, bool gc) { - - if (gc && mNormals) - free(mNormals); - - mNormals = normals; - mNbNormals = nbNormals; - -} - -///////////////////////////////////////////////////////////////////// - -void DynamicMesh::referenceIndices(NxU32* indices, NxU32 nbIndices, bool gc) { - - if (gc && mIndices) - free(mIndices); - - mIndices = indices; - mNbIndices = nbIndices; - -} - -///////////////////////////////////////////////////////////////////// - -void DynamicMesh::referenceTextureCoordinates(float2* coords, NxU32 nbCoords, bool gc) { - - if (gc && mTextureCoordinates) - free(mTextureCoordinates); - - mTextureCoordinates = coords; - mNbTextureCoordinates = nbCoords; - -} - -///////////////////////////////////////////////////////////////////// - - -DynamicClothMesh::DynamicClothMesh(NxClothMesh* meshPtr) -: DynamicMesh() { - mMeshPtr = meshPtr; -} - -///////////////////////////////////////////////////////////////////// - -DynamicClothMesh::~DynamicClothMesh() { - // Empty. Parent constructor will do the clean up. -} - -///////////////////////////////////////////////////////////////////// - -NxClothMesh* DynamicClothMesh::getMeshPtr() { - return mMeshPtr; -} - -///////////////////////////////////////////////////////////////////// - -void DynamicClothMesh::fromClothMeshIntermediary(ClothMeshIntermediary* cmi) { - std::cout << "Vertices '" << cmi->mVertices << "' , size " << cmi->mNbVertices << std::endl; - replaceVertices(cmi->mVertices, cmi->mNbVertices); - std::cout << mVertices << std::endl; - std::cout << "Indices '" << cmi->mIndices << "' , size " << cmi->mNbIndices << std::endl; - replaceIndices(cmi->mIndices, cmi->mNbIndices); -} - -///////////////////////////////////////////////////////////////////// - -void DynamicClothMesh::toClothMeshIntermediary(ClothMeshIntermediary* cmi) { - -} - -///////////////////////////////////////////////////////////////////// - -} //End of NxOgre namespace. - -////#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreDynamicMesh.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreDynamicMesh.h 2008-06-22 02:07:48 UTC (rev 600) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreDynamicMesh.h 2008-06-22 06:20:23 UTC (rev 601) @@ -1,90 +0,0 @@ -/** \file NxOgreDynamicMesh.h - * \brief Header for the DynamicMesh, DynamicClothMesh class. - * \version 1.0-20 - * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __NXOGRE_DYNAMIC_MESH_H__ -#define __NXOGRE_DYNAMIC_MESH_H__ - -#include "NxOgrePrerequisites.h" -#include "NxOgreResourceManager.h" - -namespace NxOgre { - - //////////////////////////////////////////////////////////////////// - - /** \brief They live up to their namesake. A mesh which changes quite a lot. - */ - class NxPublicClass DynamicMesh { - - public: - - DynamicMesh(); - virtual ~DynamicMesh(); - - void fromNxMeshData(NxMeshData*) {} // TEMP - void toNxMeshData(NxMeshData*) {} // TEMP - - NxU32 mNbVertices; - NxVec3* mVertices; - - NxU32 mNbNormals; - NxVec3* mNormals; - - NxU32 mNbIndices; - NxU32* mIndices; - - NxU32 mNbTextureCoordinates; - float2* mTextureCoordinates; - - void replaceVertices(NxVec3* vertices, NxU32 nbVertices); - void replaceNormals(NxVec3* normals, NxU32 nbNormals); - void replaceIndices(NxU32* indices, NxU32 nbIndices); - void replaceTextureCoordinates(float2* coords, NxU32 nbCoords); - - void referenceVertices(NxVec3* vertices, NxU32 nbVertices, bool gc = true); - void referenceNormals(NxVec3* normals, NxU32 nbNormals, bool gc = true); - void referenceIndices(NxU32* indices, NxU32 nbIndices, bool gc = true); - void referenceTextureCoordinates(float2* coords, NxU32 nbCoords, bool gc = true); - - }; - - //////////////////////////////////////////////////////////////////// - - class NxPublicClass DynamicClothMesh : public DynamicMesh { - - public: - - DynamicClothMesh(NxClothMesh*); - DynamicClothMesh() {} - ~DynamicClothMesh(); - - NxClothMesh* getMeshPtr(); - void fromClothMeshIntermediary(ClothMeshIntermediary*); - void toClothMeshIntermediary(ClothMeshIntermediary*); - - NxClothMesh* mMeshPtr; - - }; - - ////////////////////////////////////////////////////////////... [truncated message content] |
From: <and...@us...> - 2008-06-22 10:24:00
|
Revision: 600 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=600&view=rev Author: andy_miller Date: 2008-06-21 19:07:48 -0700 (Sat, 21 Jun 2008) Log Message: ----------- Removed dea files from nxogre Modified Paths: -------------- trunk/python-ogre/ThirdParty/nxogre/NxOgreContainer.h Removed Paths: ------------- trunk/python-ogre/ThirdParty/nxogre/NxOgreActorBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreActorBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCompoundActorBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCompoundActorBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreParametersBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintConvex.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintConvex.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintPrimitives.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintPrimitives.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintTerrain.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintTerrain.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintWheel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeBlueprintWheel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreWorldBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreWorldBlueprint.h Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreActorBlueprint.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreActorBlueprint.cpp 2008-06-20 06:57:55 UTC (rev 599) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreActorBlueprint.cpp 2008-06-22 02:07:48 UTC (rev 600) @@ -1,295 +0,0 @@ -// -// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. -// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// - -#include "NxOgreStable.h" -#include "NxOgreActorBlueprint.h" -#include "NxOgreSceneBlueprint.h" -#include "NxOgreEnumsBlueprint.h" -#include "NxOgreContainer.h" -#include "NxOgreActor.h" -#include "NxOgreBody.h" -#include "NxOgreScene.h" -#include "NxOgreShape.h" -#include "NxOgreShapeBlueprint.h" -#include "NxOgrePose.h" - -namespace NxOgre { -namespace Blueprints { - -//////////////////////////////////////////////////////////////////////////////////////////////// - -ActorBlueprint::ActorBlueprint() : - mFlags(EnumsBlueprint::FT_NxActorFlag), - mBodyFlags(EnumsBlueprint::FT_NxBodyFlag) -{ - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -ActorBlueprint::~ActorBlueprint() { - empty(); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void ActorBlueprint::empty() { - - // Reset Descriptions - NxActorDesc desc; - desc.setToDefault(); - fromNxActorDesc(desc); - mBody = false; - - NxBodyDesc bdesc; - bdesc.setToDefault(); - fromNxBodyDesc(bdesc); - - // Clear shapes. - - mShapes.destroyAndEraseAll(); - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void ActorBlueprint::serialise(Actor* actor, Scene* scene) { - // - empty(); - - mName = actor->getName(); - - NxActorDesc desc; - actor->getNxActor()->saveToDesc(desc); - fromNxActorDesc(desc); - - if (actor->getNxActor()->isDynamic()) { - mBody = true; - NxBodyDesc bdesc; - actor->getNxActor()->saveBodyToDesc(bdesc); - fromNxBodyDesc(bdesc); - } - else { - mBody = false; - } - - mCustom = actor->saveCustom(); - - // shapes and stuff here... - - CollisionModel shapes; - actor->mCollisionModel.CopyTo(shapes); - - NxShapeIndex index = 0; - for(Shape* shape = shapes.begin();shape = shapes.next();) { - ShapeBlueprint* shapeb = shape->getBlueprint(); - shapeb->setShared(true); - mShapes.insert(index, shapeb); - index++; - } - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void ActorBlueprint::serialise(Actor* actor, SceneBlueprint* bp) { - empty(); - - mName = actor->getName(); - - NxActorDesc desc; - actor->getNxActor()->saveToDesc(desc); - fromNxActorDesc(desc); - - if (actor->getNxActor()->isDynamic()) { - mBody = true; - NxBodyDesc bdesc; - actor->getNxActor()->saveBodyToDesc(bdesc); - fromNxBodyDesc(bdesc); - } - else { - mBody = false; - } - - mCustom = actor->saveCustom(); - - // shapes and stuff here... - - CollisionModel shapes; - actor->mCollisionModel.CopyTo(shapes); - - std::cout << "Collision Model size = " << shapes.count() << std::endl; - - NxShapeIndex index = 0; - for(Shape* shape = shapes.begin();shape = shapes.next();) { - ShapeBlueprint* shapeb = shape->getBlueprint(); - shapeb->setShared(true); - mShapes.insert(index, shapeb); - index++; - } - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -Actor* ActorBlueprint::unserialise(NxString name, Scene* s) { - - NxString type = "Actor"; - if (mCustom.hasKey("ActorType")) { - type = mCustom.getFirstOf("ActorType"); - } - - - ActorParams params; - params.setToDefault(); - - NxActorDesc ad; - toNxActorDesc(ad); - params.fromNxActorDesc(ad); - - if (mDensity == 0 && mMass == 0) { - ad.body = NULL; - } - else { - NxBodyDesc bd; - toNxBodyDesc(bd); - params.fromNxBodyDesc(bd); - } - - - Actor *a; - NxOgre::Pose actorPose; - actorPose.fromMat34(mGlobalPose); - - if (type == "Actor") { - a = s->createActor(name, mShapes.getFirst(), actorPose, params); - } - else if (type == "Body") { - a = s->createBody(name, mShapes.getFirst(), actorPose, params); - } - - if (a->isDead()) { - NxThrow_Error("Actor unserialisation failed!"); - s->destroyActor(a->getName()); - return NULL; - } - - a->restoreCustom(mCustom); - - return a; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void ActorBlueprint::fromNxActorDesc(NxActorDesc& desc) { - - mGlobalPose = desc.globalPose; - mDensity = desc.density; - mFlags.setFlag( EnumsBlueprint::FT_NxActorFlag, desc.flags); - mGroup = desc.group; - -#if 0 - #if NX_SDK_VERSION_NUMBER >= 272 - desc.dominanceGroup = dominanceGroup; - #endif -#endif - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void ActorBlueprint::fromNxBodyDesc(NxBodyDesc& desc) { - - - mMassLocalPose = desc.massLocalPose; - mMassSpaceInertia = desc.massSpaceInertia; - mMass = desc.mass; - mLinearVelocity = desc.linearVelocity; - mAngularVelocity = desc.angularVelocity; - mWakeUpCounter = desc.wakeUpCounter; - mLinearDamping = desc.linearDamping; - mAngularDamping = desc.angularDamping; - mMaxAngularVelocity = desc.maxAngularVelocity; - mCCDMotionThreshold = desc.CCDMotionThreshold; - mBodyFlags.setFlag(EnumsBlueprint::FT_NxBodyFlag, desc.flags); - mSleepLinearVelocity = desc.sleepLinearVelocity; - mSleepAngularVelocity = desc.sleepAngularVelocity; - mSolverIterationCount = desc.solverIterationCount; - - #if NX_SDK_VERSION_NUMBER >= 250 - mSleepEnergyThreshold = desc.sleepEnergyThreshold; - #endif - - #if NX_SDK_VERSION_NUMBER >= 250 - mSleepDamping = desc.sleepDamping; - #endif - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void ActorBlueprint::toNxActorDesc(NxActorDesc& desc) { - - // desc.name = 0; Some Global const char* storage here. - desc.globalPose = mGlobalPose; - desc.density = mDensity; - desc.flags = mFlags.getFlag(); - desc.group = mGroup; - -#if 0 - #if NX_SDK_VERSION_NUMBER >= 272 - desc.dominanceGroup = mDominanceGroup; - #endif -#endif - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void ActorBlueprint::toNxBodyDesc(NxBodyDesc& desc) { - - desc.massLocalPose = mMassLocalPose; - desc.massSpaceInertia = mMassSpaceInertia; - desc.mass = mMass; - desc.linearVelocity = mLinearVelocity; - desc.angularVelocity = mAngularVelocity; - desc.wakeUpCounter = mWakeUpCounter; - desc.linearDamping = mLinearDamping; - desc.angularDamping = mAngularDamping; - desc.maxAngularVelocity = mMaxAngularVelocity; - desc.CCDMotionThreshold = mCCDMotionThreshold; - desc.flags = mBodyFlags.getFlag(); - desc.sleepLinearVelocity = mSleepLinearVelocity; - desc.sleepAngularVelocity = mSleepAngularVelocity; - desc.solverIterationCount = mSolverIterationCount; - -#if NX_SDK_VERSION_NUMBER >= 250 - desc.sleepEnergyThreshold = mSleepEnergyThreshold; -#endif - -#if NX_SDK_VERSION_NUMBER >= 250 - desc.sleepDamping = mSleepDamping; -#endif - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -} //End of Serialiser namespace. -} //End of NxOgre namespace. Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreActorBlueprint.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreActorBlueprint.h 2008-06-20 06:57:55 UTC (rev 599) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreActorBlueprint.h 2008-06-22 02:07:48 UTC (rev 600) @@ -1,126 +0,0 @@ -// -// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. -// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// - -#ifndef __NXOGRE_ACTOR_BLUEPRINT_H__ -#define __NXOGRE_ACTOR_BLUEPRINT_H__ - -#include "NxOgrePrerequisites.h" -#include "NxOgreBlueprint.h" -#include "NxOgreContainer.h" -#include "NxOgreEnumsBlueprint.h" // For: mFlags and mBodyFlags -namespace NxOgre { - - namespace Blueprints { - - - class NxExport ActorFactory { - - public: - - ActorFactory(); - ~ActorFactory(); - - void registerFactory(NxString actorType); - - virtual bool createActor(NxString ID, Blueprints::ActorBlueprint*, NxActor*, Scene*) {return false;} - - }; // ActorFactory - - class NxExport ActorBlueprint : public Blueprint { - - public: - - ActorBlueprint(); - ~ActorBlueprint(); - - void empty(); - // Serialises the Actor. No mesh storage. - void serialise(Actor*, Scene*); - // Serialise the actor w/shapes, mesh storage - void serialise(Actor*, SceneBlueprint*); - - - // Serialise to a current scene with a new name - Actor* unserialise(NxString, Scene*); - - // Serialise to a scene with the current name. - void unserialise(Scene*); - - void fromNxActorDesc(NxActorDesc&); - void fromNxBodyDesc(NxBodyDesc&); - - void toNxActorDesc(NxActorDesc&); - void toNxBodyDesc(NxBodyDesc&); - - //////////////////////////////////////////////// - - NxString mName; - StringPairList mCustom; - NxMat34 mGlobalPose; - bool mBody; - NxF32 mDensity; - EnumsBlueprint mFlags; - NxActorGroup mGroup; - -#if NX_SDK_VERSION_NUMBER >= 260 - NxString mCompartment; -#endif - - CollisionModel mShapes; - -#if NX_SDK_VERSION_NUMBER >= 272 - NxU16 mDominanceGroup; -#endif - - - ////////////////////////////////////////////////// - - NxMat34 mMassLocalPose; - NxVec3 mMassSpaceInertia; - NxF32 mMass; - NxVec3 mLinearVelocity; - NxVec3 mAngularVelocity; - NxF32 mWakeUpCounter; - NxF32 mLinearDamping; - NxF32 mAngularDamping; - NxF32 mMaxAngularVelocity; - NxF32 mCCDMotionThreshold; - EnumsBlueprint mBodyFlags; - NxF32 mSleepLinearVelocity; - NxF32 mSleepAngularVelocity; - NxU32 mSolverIterationCount; - -#if NX_SDK_VERSION_NUMBER >= 250 - NxF32 mSleepEnergyThreshold; -#endif - -#if NX_SDK_VERSION_NUMBER >= 250 - NxF32 mSleepDamping; -#endif - - ////////////////////////////////////////////////// - - StringPairList mCustomData; - - };// End of ActorBlueprint Class - - }; -};// End of namespace - -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreBlueprint.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreBlueprint.h 2008-06-20 06:57:55 UTC (rev 599) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreBlueprint.h 2008-06-22 02:07:48 UTC (rev 600) @@ -1,48 +0,0 @@ -// -// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. -// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// - -#ifndef __NXOGRE_BLUEPRINT_H__ -#define __NXOGRE_BLUEPRINT_H__ - -#include "NxOgrePrerequisites.h" -#include "NxOgreBlueprint.h" -#include "NxOgreContainer.h" - -namespace NxOgre { - - namespace Blueprints { - - class NxExport Blueprint { - - public: - - Blueprint() {} - ~Blueprint() {} - - virtual void empty() {} - virtual void serialise() {} - virtual void unserialise() {} - - - };// End of Blueprint Class - - }; // End of namespace -}; // End of namespace - -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCompoundActorBlueprint.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCompoundActorBlueprint.cpp 2008-06-20 06:57:55 UTC (rev 599) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCompoundActorBlueprint.cpp 2008-06-22 02:07:48 UTC (rev 600) @@ -1,39 +0,0 @@ -// -// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. -// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// - -#include "NxOgreStable.h" -#include "NxOgreCompoundActorBlueprint.h" - -namespace NxOgre { - -////////////////////////////////////////////////////////// - -CompoundActorBlueprint::CompoundActorBlueprint(ResourceStreamPtr& resourceStream, Scene*) { - -} - -////////////////////////////////////////////////////////// - -CompoundActorBlueprint::~CompoundActorBlueprint() { - -} - -////////////////////////////////////////////////////////// - -} Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreCompoundActorBlueprint.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreCompoundActorBlueprint.h 2008-06-20 06:57:55 UTC (rev 599) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreCompoundActorBlueprint.h 2008-06-22 02:07:48 UTC (rev 600) @@ -1,58 +0,0 @@ -// -// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. -// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// - -#ifndef __NXOGRE_COMPOUND_ACTOR_BLUEPRINT_H__ -#define __NXOGRE_COMPOUND_ACTOR_BLUEPRINT_H__ - -#include "NxOgrePrerequisites.h" -#include "NxOgreParams.h" - - -namespace NxOgre { - - class NxExport CompoundActorBlueprint { - - friend class ResourceSystem; - - public: - - - // @brief Create constructor - CompoundActorBlueprint(const NxString& name, Scene*); - - - // @brief Unserialise from ResourceStream - CompoundActorBlueprint(ResourceStreamPtr& resourceStream, Scene*); - - - // @brief Compound Actor destructor - ~CompoundActorBlueprint(); - - protected: - - // @brief Private Resource Stream. - - private: - - - }; - -}; - -#endif Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreContainer.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreContainer.h 2008-06-20 06:57:55 UTC (rev 599) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreContainer.h 2008-06-22 02:07:48 UTC (rev 600) @@ -2,20 +2,20 @@ * \brief Header for the Container, List and StringPairList classes. * \version 1.0-21 * - * \licence NxOgre a wrapper for the PhysX physics library. - * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software + * \licence NxOgre a wrapper for the PhysX physics library. + * Copyright (C) 2005-8 Robin Southern of NxOgre.org http://www.nxogre.org + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -337,7 +337,7 @@ return; for (TT tt = begin(); tt = next();) { - NxDelete(tt); +// NxDelete(tt); ## can't delete as new physx sdk has this protected.. } /* @@ -373,7 +373,7 @@ for(Iterator tt = mItems.begin();tt != mItems.end();) { - delete (*tt++).second.t; + //delete (*tt++).second.t; } empty(); Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp 2008-06-20 06:57:55 UTC (rev 599) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp 2008-06-22 02:07:48 UTC (rev 600) @@ -1,1191 +0,0 @@ -// -// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. -// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// - -#include "NxOgreStable.h" -#include "NxOgreEnumsBlueprint.h" -#include "NxOgreContainer.h" - -namespace NxOgre { -namespace Blueprints { - -//////////////////////////////////////////////////////////////////////////////////////////////// - -EnumsBlueprint::EnumsBlueprint(EnumType t) : mType(t), mEnum(0) {} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -EnumsBlueprint::EnumsBlueprint(EnumType t, NxU32 f) : mType(t), mEnum(f) {} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void EnumsBlueprint::toDefault() { - empty(); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void EnumsBlueprint::empty() { - mEnum = 0; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void EnumsBlueprint::serialise() { - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::asStringPairList() { - - switch(mType) { - default: {StringList l;return l;} break; - case FT_NxActorFlag: return AsNxActorFlag(); break; - case FT_NxShapeFlag: return AsNxShapeFlag(); break; - case FT_NxCapsuleShapeFlag: return AsNxCapsuleShapeFlag(); break; - case FT_NxWheelShapeFlags: return AsNxWheelShapeFlags(); break; - case FT_NxMeshPagingMode: return AsNxMeshPagingMode(); break; - case FT_NxJointFlag: return AsNxJointFlag(); break; - case FT_NxD6JointMotion: return AsNxD6JointMotion(); break; - case FT_NxD6JointDriveType: return AsNxD6JointDriveType(); break; - case FT_NxJointProjectionMode: return AsNxJointProjectionMode(); break; - case FT_NxD6JointFlag: return AsNxD6JointFlag(); break; - case FT_NxDistanceJointFlag: return AsNxDistanceJointFlag(); break; - case FT_NxRevoluteJointFlag: return AsNxRevoluteJointFlag(); break; - case FT_NxSphericalJointFlag: return AsNxSphericalJointFlag(); break; - case FT_NxPulleyJointFlag: return AsNxPulleyJointFlag(); break; - case FT_NxContactPairFlag: return AsNxContactPairFlag(); break; - case FT_NxFluidSimulationMethod: return AsNxFluidSimulationMethod(); break; - case FT_NxFluidCollisionMethod: return AsNxFluidCollisionMethod(); break; - case FT_NxFluidFlag: return AsNxFluidFlag(); break; - case FT_NxEmitterType: return AsNxEmitterType(); break; - case FT_NxEmitterShape: return AsNxEmitterShape(); break; - case FT_NxFluidEmitterFlag: return AsNxFluidEmitterFlag(); break; - case FT_NxClothFlag: return AsNxClothFlag(); break; - case FT_NxForceFieldCoordinates: return AsNxForceFieldCoordinates(); break; - case FT_NxSceneFlags: return AsNxSceneFlags(); break; - case FT_NxSoftBodyMeshFlags: return AsNxSoftBodyMeshFlags(); break; - case FT_NxSoftBodyVertexFlags: return AsNxSoftBodyVertexFlags(); break; - case FT_NxSoftBodyFlag: return AsNxSoftBodyFlag(); break; - case FT_NxSoftBodyAttachmentFlag: return AsNxSoftBodyAttachmentFlag(); break; - case FT_NxMeshDataFlags: return AsNxMeshDataFlags(); break; - } - - StringList l;return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - - -StringList EnumsBlueprint::AsNxActorFlag() { - - StringList l; - - if (mEnum & NX_AF_DISABLE_COLLISION) - l.insert(NxString("NX_AF_DISABLE_COLLISION")); - - if (mEnum & NX_AF_DISABLE_RESPONSE) - l.insert(NxString("NX_AF_DISABLE_RESPONSE")); - - if (mEnum & NX_AF_LOCK_COM) - l.insert(NxString("NX_AF_LOCK_COM")); - if (mEnum & NX_AF_FLUID_DISABLE_COLLISION) - l.insert(NxString("NX_AF_FLUID_DISABLE_COLLISION")); - -#if NX_SDK_VERSION_NUMBER < 250 - if (mEnum & NX_AF_FLUID_ACTOR_REACTION) - l.insert(NxString("NX_AF_FLUID_ACTOR_REACTION")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_AF_CONTACT_MODIFICATION) - l.insert(NxString("NX_AF_CONTACT_MODIFICATION")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 261 - if (mEnum & NX_AF_FORCE_CONE_FRICTION)l.insert(NxString("NX_AF_FORCE_CONE_FRICTION")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 270 - if (mEnum & NX_AF_USER_ACTOR_PAIR_FILTERING) - l.insert(NxString("NX_AF_USER_ACTOR_PAIR_FILTERING")); -#endif - - return l; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxBodyFlag() { - - StringList l; - - if (mEnum & NX_BF_DISABLE_GRAVITY) - l.insert(NxString("NX_BF_DISABLE_GRAVITY")); - - if (mEnum & NX_BF_FROZEN_POS_X) - l.insert(NxString("NX_BF_FROZEN_POS_X")); - - if (mEnum & NX_BF_FROZEN_POS_Y) - l.insert(NxString("NX_BF_FROZEN_POS_Y")); - - if (mEnum & NX_BF_FROZEN_POS_Z) - l.insert(NxString("NX_BF_FROZEN_POS_Z")); - - if (mEnum & NX_BF_FROZEN_ROT_X) - l.insert(NxString("NX_BF_FROZEN_ROT_X")); - - if (mEnum & NX_BF_FROZEN_ROT_Y) - l.insert(NxString("NX_BF_FROZEN_ROT_Y")); - - if (mEnum & NX_BF_FROZEN_ROT_Z) - l.insert(NxString("NX_BF_FROZEN_ROT_Z")); - - if (mEnum & NX_BF_KINEMATIC) - l.insert(NxString("NX_BF_KINEMATIC")); - - if (mEnum & NX_BF_VISUALIZATION) - l.insert(NxString("NX_BF_VISUALIZATION")); - - if (mEnum & NX_BF_POSE_SLEEP_TEST) - l.insert(NxString("NX_BF_POSE_SLEEP_TEST")); - - if (mEnum & NX_BF_FILTER_SLEEP_VEL) - l.insert(NxString("NX_BF_FILTER_SLEEP_VEL")); - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_BF_ENERGY_SLEEP_TEST) - l.insert(NxString("NX_BF_ENERGY_SLEEP_TEST")); -#endif - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxShapeFlag() { - - StringList l; - - if (mEnum & NX_TRIGGER_ON_ENTER) - l.insert(NxString("NX_TRIGGER_ON_ENTER")); - - if (mEnum & NX_TRIGGER_ON_LEAVE) - l.insert(NxString("NX_TRIGGER_ON_LEAVE")); - - if (mEnum & NX_TRIGGER_ON_STAY) - l.insert(NxString("NX_TRIGGER_ON_STAY")); - - if (mEnum & NX_SF_VISUALIZATION) - l.insert(NxString("NX_SF_VISUALIZATION")); - - if (mEnum & NX_SF_DISABLE_COLLISION) - l.insert(NxString("NX_SF_DISABLE_COLLISION")); - - if (mEnum & NX_SF_FEATURE_INDICES) - l.insert(NxString("NX_SF_FEATURE_INDICES")); - - if (mEnum & NX_SF_DISABLE_RAYCASTING) - l.insert(NxString("NX_SF_DISABLE_RAYCASTING")); - - if (mEnum & NX_SF_POINT_CONTACT_FORCE) - l.insert(NxString("NX_SF_POINT_CONTACT_FORCE")); - - if (mEnum & NX_SF_FLUID_DRAIN) - l.insert(NxString("NX_SF_FLUID_DRAIN")); -#if 0 - if (mEnum & NX_SF_FLUID_DUMMY9) - l.insert(NxString("NX_SF_FLUID_DUMMY9")); -#endif - if (mEnum & NX_SF_FLUID_DISABLE_COLLISION) - l.insert(NxString("NX_SF_FLUID_DISABLE_COLLISION")); - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_SF_FLUID_TWOWAY) - l.insert(NxString("NX_SF_FLUID_TWOWAY")); -#endif - - if (mEnum & NX_SF_DISABLE_RESPONSE) - l.insert(NxString("NX_SF_DISABLE_RESPONSE")); - - if (mEnum & NX_SF_DYNAMIC_DYNAMIC_CCD) - l.insert(NxString("NX_SF_DYNAMIC_DYNAMIC_CCD")); - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_SF_DISABLE_SCENE_QUERIES) - l.insert(NxString("NX_SF_DISABLE_SCENE_QUERIES")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 270 - if (mEnum & NX_SF_CLOTH_DRAIN) - l.insert(NxString("NX_SF_CLOTH_DRAIN")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 270 - if (mEnum & NX_SF_CLOTH_DISABLE_COLLISION) - l.insert(NxString("NX_SF_CLOTH_DISABLE_COLLISION")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 270 - if (mEnum & NX_SF_CLOTH_TWOWAY) - l.insert(NxString("NX_SF_CLOTH_TWOWAY")); -#endif - -#if NX_USE_SOFTBODY_API - if (mEnum & NX_SF_SOFTBODY_DRAIN) - l.insert(NxString("NX_SF_SOFTBODY_DRAIN")); -#endif - -#if NX_USE_SOFTBODY_API - if (mEnum & NX_SF_SOFTBODY_DISABLE_COLLISION) - l.insert(NxString("NX_SF_SOFTBODY_DISABLE_COLLISION")); -#endif - -#if NX_USE_SOFTBODY_API - if (mEnum & NX_SF_SOFTBODY_TWOWAY) - l.insert(NxString("NX_SF_SOFTBODY_TWOWAY")); -#endif - - return l; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxCapsuleShapeFlag() { - - StringList l; - - if (mEnum & NX_SWEPT_SHAPE) - l.insert(NxString("NX_SWEPT_SHAPE")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxWheelShapeFlags() { - - StringList l; - - - if (mEnum & NX_WF_WHEEL_AXIS_CONTACT_NORMAL) - l.insert(NxString("NX_WF_WHEEL_AXIS_CONTACT_NORMAL")); - - if (mEnum & NX_WF_INPUT_LAT_SLIPVELOCITY) - l.insert(NxString("NX_WF_INPUT_LAT_SLIPVELOCITY")); - - if (mEnum & NX_WF_INPUT_LNG_SLIPVELOCITY) - l.insert(NxString("NX_WF_INPUT_LNG_SLIPVELOCITY")); - - if (mEnum & NX_WF_UNSCALED_SPRING_BEHAVIOR) - l.insert(NxString("NX_WF_UNSCALED_SPRING_BEHAVIOR")); - - if (mEnum & NX_WF_AXLE_SPEED_OVERRIDE) - l.insert(NxString("NX_WF_AXLE_SPEED_OVERRIDE")); - -#if NX_SDK_VERSION_NUMBER >= 264 - if (mEnum & NX_WF_EMULATE_LEGACY_WHEEL) - l.insert(NxString("NX_WF_EMULATE_LEGACY_WHEEL")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 264 - if (mEnum & NX_WF_CLAMPED_FRICTION) - l.insert(NxString("NX_WF_CLAMPED_FRICTION")); -#endif - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxMeshPagingMode() { - - StringList l; - - if (mEnum & NX_MESH_PAGING_MANUAL) - l.insert(NxString("NX_MESH_PAGING_MANUAL")); - - if (mEnum & NX_MESH_PAGING_FALLBACK) - l.insert(NxString("NX_MESH_PAGING_FALLBACK")); - - if (mEnum & NX_MESH_PAGING_AUTO) - l.insert(NxString("NX_MESH_PAGING_AUTO")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxJointFlag() { - - StringList l; - - if (mEnum & NX_JF_COLLISION_ENABLED) - l.insert(NxString("NX_JF_COLLISION_ENABLED")); - - if (mEnum & NX_JF_VISUALIZATION) - l.insert(NxString("NX_JF_VISUALIZATION")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxD6JointMotion() { - - StringList l; - - if (mEnum & NX_D6JOINT_MOTION_LOCKED) - l.insert(NxString("NX_D6JOINT_MOTION_LOCKED")); - - if (mEnum & NX_D6JOINT_MOTION_LIMITED) - l.insert(NxString("NX_D6JOINT_MOTION_LIMITED")); - - if (mEnum & NX_D6JOINT_MOTION_FREE) - l.insert(NxString("NX_D6JOINT_MOTION_FREE")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxD6JointDriveType() { - - StringList l; - - if (mEnum & NX_D6JOINT_DRIVE_POSITION) - l.insert(NxString("NX_D6JOINT_DRIVE_POSITION")); - - if (mEnum & NX_D6JOINT_DRIVE_VELOCITY) - l.insert(NxString("NX_D6JOINT_DRIVE_VELOCITY")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxJointProjectionMode() { - - StringList l; - - if (mEnum & NX_JPM_NONE) - l.insert(NxString("NX_JPM_NONE")); - - if (mEnum & NX_JPM_POINT_MINDIST) - l.insert(NxString("NX_JPM_POINT_MINDIST")); - -#if NX_SDK_VERSION_NUMBER >= 260 - if (mEnum & NX_JPM_LINEAR_MINDIST) - l.insert(NxString("NX_JPM_LINEAR_MINDIST")); -#endif - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxD6JointFlag() { - - StringList l; - - if (mEnum & NX_D6JOINT_SLERP_DRIVE) - l.insert(NxString("NX_D6JOINT_SLERP_DRIVE")); - - if (mEnum & NX_D6JOINT_GEAR_ENABLED) - l.insert(NxString("NX_D6JOINT_GEAR_ENABLED")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxDistanceJointFlag() { - - StringList l; - - if (mEnum & NX_DJF_MAX_DISTANCE_ENABLED) - l.insert(NxString("NX_DJF_MAX_DISTANCE_ENABLED")); - - if (mEnum & NX_DJF_MIN_DISTANCE_ENABLED) - l.insert(NxString("NX_DJF_MIN_DISTANCE_ENABLED")); - - if (mEnum & NX_DJF_SPRING_ENABLED) - l.insert(NxString("NX_DJF_SPRING_ENABLED")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxRevoluteJointFlag() { - - StringList l; - - if (mEnum & NX_RJF_LIMIT_ENABLED) - l.insert(NxString("NX_RJF_LIMIT_ENABLED")); - - if (mEnum & NX_RJF_MOTOR_ENABLED) - l.insert(NxString("NX_RJF_MOTOR_ENABLED")); - - if (mEnum & NX_RJF_SPRING_ENABLED) - l.insert(NxString("NX_RJF_SPRING_ENABLED")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxSphericalJointFlag() { - - StringList l; - - if (mEnum & NX_SJF_TWIST_LIMIT_ENABLED) - l.insert(NxString("NX_SJF_TWIST_LIMIT_ENABLED")); - - if (mEnum & NX_SJF_SWING_LIMIT_ENABLED) - l.insert(NxString("NX_SJF_SWING_LIMIT_ENABLED")); - - if (mEnum & NX_SJF_TWIST_SPRING_ENABLED) - l.insert(NxString("NX_SJF_TWIST_SPRING_ENABLED")); - - if (mEnum & NX_SJF_SWING_SPRING_ENABLED) - l.insert(NxString("NX_SJF_SWING_SPRING_ENABLED")); - - if (mEnum & NX_SJF_JOINT_SPRING_ENABLED) - l.insert(NxString("NX_SJF_JOINT_SPRING_ENABLED")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxPulleyJointFlag() { - - StringList l; - - if (mEnum & NX_PJF_IS_RIGID) - l.insert(NxString("NX_PJF_IS_RIGID")); - - if (mEnum & NX_PJF_MOTOR_ENABLED) - l.insert(NxString("NX_PJF_MOTOR_ENABLED")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxContactPairFlag() { - - StringList l; - - if (mEnum & NX_IGNORE_PAIR) - l.insert(NxString("NX_IGNORE_PAIR")); - - if (mEnum & NX_NOTIFY_ON_START_TOUCH) - l.insert(NxString("NX_NOTIFY_ON_START_TOUCH")); - - if (mEnum & NX_NOTIFY_ON_END_TOUCH) - l.insert(NxString("NX_NOTIFY_ON_END_TOUCH")); - - if (mEnum & NX_NOTIFY_ON_TOUCH) - l.insert(NxString("NX_NOTIFY_ON_TOUCH")); - - if (mEnum & NX_NOTIFY_ON_IMPACT) - l.insert(NxString("NX_NOTIFY_ON_IMPACT")); - - if (mEnum & NX_NOTIFY_ON_ROLL) - l.insert(NxString("NX_NOTIFY_ON_ROLL")); - - if (mEnum & NX_NOTIFY_ON_SLIDE) - l.insert(NxString("NX_NOTIFY_ON_SLIDE")); - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_NOTIFY_FORCES) - l.insert(NxString("NX_NOTIFY_FORCES")); -#endif - -#if 0 - if (mEnum & NX_NOTIFY_DUMMY8) - l.insert(NxString("NX_NOTIFY_DUMMY8")); - - if (mEnum & NX_NOTIFY_DUMMY9) - l.insert(NxString("NX_NOTIFY_DUMMY9")); - - if (mEnum & NX_NOTIFY_DUMMY10) - l.insert(NxString("NX_NOTIFY_DUMMY10")); - - if (mEnum & NX_NOTIFY_DUMMY11) - l.insert(NxString("NX_NOTIFY_DUMMY11")); - - if (mEnum & NX_NOTIFY_DUMMY12) - l.insert(NxString("NX_NOTIFY_DUMMY12")); - - if (mEnum & NX_NOTIFY_DUMMY13) - l.insert(NxString("NX_NOTIFY_DUMMY13")); - - if (mEnum & NX_NOTIFY_DUMMY14) - l.insert(NxString("NX_NOTIFY_DUMMY14")); - - if (mEnum & NX_NOTIFY_DUMMY15) - l.insert(NxString("NX_NOTIFY_DUMMY15")); -#endif -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_NOTIFY_CONTACT_MODIFICATION) - l.insert(NxString("NX_NOTIFY_CONTACT_MODIFICATION")); -#endif - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxFluidSimulationMethod() { - - StringList l; - - if (mEnum & NX_F_SPH) - l.insert(NxString("NX_F_SPH")); - - if (mEnum & NX_F_NO_PARTICLE_INTERACTION) - l.insert(NxString("NX_F_NO_PARTICLE_INTERACTION")); - - if (mEnum & NX_F_MIXED_MODE) - l.insert(NxString("NX_F_MIXED_MODE")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxFluidCollisionMethod() { - - StringList l; - - if (mEnum & NX_F_STATIC) - l.insert(NxString("NX_F_STATIC")); - - if (mEnum & NX_F_DYNAMIC) - l.insert(NxString("NX_F_DYNAMIC")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxFluidFlag() { - - StringList l; - - if (mEnum & NX_FF_VISUALIZATION) - l.insert(NxString("NX_FF_VISUALIZATION")); - - if (mEnum & NX_FF_DISABLE_GRAVITY) - l.insert(NxString("NX_FF_DISABLE_GRAVITY")); - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_FF_COLLISION_TWOWAY) - l.insert(NxString("NX_FF_COLLISION_TWOWAY")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_FF_ENABLED) - l.insert(NxString("NX_FF_ENABLED")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_FF_HARDWARE) - l.insert(NxString("NX_FF_HARDWARE")); -#endif - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxEmitterType() { - - StringList l; - - if (mEnum & NX_AF_DISABLE_COLLISION) - l.insert(NxString("NX_AF_DISABLE_COLLISION")); - - if (mEnum & NX_FE_CONSTANT_PRESSURE) - l.insert(NxString("NX_FE_CONSTANT_PRESSURE")); - - if (mEnum & NX_FE_CONSTANT_FLOW_RATE) - l.insert(NxString("NX_FE_CONSTANT_FLOW_RATE")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxEmitterShape() { - - StringList l; - - if (mEnum & NX_FE_RECTANGULAR) - l.insert(NxString("NX_FE_RECTANGULAR")); - - if (mEnum & NX_FE_ELLIPSE) - l.insert(NxString("NX_FE_ELLIPSE")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxFluidEmitterFlag() { - - StringList l; - - if (mEnum & NX_FEF_VISUALIZATION) - l.insert(NxString("NX_FEF_VISUALIZATION")); - -#if NX_SDK_VERSION_NUMBER < 250 - if (mEnum & NX_FEF_BROKEN_ACTOR_REF) - l.insert(NxString("NX_FEF_BROKEN_ACTOR_REF")); -#endif - -#if 0 -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_FEF_DUMMY1) - l.insert(NxString("NX_FEF_DUMMY1")); -#endif -#endif - -#if NX_SDK_VERSION_NUMBER < 260 - if (mEnum & NX_FEF_FORCE_ON_ACTOR) - l.insert(NxString("NX_FEF_FORCE_ON_ACTOR")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 260 - if (mEnum & NX_FEF_FORCE_ON_BODY) - l.insert(NxString("NX_FEF_FORCE_ON_BODY")); -#endif - -#if NX_SDK_VERSION_NUMBER < 260 - if (mEnum & NX_FEF_ADD_ACTOR_VELOCITY) - l.insert(NxString("NX_FEF_ADD_ACTOR_VELOCITY")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 260 - if (mEnum & NX_FEF_ADD_BODY_VELOCITY) - l.insert(NxString("NX_FEF_ADD_BODY_VELOCITY")); -#endif - - if (mEnum & NX_FEF_ENABLED) - l.insert(NxString("NX_FEF_ENABLED")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxClothFlag() { - - StringList l; - - - if (mEnum & NX_CLF_PRESSURE) - l.insert(NxString("NX_CLF_PRESSURE")); - - if (mEnum & NX_CLF_STATIC) - l.insert(NxString("NX_CLF_STATIC")); - - if (mEnum & NX_CLF_DISABLE_COLLISION) - l.insert(NxString("NX_CLF_DISABLE_COLLISION")); - - if (mEnum & NX_CLF_SELFCOLLISION) - l.insert(NxString("NX_CLF_SELFCOLLISION")); - - if (mEnum & NX_CLF_VISUALIZATION) - l.insert(NxString("NX_CLF_VISUALIZATION")); - - if (mEnum & NX_CLF_GRAVITY) - l.insert(NxString("NX_CLF_GRAVITY")); - - if (mEnum & NX_CLF_BENDING) - l.insert(NxString("NX_CLF_BENDING")); - - if (mEnum & NX_CLF_BENDING_ORTHO) - l.insert(NxString("NX_CLF_BENDING_ORTHO")); - - if (mEnum & NX_CLF_DAMPING) - l.insert(NxString("NX_CLF_DAMPING")); - - if (mEnum & NX_CLF_COLLISION_TWOWAY) - l.insert(NxString("NX_CLF_COLLISION_TWOWAY")); - -#if 0 - if (mEnum & NX_CLF_DUMMY1) - l.insert(NxString("NX_CLF_DUMMY1")); -#endif - - if (mEnum & NX_CLF_TRIANGLE_COLLISION) - l.insert(NxString("NX_CLF_TRIANGLE_COLLISION")); - - if (mEnum & NX_CLF_TEARABLE) - l.insert(NxString("NX_CLF_TEARABLE")); - - if (mEnum & NX_CLF_HARDWARE) - l.insert(NxString("NX_CLF_HARDWARE")); - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_CLF_COMDAMPING) - l.insert(NxString("NX_CLF_COMDAMPING")); -#endif -#if NX_SDK_VERSION_NUMBER >= 270 - if (mEnum & NX_CLF_VALIDBOUNDS) - l.insert(NxString("NX_CLF_VALIDBOUNDS")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 270 - if (mEnum & NX_CLF_FLUID_COLLISION) - l.insert(NxString("NX_CLF_FLUID_COLLISION")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 280 - if (mEnum & NX_CLF_ADHERE) - l.insert(NxString("NX_CLF_ADHERE")); -#endif - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxForceFieldCoordinates() { - - StringList l; - - if (mEnum & NX_FFC_CARTESIAN) - l.insert(NxString("NX_FFC_CARTESIAN")); - - if (mEnum & NX_FFC_SPHERICAL) - l.insert(NxString("NX_FFC_SPHERICAL")); - - if (mEnum & NX_FFC_CYLINDRICAL) - l.insert(NxString("NX_FFC_CYLINDRICAL")); - - if (mEnum & NX_FFC_TOROIDAL) - l.insert(NxString("NX_FFC_TOROIDAL")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxSceneFlags() { - - StringList l; - - if (mEnum & NX_SF_DISABLE_SSE) - l.insert(NxString("NX_SF_DISABLE_SSE")); - - if (mEnum & NX_SF_DISABLE_COLLISIONS) - l.insert(NxString("NX_SF_DISABLE_COLLISIONS")); - - if (mEnum & NX_SF_SIMULATE_SEPARATE_THREAD) - l.insert(NxString("NX_SF_SIMULATE_SEPARATE_THREAD")); - - if (mEnum & NX_SF_ENABLE_MULTITHREAD) - l.insert(NxString("NX_SF_ENABLE_MULTITHREAD")); - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_SF_ENABLE_ACTIVETRANSFORMS) - l.insert(NxString("NX_SF_ENABLE_ACTIVETRANSFORMS")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_SF_RESTRICTED_SCENE) - l.insert(NxString("NX_SF_RESTRICTED_SCENE")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 250 - if (mEnum & NX_SF_DISABLE_SCENE_MUTEX) - l.insert(NxString("NX_SF_DISABLE_SCENE_MUTEX")); -#endif - -#if NX_SDK_VERSION_NUMBER >= 261 - if (mEnum & NX_SF_FORCE_CONE_FRICTION) - l.insert(NxString("NX_SF_FORCE_CONE_FRICTION")); -#endif - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxSoftBodyMeshFlags() { - - StringList l; - -#if 0 - if (mEnum & NX_SOFTBODY_MESH_DUMMY) - l.insert(NxString("NX_SOFTBODY_MESH_DUMMY")); -#endif - - if (mEnum & NX_SOFTBODY_MESH_16_BIT_INDICES) - l.insert(NxString("NX_SOFTBODY_MESH_16_BIT_INDICES")); - - if (mEnum & NX_SOFTBODY_MESH_TEARABLE) - l.insert(NxString("NX_SOFTBODY_MESH_TEARABLE")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxSoftBodyVertexFlags() { - - StringList l; - -#if 0 - if (mEnum & NX_SOFTBODY_VERTEX_DUMMY0) - l.insert(NxString("NX_SOFTBODY_VERTEX_DUMMY0")); - - if (mEnum & NX_SOFTBODY_VERTEX_DUMMY1) - l.insert(NxString("NX_SOFTBODY_VERTEX_DUMMY1")); - - if (mEnum & NX_SOFTBODY_VERTEX_DUMMY2) - l.insert(NxString("NX_SOFTBODY_VERTEX_DUMMY2")); - - if (mEnum & NX_SOFTBODY_VERTEX_DUMMY3) - l.insert(NxString("NX_SOFTBODY_VERTEX_DUMMY3")); - - if (mEnum & NX_SOFTBODY_VERTEX_DUMMY4) - l.insert(NxString("NX_SOFTBODY_VERTEX_DUMMY4")); - - if (mEnum & NX_SOFTBODY_VERTEX_DUMMY5) - l.insert(NxString("NX_SOFTBODY_VERTEX_DUMMY5")); - - if (mEnum & NX_SOFTBODY_VERTEX_DUMMY6) - l.insert(NxString("NX_SOFTBODY_VERTEX_DUMMY6")); -#endif - - if (mEnum & NX_SOFTBODY_VERTEX_TEARABLE) - l.insert(NxString("NX_SOFTBODY_VERTEX_TEARABLE")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxSoftBodyFlag() { - - StringList l; - - -#if 0 - if (mEnum & NX_SBF_DUMMY0) - l.insert(NxString("NX_SBF_DUMMY0")); -#endif - - if (mEnum & NX_SBF_STATIC) - l.insert(NxString("NX_SBF_STATIC")); - - if (mEnum & NX_SBF_DISABLE_COLLISION) - l.insert(NxString("NX_SBF_DISABLE_COLLISION")); - - if (mEnum & NX_SBF_SELFCOLLISION) - l.insert(NxString("NX_SBF_SELFCOLLISION")); - - if (mEnum & NX_SBF_VISUALIZATION) - l.insert(NxString("NX_SBF_VISUALIZATION")); - - if (mEnum & NX_SBF_GRAVITY) - l.insert(NxString("NX_SBF_GRAVITY")); - - if (mEnum & NX_SBF_VOLUME_CONSERVATION) - l.insert(NxString("NX_SBF_VOLUME_CONSERVATION")); - - if (mEnum & NX_SBF_DAMPING) - l.insert(NxString("NX_SBF_DAMPING")); - - if (mEnum & NX_SBF_COLLISION_TWOWAY) - l.insert(NxString("NX_SBF_COLLISION_TWOWAY")); - - if (mEnum & NX_SBF_TEARABLE) - l.insert(NxString("NX_SBF_TEARABLE")); - - if (mEnum & NX_SBF_HARDWARE) - l.insert(NxString("NX_SBF_HARDWARE")); - - if (mEnum & NX_SBF_COMDAMPING) - l.insert(NxString("NX_SBF_COMDAMPING")); - - if (mEnum & NX_SBF_VALIDBOUNDS) - l.insert(NxString("NX_SBF_VALIDBOUNDS")); - - if (mEnum & NX_SBF_FLUID_COLLISION) - l.insert(NxString("NX_SBF_FLUID_COLLISION")); - -#if NX_SDK_VERSION_NUMBER >= 280 - if (mEnum & NX_SBF_ADHERE) - l.insert(NxString("NX_SBF_ADHERE")); -#endif - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxSoftBodyAttachmentFlag() { - - StringList l; - - if (mEnum & NX_SOFTBODY_ATTACHMENT_TWOWAY) - l.insert(NxString("NX_SOFTBODY_ATTACHMENT_TWOWAY")); - - if (mEnum & NX_SOFTBODY_ATTACHMENT_TEARABLE) - l.insert(NxString("NX_SOFTBODY_ATTACHMENT_TEARABLE")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxMeshDataFlags() { - - StringList l; - - if (mEnum & NX_MDF_16_BIT_INDICES) - l.insert(NxString("NX_MDF_16_BIT_INDICES")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxCombineMode() { - - StringList l; - - if (mEnum & NX_CM_AVERAGE) - l.insert(NxString("NX_CM_AVERAGE")); - - if (mEnum & NX_CM_MIN) - l.insert(NxString("NX_CM_MIN")); - - if (mEnum & NX_CM_MULTIPLY) - l.insert(NxString("NX_CM_MULTIPLY")); - - if (mEnum & NX_CM_MAX) - l.insert(NxString("NX_CM_MAX")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxMaterialFlag() { - - StringList l; - - if (mEnum & NX_MF_ANISOTROPIC) - l.insert(NxString("NX_MF_ANISOTROPIC")); - -#if 0 - if (mEnum & NX_MF_DUMMY1) - l.insert(NxString("NX_MF_DUMMY1")); - - if (mEnum & NX_MF_DUMMY2) - l.insert(NxString("NX_MF_DUMMY2")); - - if (mEnum & NX_MF_DUMMY3) - l.insert(NxString("NX_MF_DUMMY3")); -#endif - - if (mEnum & NX_MF_DISABLE_FRICTION) - l.insert(NxString("NX_MF_DISABLE_FRICTION")); - - if (mEnum & NX_MF_DISABLE_STRONG_FRICTION) - l.insert(NxString("NX_MF_DISABLE_STRONG_FRICTION")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxMeshShapeFlag() { - - StringList l; - - if (mEnum & NX_MESH_SMOOTH_SPHERE_COLLISIONS) - l.insert(NxString("NX_MESH_SMOOTH_SPHERE_COLLISIONS")); - - if (mEnum & NX_MESH_DOUBLE_SIDED) - l.insert(NxString("NX_MESH_DOUBLE_SIDED")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxPruningStructure() { - - StringList l; - - if (mEnum & NX_PRUNING_NONE) - l.insert(NxString("NX_PRUNING_NONE")); - - if (mEnum & NX_PRUNING_OCTREE) - l.insert(NxString("NX_PRUNING_OCTREE")); - - if (mEnum & NX_PRUNING_QUADTREE) - l.insert(NxString("NX_PRUNING_QUADTREE")); - - if (mEnum & NX_PRUNING_DYNAMIC_AABB_TREE) - l.insert(NxString("NX_PRUNING_DYNAMIC_AABB_TREE")); - - if (mEnum & NX_PRUNING_STATIC_AABB_TREE) - l.insert(NxString("NX_PRUNING_STATIC_AABB_TREE")); - - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxThreadPriority() { - - StringList l; - - if (mEnum & NX_TP_HIGH) - l.insert(NxString("NX_TP_HIGH")); - - if (mEnum & NX_TP_ABOVE_NORMAL) - l.insert(NxString("NX_TP_ABOVE_NORMAL")); - - if (mEnum & NX_TP_NORMAL) - l.insert(NxString("NX_TP_NORMAL")); - - if (mEnum & NX_TP_BELOW_NORMAL) - l.insert(NxString("NX_TP_BELOW_NORMAL")); - - if (mEnum & NX_TP_LOW) - l.insert(NxString("NX_TP_LOW")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxSimulationType() { - - StringList l; - - if (mEnum & NX_SIMULATION_HW) - l.insert(NxString("NX_SIMULATION_HW")); - - if (mEnum & NX_SIMULATION_SW) - l.insert(NxString("NX_SIMULATION_SW")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxTimeStepMethod() { - - StringList l; - - if (mEnum & NX_TIMESTEP_FIXED) - l.insert(NxString("NX_TIMESTEP_FIXED")); - - if (mEnum & NX_TIMESTEP_VARIABLE) - l.insert(NxString("NX_TIMESTEP_VARIABLE")); - - if (mEnum & NX_TIMESTEP_INHERIT) - l.insert(NxString("NX_TIMESTEP_INHERIT")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -StringList EnumsBlueprint::AsNxFilterOp() { - - StringList l; - - if (mEnum & NX_FILTEROP_AND) - l.insert(NxString("NX_FILTEROP_AND")); - - if (mEnum & NX_FILTEROP_OR) - l.insert(NxString("NX_FILTEROP_OR")); - - if (mEnum & NX_FILTEROP_XOR) - l.insert(NxString("NX_FILTEROP_XOR")); - - if (mEnum & NX_FILTEROP_NAND) - l.insert(NxString("NX_FILTEROP_NAND")); - - if (mEnum & NX_FILTEROP_NOR) - l.insert(NxString("NX_FILTEROP_NOR")); - - if (mEnum & NX_FILTEROP_NXOR) - l.insert(NxString("NX_FILTEROP_NXOR")); - - if (mEnum & NX_FILTEROP_SWAP_AND) - l.insert(NxString("NX_FILTEROP_SWAP_AND")); - - return l; - -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -} //End of Serialiser namespace. -} //End of NxOgre namespace. Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.h 2008-06-20 06:57:55 UTC (rev 599) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.h 2008-06-22 02:07:48 UTC (rev 600) @@ -1,136 +0,0 @@ -// -// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. -// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// - -#ifndef __NXOGRE_ENUMS_BLUEPRINT_H__ -#define __NXOGRE_ENUMS_BLUEPRINT_H__ - -#include "NxOgrePrerequisites.h" -#include "NxOgreBlueprint.h" - -namespace NxOgre { - - namespace Blueprints { - - class NxExport EnumsBlueprint : public Blueprint { - - public: - - enum EnumType { - FT_Unknown, - FT_NxActorFlag, - FT_NxBodyFlag, - FT_NxShapeFlag, - FT_NxCapsuleShapeFlag, - FT_NxWheelShapeFlags, - FT_NxMeshPagingMode, - FT_NxJointFlag, - FT_NxD6JointMotion, - FT_NxD6JointDriveType, - FT_NxJointProjectionMode, - FT_NxD6JointFlag, - FT_NxDistanceJointFlag, - FT_NxRevoluteJointFlag, - FT_NxSphericalJointFlag, - FT_NxPulleyJointFlag, - FT_NxContactPairFlag, - FT_NxFluidSimulationMethod, - FT_NxFluidCollisionMethod, - FT_NxFluidFlag, - FT_NxEmitterType, - FT_NxEmitterShape, - FT_NxFluidEmitterFlag, - FT_NxClothFlag, - FT_NxForceFieldCoordinates, - FT_NxSceneFlags, - FT_NxSoftBodyMeshFlags, - FT_NxSoftBodyVertexFlags, - FT_NxSoftBodyFlag, - FT_NxSoftBodyAttachmentFlag, - FT_NxMeshDataFlags, - FT_NxCombineMode, - FT_NxMaterialFlag, - FT_NxMeshShapeFlag, - FT_NxPruningStructure, - FT_NxThreadPriority, - FT_NxSimulationType, - FT_NxTimeStepMethod, - FT_NxFilterOp - }; - - EnumsBlueprint(){mType = FT_Unknown; mEnum = 0;} - EnumsBlueprint(EnumType); - EnumsBlueprint(EnumType, NxU32 flag); - - void toDefault(); - void empty(); - void serialise(); - NxU32 getFlag() {return mEnum;} - void setFlag(EnumType t, NxU32 f) {mType = t;mEnum = f;} - void setFlag(NxU32 f) {mEnum = f;} - - StringList asStringPairList(); - - StringList AsNxActorFlag(); - StringList AsNxBodyFlag(); - StringList AsNxShapeFlag(); - StringList AsNxCapsuleShapeFlag(); - StringList AsNxWheelShapeFlags(); - StringList AsNxMeshPagingMode(); - StringList AsNxJointFlag(); - StringList AsNxD6JointMotion(); - StringList AsNxD6JointDriveType(); - StringList AsNxJointProjectionMode(); - StringList AsNxD6JointFlag(); - StringList AsNxDistanceJointFlag(); - StringList AsNxRevoluteJointFlag(); - StringList AsNxSphericalJointFlag(); - StringList AsNxPulleyJointFlag(); - StringList AsNxContactPairFlag(); - StringList AsNxFluidSimulationMethod(); - StringList AsNxFluidCollisionMethod(); - StringList AsNxFluidFlag(); - StringList AsNxEmitterType(); - StringList AsNxEmitterShape(); - StringList AsNxFluidEmitterFlag(); - StringList AsNxClothFlag(); - StringList AsNxForceFieldCoordinates(); - StringList AsNxSceneFlags(); - StringList AsNxSoftBodyMeshFlags(); - StringList AsNxSoftBodyVertexFlags(); - StringList AsNxSoftBodyFlag(); - StringList AsNxSoftBodyAttachmentFlag(); - StringList AsNxMeshDataFlags(); - StringList AsNxCombineMode(); - StringList AsNxMaterialFlag(); - StringList AsNxMeshShapeFlag(); - StringList AsNxPruningStructure(); - StringList AsNxThreadPriority(); - StringList AsNxSimulationType(); - StringList AsNxTimeStepMethod(); - StringList AsNxFilterOp(); - - - NxU32 mEnum; - EnumType mType; - }; - - }; // End of namespace -};// End of namespace - -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreParametersBlueprint.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreParametersBlueprint.h 2008-06-20 06:57:55 UTC (rev 599) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreParametersBlueprint.h 2008-06-22 02:07:48 UTC (rev 600) @@ -1,43 +0,0 @@ -// -// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine. -// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// - -#ifndef __NXOGRE_FLAGS_BLUEPRINT_H__ -#define __NXOGRE_FLAGS_BLUEPRINT_H__ - -#include "NxOgrePrerequisites.h" - -namespace NxOgre { - - namespace Blueprints { - - class NxExport Blueprint { - - public: - - void toDefault(); - void empty(); - void unserialise(); - void serialise(); - - }; - - }; // End of namespace -};// End of namespace - -#endif Deleted: trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneBlueprint.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneBlueprint.cpp 2008-06-20 06:57:55 UTC (rev 599) +++ trunk/python-ogre/Thi... [truncated message content] |