[Python-ogre-commit] SF.net SVN: python-ogre: [422] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
From: <and...@us...> - 2007-10-14 07:54:00
|
Revision: 422 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=422&view=rev Author: andy_miller Date: 2007-10-14 00:54:01 -0700 (Sun, 14 Oct 2007) Log Message: ----------- NxOgre moved to Thirdparty to make the linux build possible (hopefully) Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/code_generators/nxogre/generate_code.py trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/ThirdParty/nxogre/ 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/NxOgreActorBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreActorBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreBlueprint.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/NxOgreCharacterHitReport.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterHitReport.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/NxOgreClothRaycaster.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/NxOgreContainer.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/NxOgreDominanceGroup.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreDominanceGroup.h trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreEnumsBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreError.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreError.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFluid.cpp 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/NxOgreForceField.h 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/NxOgreHelper.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreHelper.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/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/NxOgreJoint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJoint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJointSet1.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJointSet1.h 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/NxOgreLog.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterial.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterial.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMeshManager.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMeshManager.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMotor.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMotor.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/NxOgreParametersBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreParams.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreParams.h 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/NxOgreRemoteDebuggerConnection.h 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/NxOgreSceneBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneContactController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneContactController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneTriggerController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneTriggerController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSerialiser.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSerialiser.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/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/NxOgreShapeConvex.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeConvex.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeDescription.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeDescriptionConvex.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeDescriptionMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeDescriptionPrimitives.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeDescriptionTerrain.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeDescriptionWheel.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/NxOgreSkeleton.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/NxOgreState.h trunk/python-ogre/ThirdParty/nxogre/NxOgreStateMachine.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSummary.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSummary.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTesting.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTesting.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTrigger.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 trunk/python-ogre/ThirdParty/nxogre/NxOgreWorldBlueprint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreWorldBlueprint.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/ trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_Asc2Bin.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_Asc2Bin.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_ColladaExport.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_ColladaExport.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_ColladaImport.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_ColladaImport.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_File.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_File.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_Geometry.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_Geometry.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_GraphicsMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_GraphicsMesh.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_PhysicsExport.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_PhysicsExport.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_PhysicsInstantiator.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_PhysicsInstantiator.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_Schema.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_Schema.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_SchemaStream.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_SchemaStream.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_SchemaTypes.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_Streaming.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_Streaming.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_cooking.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_cooking.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_customcopy.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_customcopy.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_helper.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_helper.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_hull.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_hull.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_string.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_string.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_tinystr.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_tinystr.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_tinyxml.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_tinyxml.h trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_tinyxmlerror.cpp trunk/python-ogre/ThirdParty/nxogre/NxuStream2/NXU_tinyxmlparser.cpp Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2007-10-14 04:33:53 UTC (rev 421) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2007-10-14 07:54:01 UTC (rev 422) @@ -45,9 +45,10 @@ PATH_plib = os.path.join(PATH_THIRDPARTY, 'plib') PATH_et = os.path.join(PATH_THIRDPARTY, 'et') PATH_caelum = os.path.join(PATH_THIRDPARTY, 'caelum') +PATH_NxOgre= os.path.join(PATH_THIRDPARTY, 'nxogre') +# PATH_NxOgre= os.path.join(BASE_DIR, 'nxogre/NxOgre') PATH_ogrevideoffmpeg = os.path.join(PATH_THIRDPARTY,'ffmpeg') -PATH_NxOgre= os.path.join(BASE_DIR, 'nxogre/NxOgre') PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.62') PATH_PhysX= "c:/program files/AGEIA Technologies/SDK/v2.7.2/SDKs" PATH_Theora= os.path.join(PATH_OgreAddons,'videoplugin','TheoraVideo') @@ -80,7 +81,7 @@ PATH_LIB_OgreAL = os.path.join( PATH_OGREAL)#, 'lib/Release' ) PATH_LIB_betagui = PATH_betagui PATH_LIB_quickgui = PATH_quickgui -PATH_LIB_NxOgre= os.path.join(PATH_NxOgre, 'lib') +# PATH_LIB_NxOgre= os.path.join(PATH_NxOgre, 'lib') PATH_LIB_PhysX = os.path.join(PATH_PhysX,'lib/win32') PATH_LIB_Bullet = os.path.join(PATH_Bullet, 'out/release8/libs' ) PATH_LIB_Theora= os.path.join(PATH_Theora, 'bin', 'Release') @@ -124,7 +125,8 @@ PATH_INCLUDE_FMOD = os.path.join(PATH_FMOD, 'api/inc') PATH_INCLUDE_Ogre_CEGUIRenderer = os.path.join( PATH_Ogre, 'samples/Common/CEGUIRenderer/include') PATH_INCLUDE_quickgui = PATH_quickgui -PATH_INCLUDE_NxOgre= os.path.join(PATH_NxOgre, 'include') +PATH_INCLUDE_NxOgre= PATH_NxOgre +# PATH_INCLUDE_NxOgre= os.path.join(PATH_NxOgre, 'include') PATH_INCLUDE_Bullet= os.path.join(PATH_Bullet, 'src') PATH_INCLUDE_freetype= os.path.join(PATH_INCLUDE_quickgui,'FreeType2.3.5') PATH_INCLUDE_betagui = PATH_betagui Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2007-10-14 04:33:53 UTC (rev 421) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2007-10-14 07:54:01 UTC (rev 422) @@ -51,7 +51,8 @@ PATH_caelum = os.path.join(PATH_THIRDPARTY, 'caelum') PATH_ogrevideoffmpeg = os.path.join(PATH_THIRDPARTY,'ffmpeg') -PATH_NxOgre= os.path.join(BASE_DIR, 'nxogre/NxOgre') +PATH_NxOgre= os.path.join(PATH_THIRDPARTY, 'nxogre') +# PATH_NxOgre= os.path.join(BASE_DIR, 'nxogre/NxOgre') PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.62') PATH_PhysX= os.path.join(BASE_DIR, 'AGEIA Technologies/SDK/v2.7.2/SDKs') PATH_Theora= os.path.join(PATH_OgreAddons,'videoplugin','TheoraVideo') @@ -80,7 +81,7 @@ PATH_LIB_OgreAL = os.path.join( LOCAL_LIB ) #PATH_OGREAL, 'lib/Release' ) PATH_LIB_betagui = PATH_betagui PATH_LIB_quickgui = PATH_quickgui -PATH_LIB_NxOgre= os.path.join(LOCAL_LIB ) +# PATH_LIB_NxOgre= os.path.join(LOCAL_LIB ) PATH_LIB_PhysX = os.path.join(LOCAL_LIB) PATH_LIB_Bullet = os.path.join( LOCAL_LIB ) PATH_LIB_Theora= os.path.join(PATH_Theora, 'bin', 'Release') @@ -117,7 +118,8 @@ PATH_INCLUDE_FMOD = "" PATH_INCLUDE_Ogre_CEGUIRenderer = os.path.join( PATH_Ogre, 'Samples/Common/CEGUIRenderer/include') PATH_INCLUDE_quickgui = PATH_quickgui -PATH_INCLUDE_NxOgre= os.path.join(PATH_NxOgre, 'include') +PATH_INCLUDE_NxOgre= PATH_NxOgre +# PATH_INCLUDE_NxOgre= os.path.join(PATH_NxOgre, 'include') PATH_INCLUDE_Bullet = os.path.join( LOCAL_INCLUDE ) PATH_INCLUDE_betagui = PATH_betagui PATH_INCLUDE_Theora = os.path.join (PATH_Theora,'include') Added: trunk/python-ogre/ThirdParty/nxogre/NxOgre.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgre.h (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgre.h 2007-10-14 07:54:01 UTC (rev 422) @@ -0,0 +1,90 @@ +// +// 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_H__ +#define __NXOGRE_H__ + +/////////////////////////////////////////// + +#include "NxOgreStable.h" +#include "NxOgrePrerequisites.h" +#include "NxOgrePhysXDriver.h" +#include "NxOgreError.h" +#include "NxOgreLog.h" + +/////////////////////////////////////////// + +#include "NxOgreActor.h" +#include "NxOgreActorBlueprint.h" +#include "NxOgreBody.h" +#include "NxOgreContainer.h" +#include "NxOgreCooking.h" +#include "NxOgreCharacter.h" +#include "NxOgreCharacterController.h" +#include "NxOgreCharacterHitReport.h" +#include "NxOgreCloth.h" +#include "NxOgreClothRaycaster.h" +#include "NxOgreCompound.h" +#include "NxOgreDebugRenderer.h" +#include "NxOgreDominanceGroup.h" +#include "NxOgreEnumsBlueprint.h" +#include "NxOgreFluid.h" +#include "NxOgreFluidMesh.h" +#include "NxOgreForceField.h" +#include "NxOgreGroup.h" +#include "NxOgreHelpers.h" +#include "NxOgreJointSet1.h" +#include "NxOgreJointSet2.h" +#include "NxOgreHelper.h" +#include "NxOgreIntersection.h" +#include "NxOgreMaterial.h" +#include "NxOgreMotor.h" +#include "NxOgreParams.h" +#include "NxOgrePose.h" +#include "NxOgreRaycaster.h" +#include "NxOgreRemoteDebuggerConnection.h" +#include "NxOgreSerialiser.h" +#include "NxOgreScene.h" +#include "NxOgreSceneBlueprint.h" +#include "NxOgreSceneController.h" +#include "NxOgreSceneContactController.h" +#include "NxOgreShape.h" +#include "NxOgreShapeBlueprint.h" +#include "NxOgreShapeBlueprintConvex.h" +#include "NxOgreShapeBlueprintMesh.h" +#include "NxOgreShapeBlueprintPrimitives.h" +#include "NxOgreShapeBlueprintTerrain.h" +#include "NxOgreShapeBlueprintWheel.h" +#include "NxOgreShapeConvex.h" +#include "NxOgreShapeMesh.h" +#include "NxOgreShapePrimitives.h" +#include "NxOgreShapeTerrain.h" +#include "NxOgreShapeWheel.h" +#include "NxOgreSimpleShape.h" +#include "NxOgreSoftBody.h" +#include "NxOgreState.h" +#include "NxOgreStateMachine.h" +#include "NxOgreTesting.h" +#include "NxOgreTrigger.h" +#include "NxOgreUserStream.h" +#include "NxOgreUserAllocator.h" +#include "NxOgreWorld.h" +#include "NxOgreWorldBlueprint.h" + +#endif Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.cpp 2007-10-14 07:54:01 UTC (rev 422) @@ -0,0 +1,1117 @@ +// +// 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 "NxOgreActor.h" +#include "NxOgreActorBlueprint.h" +#include "NxOgreUserData.h" // For NxActorUserData for NxActor +#include "NxOgrePose.h" // For conversions +#include "NxOgreHelpers.h" // For conversions +#include "NxOgreScene.h" // For Actor::mOwner +#include "NxOgreShapeBlueprint.h" // For ShapeBlueprint System +#include "NxOgreDominanceGroup.h" // For Dominance Groups +#include "NxOgreGroup.h" // For ActorGroup and ShapeGroups +#include "NxOgreContainer.h" // For Getting an ActorGroup +#include "NxOgreActorBlueprint.h" // For Quick Duplication. + +namespace NxOgre { + +////////////////////////////////////////////////////////// + +void ActorParams::setToDefault() { + + mDensity = 0.0f; + mActorFlags = 0; + mGroupAsIndex = 0; + mGroupAsName = ""; +#if NX_SDK_VERSION_NUMBER >= 272 + mDominanceGroupAsIndex = 0; + mDominanceGroupAsName = ""; +#endif +#if NX_SDK_VERSION_NUMBER >= 260 + 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; + + mNodeScale = Ogre::Vector3(1,1,1); + mNodeName = ""; + mNodeShadows = true; + +} + +////////////////////////////////////////////////////////// + +void ActorParams::parse(Parameters P) { + + for (Parameters::iterator p = P.begin(); p != P.end();p++) { + + if ((*p).first == "static") { + if ( (*p).second.substr(0,1) == "y" || (*p).second.substr(0,1) == "Y") { + mMass = 0; + mDensity = 0; + continue; + } + else { + mMass = 10; + mDensity = 0; + } + } + + if ((*p).first == "kinematic") { + if ( (*p).second.substr(0,1) == "y" || (*p).second.substr(0,1) == "Y") { + mBodyFlags |= NX_BF_KINEMATIC; + if (mMass == 0 || mDensity == 0) { + mMass = 1; + mDensity = 0; + } + } + } + + if (Set("density", (*p), mDensity)) continue; + if (Set("group", (*p), mGroupAsName)) continue; + if (Set("group-index", (*p), mGroupAsIndex)) continue; +#if NX_SDK_VERSION_NUMBER >= 272 + if (Set("dominancegroup", (*p), mDominanceGroupAsName)) continue; + if (Set("dominancegroup-index", (*p), mDominanceGroupAsIndex)) continue; +#endif + if (Set("massspaceinertia", (*p), mMassSpaceInertia)) continue; + if (Set("linearvelocity", (*p), mLinearVelocity)) continue; + if (Set("angularvelocity", (*p), mAngularVelocity)) continue; + if (Set("wakeupcounter", (*p), mWakeUpCounter)) continue; + if (Set("mass", (*p), mMass)) continue; + if (Set("lineardamping", (*p), mLinearDamping)) continue; + if (Set("angulardamping", (*p), mAngularDamping)) continue; + if (Set("maxangularvelocity", (*p), mMaxAngularVelocity)) continue; + if (Set("sleepangularvelocity", (*p), mSleepAngularVelocity)) continue; + if (Set("ccdmotionthreshold", (*p), mCCDMotionThreshold)) continue; + if (Set("solveriterationcount", (*p), mSolverIterationCount)) continue; + if (Set("sleepenergythreshold", (*p), mSleepEnergyThreshold)) continue; + if (Set("sleepdamping", (*p), mSleepDamping)) continue; + if (Set("node-scale", (*p), mNodeScale)) continue; + if (Set("node-shadows", (*p), mNodeShadows)) continue; + if (Set("node", (*p), mNodeName)) continue; + + } + +} + +////////////////////////////////////////////////////////// + +void ActorParams::fromNxActorDesc(NxActorDesc& desc) { + + mDensity = desc.density; + mActorFlags = desc.flags; + mGroupAsIndex = desc.group; +#if NX_SDK_VERSION_NUMBER >= 272 + mDominanceGroupAsIndex = desc.dominanceGroup; +#endif +#if NX_SDK_VERSION_NUMBER >= 260 + mCompartment = desc.compartment; +#endif +} + +////////////////////////////////////////////////////////// + +void ActorParams::fromNxBodyDesc(NxBodyDesc& desc) { + + mMassLocalPose = desc.massLocalPose; + mMassSpaceInertia = desc.massSpaceInertia; + mLinearVelocity = desc.linearVelocity; + mAngularVelocity = desc.angularVelocity; + mWakeUpCounter = desc.wakeUpCounter; + mMass = desc.mass; + mLinearDamping = desc.linearDamping; + mAngularDamping = desc.angularDamping; + mMaxAngularVelocity = desc.maxAngularVelocity; + mBodyFlags = desc.flags; + mSleepLinearVelocity = desc.sleepLinearVelocity; + mSleepAngularVelocity = desc.sleepAngularVelocity; + mCCDMotionThreshold = desc.CCDMotionThreshold; + mSolverIterationCount = desc.solverIterationCount; + mBodyFlags = desc.flags; + mSleepEnergyThreshold = desc.sleepEnergyThreshold; + mSleepDamping = desc.sleepDamping; + +} + +////////////////////////////////////////////////////////// + +Actor::Actor(const NxString& Identifier, Scene* scene, bool isActorBased) : mName(Identifier), mOwner(scene) { + mActor = 0; + if (isActorBased) + mOwner->_registerActor(mName, this); +} + +////////////////////////////////////////////////////////// + +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 { + + std::vector<NxString> splitID = Ogre::StringUtil::split(name, ";", 2); + + NxString identifier; + + if (splitID.size() == 1) { + identifier = name; + mVisualIdentifier = name; + } + else { + identifier = splitID[0]; + mVisualIdentifier = splitID[1]; + Ogre::StringUtil::trim(mVisualIdentifier); + } + + Ogre::StringUtil::trim(identifier); + + if (identifier.substr(0,1) == ">") { + mName = identifier.substr(1, identifier.length() - 1); + if (scene->getActors()->has(mName)) { + NxThrow_Error("Duplicate Actor with identifier '" + mName + "' found!"); + } + + } + else if (scene->getActors()->has(identifier)) { + // Generate a identifier based on the the suggested name. + // i.e. + // myBody -> myBody 1 + // myBody10 -> myBody 11 + + Actors actors; + scene->getActors()->CopyTo(actors); + + NxU32 highest = 0; + NxString workingName; + for(Actor* a = actors.begin();a = actors.next();) { + if (Ogre::StringUtil::startsWith(a->getName(), identifier, false)) { + workingName = a->getName(); + workingName = workingName.substr(identifier.length(), workingName.length() - identifier.length()); + std::stringstream ss(workingName); + NxU32 current = 0; + ss >> current; + if (current > highest) + highest = current; + } + } + + highest++; + mName = identifier; + mName.append(Ogre::StringConverter::toString(highest)); + } + else { + mName = identifier; + } + } + + _createActor(shape,pose,params); + mOwner->_registerActor(mName, this); +} + +////////////////////////////////////////////////////////// + +Actor::~Actor() { + + mOwner->_unregisterActor(mName); + + if (!isDead()) + _destroyActor(); + +} + +////////////////////////////////////////////////////////// + +void Actor::_createActor(ShapeBlueprint *shape, const Pose& pose, ActorParams params) { + + NxActorDesc ad; + NxBodyDesc bd; + ad.setToDefault(); + bd.setToDefault(); + + mNxActorUserData = new NxActorUserData(this, NxActorUserData::T_Actor); +#if NX_SDK_VERSION_NUMBER >= 260 + ad.compartment = params.mCompartment; +#endif + if (params.mMass == 0) + ad.density = params.mDensity; +#if NX_SDK_VERSION_NUMBER >= 272 + if (params.mDominanceGroupAsIndex != 0) + ad.dominanceGroup = params.mDominanceGroupAsIndex; + else if (params.mDominanceGroupAsName.length() > 0) + ad.dominanceGroup = mOwner->getDominanceGroup(params.mDominanceGroupAsName)->getGroupID(); +#endif + ad.flags = params.mActorFlags; + + ad.globalPose.t = pose.getVec3(); + ad.globalPose.M.fromQuat(pose.getQuat()); + + if (params.mGroupAsIndex != 0) + ad.group = params.mGroupAsIndex; + else if (params.mGroupAsName.length() > 0) + ad.group = mOwner->getActorGroup(params.mGroupAsName)->getGroupID(); + + ad.userData = mNxActorUserData; + + if (params.mDensity == 0 && params.mMass == 0) { + ad.body = NULL; + } + else { + bd.angularDamping = params.mAngularDamping; + bd.angularVelocity = params.mAngularVelocity; + bd.CCDMotionThreshold = params.mCCDMotionThreshold; + bd.flags = params.mBodyFlags; + bd.linearDamping = params.mLinearDamping; + bd.linearVelocity = params.mLinearVelocity; + if (ad.density == 0) + bd.mass = params.mMass; + bd.massLocalPose = params.mMassLocalPose; + bd.massSpaceInertia = params.mMassSpaceInertia; + bd.maxAngularVelocity = params.mMaxAngularVelocity; + bd.sleepAngularVelocity = params.mSleepAngularVelocity; + bd.sleepDamping = params.mSleepDamping; + bd.sleepEnergyThreshold = params.mSleepEnergyThreshold; + bd.sleepLinearVelocity = params.mSleepLinearVelocity; + bd.solverIterationCount = params.mSolverIterationCount; + bd.wakeUpCounter = params.mWakeUpCounter; + ad.body = &bd; + } + + shape->_bindToActorDescription(this, 0, ad.shapes); + + mActor = mOwner->mScene->createActor(ad); + + if (!mActor) { + std::stringstream ss; + ss << "Creation of Actor with the identifier '" << mName << "' failed." << std::endl; + NxThrow_Error(ss.str()); + return; + } + + if (!shape->isShared()) + delete shape; + + NxU32 nbShapes = mActor->getNbShapes(); + NxShape*const* shapes = mActor->getShapes(); + + int i=0; + while (nbShapes--) { + mCollisionModel[i]->_bindNxShapeToShape(shapes[nbShapes]); + i++; + } + +#if (OGRE_VERSION_MINOR >= 5) + mBirthFrame = Ogre::Root::getSingletonPtr()->getNextFrameNumber() - 1; +#else + mBirthFrame = Ogre::Root::getSingletonPtr()->getCurrentFrameNumber(); +#endif +} + +////////////////////////////////////////////////////////// + +void Actor::_destroyActor() { + mCollisionModel.destroyAllOwned(); + delete mNxActorUserData; + mOwner->mScene->releaseActor(*mActor); + mActor = 0; +} + +////////////////////////////////////////////////////////// + +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; +} + +////////////////////////////////////////////////////////// + +NxString Actor::getName() { + return mName; +} + +////////////////////////////////////////////////////////// + +NxScene* Actor::getNxScene() { + return mOwner->getNxScene(); +} + +////////////////////////////////////////////////////////// + +Actor* Actor::duplicate(const NxString& name, const Pose& p) { + Blueprints::ActorBlueprint* ab = new Blueprints::ActorBlueprint(); + ab->serialise(this, mOwner); + Actor* a = ab->unserialise(name, mOwner); + a->setGlobalPose(p); + delete ab; + return a; +} + +////////////////////////////////////////////////////////// + +void Actor::setGlobalPose(const Pose& pose) { + mActor->setGlobalPose(pose.toMat34()); +} + +////////////////////////////////////////////////////////// + +Pose Actor::getGlobalPose() { + static Pose p; + p.fromMat34(mActor->getGlobalPose()); + return p; +} + +////////////////////////////////////////////////////////// + +Ogre::Quaternion Actor::getGlobalOrientation() { + return toQuaternion(mActor->getGlobalOrientationQuat()); +} + +////////////////////////////////////////////////////////// + +void Actor::setGlobalOrientation(const Ogre::Quaternion& quat) { + mActor->setGlobalOrientation(toNxQuat(quat)); +} + +////////////////////////////////////////////////////////// + +Ogre::Vector3 Actor::getGlobalPosition() { + return toVector3(mActor->getGlobalPosition()); +} + +////////////////////////////////////////////////////////// + +void Actor::setGlobalPosition(const Ogre::Vector3& vec) { + mActor->setGlobalPosition(toNxVec3(vec)); +} + +////////////////////////////////////////////////////////// + +void Actor::moveGlobalPose(const Pose& pose) { + mActor->moveGlobalPose(pose.toMat34()); +} + +////////////////////////////////////////////////////////// + +void Actor::moveGlobalPosition(const Ogre::Vector3& vec) { + mActor->moveGlobalPosition(toNxVec3(vec)); +} + +////////////////////////////////////////////////////////// + +void Actor::moveGlobalOrientation(const Ogre::Quaternion& quat) { + mActor->moveGlobalOrientationQuat(toNxQuat(quat)); +} + +//////////////////////////////////////////////////////// + +void Actor::moveTowards(const Pose& p, float force) { + NxVec3 fc = p.v - mActor->getGlobalPosition(); + fc *= force; + fc -= mActor->getPointVelocity(mActor->getGlobalPosition()); + mActor->addForceAtPos(fc, mActor->getGlobalPosition()); +} + +//////////////////////////////////////////////////////// + +#if 0 +const ShapeBlueprint& Actor::createShapeDescription(const ShapeBlueprint& s) { + NxUnderConstruction; + return s; +} + +////////////////////////////////////////////////////////// + +void Actor::destroyShapeDescription(const ShapeBlueprint&) { + NxUnderConstruction; +} + +////////////////////////////////////////////////////////// + +Ogre::uint Actor::getNbShapeDescriptions() { + return mActor->getNbShapeDescriptions(); +} + +////////////////////////////////////////////////////////// + +std::vector<const ShapeBlueprint&> Actor::getAllShapeDescriptions() { + NxUnderConstruction; + std::vector<const ShapeBlueprint&> s; + return s; +} + +////////////////////////////////////////////////////////// + +ShapeBlueprint Actor::getFirstShapeDescription() { + NxUnderConstruction; + return NULL; +} + +////////////////////////////////////////////////////////// + +ShapeBlueprint Actor::getShapeDescription(Ogre::uint id) { + NxUnderConstruction; + return NULL; +} +#endif + +////////////////////////////////////////////////////////// + +void Actor::setGroup(ActorGroup* ag) { + mActor->setGroup(ag->getGroupID()); +} + +////////////////////////////////////////////////////////// + +void Actor::setGroup(const NxString& GroupIdentifier) { + mActor->setGroup(mOwner->getActorGroups()->get(GroupIdentifier)->getGroupID()); +} + +////////////////////////////////////////////////////////// + +void Actor::setGroup(NxActorGroup agid) { + mActor->setGroup(agid); +} + +////////////////////////////////////////////////////////// + +ActorGroup* Actor::getGroup() const { + NxActorGroup agid = mActor->getGroup(); + return mOwner->getActorGroupsByIndex()->get(agid); +} + +////////////////////////////////////////////////////////// + +void Actor::raiseActorFlag(NxActorFlag f) { + mActor->raiseActorFlag(f); +} + +////////////////////////////////////////////////////////// + +void Actor::clearActorFlag(NxActorFlag f) { + mActor->clearActorFlag(f); +} + +////////////////////////////////////////////////////////// + +bool Actor::hasActorFlag(NxActorFlag f) const { + return mActor->readActorFlag(f); +} +////////////////////////////////////////////////////////// + +bool Actor::isDynamic() const { + return mActor->isDynamic(); +} + +////////////////////////////////////////////////////////// + +void Actor::setCMassOffsetLocalPose(const Pose& pose) { + mActor->setCMassOffsetLocalPose(pose.toMat34()); +} + +////////////////////////////////////////////////////////// + +void Actor::setCMassOffsetLocalPosition(const Ogre::Vector3& vec) { + mActor->setCMassOffsetLocalPosition(toNxVec3(vec)); +} + +////////////////////////////////////////////////////////// + +void Actor::setCMassOffsetLocalOrientation(const NxMat33& m) { + mActor->setCMassOffsetLocalOrientation(m); +} + +////////////////////////////////////////////////////////// + +void Actor::setCMassOffsetLocalOrientation(const Ogre::Matrix3& vec) { + NxUnderConstruction; + +} + +////////////////////////////////////////////////////////// + +void Actor::setCMassOffsetGlobalPose(const Pose& pose) { + mActor->setCMassOffsetGlobalPose(pose.toMat34()); +} + +////////////////////////////////////////////////////////// + +void Actor::setCMassOffsetGlobalPosition(const Ogre::Vector3& vec) { + mActor->setCMassOffsetGlobalPosition(toNxVec3(vec)); +} + +////////////////////////////////////////////////////////// + +void Actor::setCMassOffsetGlobalOrientation(const NxMat33& m) { + mActor->setCMassOffsetGlobalOrientation(m); +} + +////////////////////////////////////////////////////////// + +void Actor::setCMassOffsetGlobalOrientation(const Ogre::Matrix3& quat) { + NxUnderConstruction; + NxMat33 m; + mActor->setCMassOffsetGlobalOrientation(m); +} + +////////////////////////////////////////////////////////// + +void Actor::setCMassGlobalPose(const Pose& pose) { + mActor->setCMassGlobalPose(pose.toMat34()); +} + +////////////////////////////////////////////////////////// + +void Actor::setCMassGlobalPosition(const Ogre::Vector3& vec) { + mActor->setCMassGlobalPosition(toNxVec3(vec)); +} + +////////////////////////////////////////////////////////// + +void Actor::setCMassGlobalOrientation(const Ogre::Quaternion& quat) { + NxUnderConstruction; + NxMat33 m; + mActor->setCMassGlobalOrientation(m); +} +////////////////////////////////////////////////////////// + + +Pose Actor::getCMassLocalPose() const { + Pose pose; + pose.fromMat34(mActor->getCMassLocalPose()); + return pose; +} + +////////////////////////////////////////////////////////// + +Ogre::Vector3 Actor::getCMassLocalPosition() const { + return toVector3(mActor->getCMassLocalPosition()); +} + +////////////////////////////////////////////////////////// + +Ogre::Quaternion Actor::getCMassLocalOrientation() const { + return toQuaternion(mActor->getCMassLocalOrientation()); +} + +////////////////////////////////////////////////////////// + +Pose Actor::getCMassGlobalPose() const { + Pose pose; + pose.fromMat34(mActor->getCMassGlobalPose()); + return pose; +} + +////////////////////////////////////////////////////////// + +Ogre::Vector3 Actor::getCMassGlobalPosition() const { + return toVector3(mActor->getCMassGlobalPosition()); +} + +////////////////////////////////////////////////////////// + +Ogre::Quaternion Actor::getCMassGlobalOrientation() const { + NxQuat quat; + mActor->getCMassGlobalOrientation().toQuat(quat); + return toQuaternion(quat); +} + +////////////////////////////////////////////////////////// + + +void Actor::setMass(NxReal r) { + mActor->setMass(r); +} + +////////////////////////////////////////////////////////// + +NxReal Actor::getMass() const { + return mActor->getMass(); +} + +////////////////////////////////////////////////////////// + + +void Actor::setMassSpaceInertiaTensor(const Ogre::Vector3& vec) { + mActor->setMassSpaceInertiaTensor(toNxVec3(vec)); +} + +////////////////////////////////////////////////////////// + +Ogre::Vector3 Actor::getMassSpaceInertiaTensor() const { + return toVector3(mActor->getMassSpaceInertiaTensor()); +} + +////////////////////////////////////////////////////////// + +Ogre::Matrix3 Actor::getGlobalInertiaTensor() const { + NxUnderConstruction; + Ogre::Matrix3 m; + return m; +} + +////////////////////////////////////////////////////////// + +Ogre::Matrix3 Actor::getGlobalInertiaTensorInverse() const { + NxUnderConstruction; + Ogre::Matrix3 m; + return m; +} + +////////////////////////////////////////////////////////// + + +void Actor::updateMassFromShapeFromDensity(NxReal r) { + mActor->updateMassFromShapes(r,0); +} + +////////////////////////////////////////////////////////// + +void Actor::updateMassFromShapeAsMass(NxReal r) { + mActor->updateMassFromShapes(0,r); +} + +////////////////////////////////////////////////////////// + +void Actor::setLinearDamping(NxReal r) { + mActor->setLinearDamping(r); +} + +////////////////////////////////////////////////////////// + +NxReal Actor::getLinearDamping() const { + return mActor->getLinearDamping(); +} + +////////////////////////////////////////////////////////// + + +void Actor::setAngularDamping(NxReal r) { + mActor->setAngularDamping(r); +} + +////////////////////////////////////////////////////////// + +NxReal Actor::getAngularDamping() const { + return mActor->getAngularDamping(); +} + +////////////////////////////////////////////////////////// + +void Actor::setLinearVelocity(const Ogre::Vector3& vec) { + mActor->setLinearVelocity(toNxVec3(vec)); +} + +////////////////////////////////////////////////////////// + +void Actor::setAngularVelocity(const Ogre::Vector3& vec) { + mActor->setAngularVelocity(toNxVec3(vec)); +} + +////////////////////////////////////////////////////////// + + +Ogre::Vector3 Actor::getLinearVelocity() const { + return toVector3(mActor->getLinearVelocity()); +} + +////////////////////////////////////////////////////////// + +Ogre::Vector3 Actor::getAngularVelocity() const { + return toVector3(mActor->getAngularVelocity()); +} + +////////////////////////////////////////////////////////// + + +void Actor::setMaxAngularVelocity(NxReal r) { + mActor->setMaxAngularVelocity(r); +} + +////////////////////////////////////////////////////////// + +NxReal Actor::getMaxAngularVelocity() const { + return mActor->getMaxAngularVelocity(); +} + +////////////////////////////////////////////////////////// + +void Actor::setCCDMotionThreshold(NxReal r) { + mActor->setCCDMotionThreshold(r); +} + +////////////////////////////////////////////////////////// + +NxReal Actor::getCCDMotionThreshold() const { + return mActor->getCCDMotionThreshold(); +} + +////////////////////////////////////////////////////////// + +void Actor::setLinearMomentum(const Ogre::Vector3& vec) { + mActor->setLinearMomentum(toNxVec3(vec)); +} + +////////////////////////////////////////////////////////// + +void Actor::setAngularMomentum(const Ogre::Vector3& vec) { + mActor->setAngularMomentum(toNxVec3(vec)); +} + +////////////////////////////////////////////////////////// + +Ogre::Vector3 Actor::getLinearMomentum() const { + return toVector3(mActor->getLinearMomentum()); +} + +////////////////////////////////////////////////////////// + +Ogre::Vector3 Actor::getAngularMomentum() const { + return toVector3(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); +} + +////////////////////////////////////////////////////////// + +void Actor::addForceAtLocalPos(const Ogre::Vector3& force, const Ogre::Vector3& pos, NxForceMode mode, bool wakeup) { + mActor->addForceAtLocalPos(toNxVec3(force), toNxVec3(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); +} + +////////////////////////////////////////////////////////// + +void Actor::addLocalForceAtLocalPos(const Ogre::Vector3& force, const Ogre::Vector3& pos, NxForceMode mode, bool wakeup) { + mActor->addLocalForceAtLocalPos(toNxVec3(force), toNxVec3(pos), mode, wakeup); +} + +////////////////////////////////////////////////////////// + +void Actor::addForce(const Ogre::Vector3& force, NxForceMode mode, bool wakeup) { + mActor->addForce(toNxVec3(force), mode, wakeup); +} + +////////////////////////////////////////////////////////// + +void Actor::addLocalForce(const Ogre::Vector3& force, NxForceMode mode, bool wakeup) { + mActor->addLocalForce(toNxVec3(force), mode, wakeup); +} + +////////////////////////////////////////////////////////// + +void Actor::addTorque(const Ogre::Vector3& torque, NxForceMode mode, bool wakeup) { + mActor->addTorque(toNxVec3(torque), mode, wakeup); +} + +////////////////////////////////////////////////////////// + +void Actor::addLocalTorque(const Ogre::Vector3& torque, NxForceMode mode, bool wakeup) { + mActor->addLocalTorque(toNxVec3(torque), mode, wakeup); +} + +////////////////////////////////////////////////////////// + +NxReal Actor::computeKineticEnergy() const { + return mActor->computeKineticEnergy(); +} + +////////////////////////////////////////////////////////// + +Ogre::Vector3 Actor::getPointVelocity(const Ogre::Vector3& vec) const { + return toVector3(mActor->getPointVelocity(toNxVec3(vec))); +} + +////////////////////////////////////////////////////////// + +Ogre::Vector3 Actor::getLocalPointVelocity(const Ogre::Vector3& vec) const { + return toVector3(mActor->getLocalPointVelocity(toNxVec3(vec))); +} + +////////////////////////////////////////////////////////// + +bool Actor::isGroupSleeping() const { + return mActor->isGroupSleeping(); +} + +////////////////////////////////////////////////////////// + +bool Actor::isSleeping() const { + return mActor->isSleeping(); +} + +////////////////////////////////////////////////////////// + +NxReal Actor::getSleepLinearVelocity() const { + return mActor->getSleepLinearVelocity(); +} + +////////////////////////////////////////////////////////// + +void Actor::setSleepLinearVelocity(NxReal threshold) { + mActor->setSleepLinearVelocity(threshold); +} + +////////////////////////////////////////////////////////// + +NxReal Actor::getSleepAngularVelocity() const { + return mActor->getSleepAngularVelocity(); +} + +////////////////////////////////////////////////////////// + +void Actor::setSleepAngularVelocity(NxReal threshold) { + mActor->setSleepAngularVelocity(threshold); +} + +////////////////////////////////////////////////////////// + +NxReal Actor::getSleepEnergyThreshold() const { + return mActor->getSleepEnergyThreshold(); +} + +////////////////////////////////////////////////////////// + +void Actor::setSleepEnergyThreshold(NxReal threshold) { + mActor->setSleepEnergyThreshold(threshold); +} + +////////////////////////////////////////////////////////// + +void Actor::wakeUp(NxReal wakeCounterValue) { + mActor->wakeUp(wakeCounterValue); +} + +////////////////////////////////////////////////////////// + +void Actor::putToSleep() { + mActor->putToSleep(); +} + +////////////////////////////////////////////////////////// + +void Actor::raiseBodyFlag(NxBodyFlag f) { + mActor->raiseBodyFlag(f); +} + +////////////////////////////////////////////////////////// + +void Actor::clearBodyFlag(NxBodyFlag f) { + mActor->clearBodyFlag(f); +} + +////////////////////////////////////////////////////////// + +bool Actor::hasBodyFlag(NxBodyFlag f) const { + return mActor->readBodyFlag(f); +} + +////////////////////////////////////////////////////////// + +void Actor::setSolverIterationCount(NxU32 c) { + mActor->setSolverIterationCount(c); +} + +////////////////////////////////////////////////////////// + +NxU32 Actor::getSolverIterationCount() const { + return mActor->getSolverIterationCount(); +} + +////////////////////////////////////////////////////////// + +#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); +} + +#endif + +////////////////////////////////////////////////////////// + +#if NX_SDK_VERSION_NUMBER >= 260 + +Compartment* Actor::getCompartment() const { + NxUnderConstruction; + return NULL; +} + +#endif + +////////////////////////////////////////////////////////// + +Shape* Actor::addShape(ShapeBlueprint* sd) { + + + NxShapeIndex id = mCollisionModel.count(); + sd->_bindToNxActor(this, id); + delete sd; + Shape* s = mCollisionModel.get(id); + + + return s; + +} + +////////////////////////////////////////////////////////// + +void Actor::removeShape(Shape* sh) { + + + for (Shape* shape = mCollisionModel.begin();shape = mCollisionModel.next();) { + if (shape == sh) { + mActor->releaseShape(*sh->getNxShape()); + mCollisionModel.remove(sh->getIndex()); + + if (mDynamicCollisionModel.has(sh->getIndex())) + mDynamicCollisionModel.remove(sh->getIndex()); + + delete shape; + + return; + } + } + +} + +////////////////////////////////////////////////////////// + +void Actor::removeShape(NxShapeIndex id) { + + Shape* shape = mCollisionModel[id]; + + if (shape == 0) + return; + + shape->releaseShape(); + mCollisionModel.remove(id); + + delete shape; +} + +////////////////////////////////////////////////////////// + +NxU32 Actor::getNbShapes() const { + return mCollisionModel.count(); +} + +////////////////////////////////////////////////////////// + +CollisionModel* Actor::getCollisionModel() { + return &mCollisionModel; +} + +////////////////////////////////////////////////////////// + +CollisionModel* Actor::getDynamicCollisionModel() { + return &mDynamicCollisionModel; +} + +////////////////////////////////////////////////////////// + +void* Actor::getNxActorUserData() { + return mActor->userData; +} + +////////////////////////////////////////////////////////// + +StringPairList Actor::saveCustom() { + StringPairList l; + l.insert("ActorType", "Actor"); + + return l; +} + +////////////////////////////////////////////////////////// + +void Actor::disable() { + mActor->raiseActorFlag(NX_AF_DISABLE_COLLISION); + mActor->raiseActorFlag(NX_AF_DISABLE_RESPONSE); + mActor->raiseActorFlag(NX_AF_FLUID_DISABLE_COLLISION); + mActor->raiseBodyFlag(NX_BF_FROZEN); + mActor->raiseBodyFlag(NX_BF_FROZEN_ROT); + mActor->setAngularVelocity(NxVec3(0,0,0)); + mActor->setAngularMomentum(NxVec3(0,0,0)); + mActor->setLinearMomentum(NxVec3(0,0,0)); + mActor->setLinearVelocity(NxVec3(0,0,0)); + + disableVisualisation(); +} + +////////////////////////////////////////////////////////// + +FixedJoint* Actor::joinWith(Actor* actorB, JointParams jp) { + return mOwner->createFixedJoint(this, actorB, jp); +} + +////////////////////////////////////////////////////////// + +} //End of NxOgre namespace. Added: trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.h (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.h 2007-10-14 07:54:01 UTC (rev 422) @@ -0,0 +1,734 @@ +// +// 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_H__ +#define __NXOGRE_ACTOR_H__ + +#include "NxOgrePrerequisites.h" +#include "NxOgreContainer.h" // For: mCollisionList +#include "NxOgreParams.h" + +namespace NxOgre { + + /** + \page actorparams ActorParams + + String base params are case and space insensitive. + + Examples: + + <code> + "mass: 1" + + "mass: 1, group: myActors" + + "mass: 1, group: myActors, lineardamping: 3" + </code> + + Non-String based params can be used as well, and offer access to some variables of the params + that cannot be converted into a string (pointers, etc.). + + Due to efficency purposes and insane string conversion. With string parameters more than four, + you should work with the non-string based params system. + + <code> + ActorParams params; + params.setToDefault(); + params.mMass = 10; + params.mGroupAsIndex = 1; + </code> + + Is exactly the same as: + + <code> + "mass: 10, group-index: 1" + </code> + + Current Supported String Params + ----------------------------- + + - density (float) + - Description: Density of this Actor. Use this or mass, do not use both. + - Example: "Density: 1.5" + - See: ActorParams::mDensity and NxActorDesc::density for more information. + + - group (string) + - Description: Actor Group name of this actor. Use this or group-index, but not both. + - Example: "group: myGroup" + - See: ActorParams::mGroupAsName + + - group-index (unsigned int) + - Description: Actor Group ID of this actor. Use this or group, but not both. + - Example: "group-index: 0" + - See: ActorParams::mGroupAsIndex + + - dominancegroup (unsigned int) + - Description: Dominance Group ID of this actor. + - Example: "dominancegroup: 0" + - See: ActorParams::mDominanceGroup + + - massspaceinertia (Vector3) + - Description: Mass Space Inertia of this Actor + - Example: "massspaceinertia: 1 0 1" + - See: ActorParams::mMassSpaceInertia + + - linearvelocity (Vector3) + - Description: Linear Velocity of this Actor + - Example: "linearvelocity: 1 0 1" + - See: ActorParams::mLinearVelocity + + - angularvelocity (Vector3) + - Description: Angular Velocity of this Actor + - Example: "angularvelocity: 1 0 1" + - See: ActorParams::mAngularVelocity + + - wakeupcounter (float) + - Description: Wake up time counter + - Example: "wakeupcounter: 1000.0" + - See: ActorParams::mWakeupCounter + + - mass (float) + - Description: Mass of this Actor. Use this or density, do not use both. + - Example: "mass: 10" + - See: ActorParams::mMass and NxBodyDesc::mass for more information. + + - lineardamping (float) + - Description: Linear Damping of the Actor + - Example: "lineardamping: 0.1" + - See: ActorParams::mLinearDamping + + - angulardamping (float) + - Description: Angular Damping of the Actor + - Example: "angulardamping: 0.1" + - See: ActorParams::mAngularDamping + + - maxangularvelocity (float) + - Description: Maximum allowed angular velocity + - Example: "maxangularvelocity: 10" + - See: ActorParams::mMaxAngularVelocity + + - sleepangularvelocity (float) + - Description: Maximum angular velocity at which the Actor can go to sleep. + - Example: "sleepangularvelocity: 20" + - See: ActorParams:mSleepAngularVelocity + + - ccdmotionthreshold (float) + - Description: When CCD is globally enabled, it is still not performed if the + motion distance of all points on the Actor is below this threshold. + - Example: "ccdmotionthreshold: 5" + - See: ActorParams::mCCDMotionThreshold + + - solveriterationcount (unsigned int) + - Description: Number of solver iterations performed when processing joint/contacts + connected to this Actor. + - Example: "solveriterationcount: 5" + - Range: 1 to 255 + - See: ActorParams::mSolverIterationCount + + - sleepenergytheshold (float) + - Description: Threshold for the energy-based sleeping algorithm. Only used when + the NX_BF_ENERGY_SLEEP_TEST flag is set + - Example: "sleepenergythreshold: 0.006" + - See: ActorParams::mSleepEnergyThreshold + + - sleepdamping (float) + - Description: Damping factor for bodies that are about to sleep. + - Example: "sleepdamping: 0.5" + - See: ActorParams::mSleepDamping + + - node-scale (Vector3) + - Applicable to Body and Actors that use a visual representation of the NxActor. + - Description: Scale factor of the SceneNode + - Example: "node-slace: 2 2 2" + - See: ActorParams::mNodeScale + + - node-shadows (bool) + - Applicable to Body and Actors that use a visual representation of the NxActor. + - Description: Apply shadows to the first entity (Body class). See other custom Actors + to see how shadows apply to it. + - Example: "node-shadows: yes" + - See: ActorParams::mNodeShaodws + + - node (string) + - Applicable to Body and Actors that use a visual representation of the NxActor. + - Description: Name of the SceneNode, or name of an existing SceneNode to use (Body only). + - Example: "node: myNodeName" + - See: ActorParams::mNodeName + + */ + + /** ActorParams + + See \ref actorparams for the full string argument documentation. + */ + class NxExport ActorParams : public Params { + + public: + + + ActorParams(){setToDefault();} + ActorParams(const char* p) {process(p);} + ActorParams(NxString p) {process(p);} + + void setToDefault(); + void parse(Parameters); + void fromNxActorDesc(NxActorDesc&); + void fromNxBodyDesc(NxBodyDesc&); + + //////////////////////////////////////////////////////////////// + +#if NX_SDK_VERSION_NUMBER >= 260 + /// NxCompartment of the Actor to sit in. + /// @todo NxOgre-ify + /// @default NULL + NxCompartment* mCompartment; +#endif + + /// Density, mass must be 0 when density is used. + NxReal mDensity; + +#if NX_SDK_VERSION_NUMBER >= 272 + + /// DominanceGroup (as Name). + /// @default "" + NxString mDominanceGroupAsName; + + /// DominanceGroup (as Index) + /// @default 0 + NxDominanceGroup mDominanceGroupAsIndex; +#endif + + /// Flags for the NxActor + /// @see NxActorFlags + /// @default 0 + NxU32 mActorFlags; + + + /// 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 + NxString mGroupAsName; + + + //////////////////////////////////////////////////////////////// + + + /// Angular Damping + NxReal mAngularDamping; + + + /// Angular Velocity + NxVec3 mAngularVelocity; + + + /// + NxReal mCCDMotionThreshold; + + + /// + NxU32 mBodyFlags; + + + /// + NxReal mLinearDamping; + + + /// + NxVec3 mLinearVelocity; + + + /// Mass of the Actor. When used, make sure density is zero. + NxReal mMass; + + + /// + NxMat34 mMassLocalPose; + + /// + NxVec3 mMassSpaceInertia; + + + /// + NxReal mMaxAngularVelocity; + + /// + NxReal mSleepAngularVelocity; + + + /// + NxReal mSleepDamping; + + + /// + NxReal mSleepEnergyThreshold; + + + /// + NxReal mSleepLinearVelocity; + + + /// + NxU32 mSolverIterationCount; + + + /// + NxReal mWakeUpCounter; + + + //////////////////////////////////////////////////////////////// + + + /// SceneNode for Visual based Actors. If the node already exists then it will use it. + NxString mNodeName; + + /// Scale the SceneNode for Visual based Actors + Ogre::Vector3 mNodeScale; + + /// Set the first Entity of the Visual based Actors to have shadows or not. + bool mNodeShadows; + + + + }; // End of ActorParams class + + class NxExport Actor { + + public: + + Actor(const NxString& Identifier, Scene*, bool is... [truncated message content] |