Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArystanbek Dyussenov <arystan.d@gmail.com>2010-09-04 22:49:07 +0400
committerArystanbek Dyussenov <arystan.d@gmail.com>2010-09-04 22:49:07 +0400
commit90b464d3728d9ed8ec26fdf59058d236b99dbcd9 (patch)
treee88cab4fb1358e962b19f658064ca8c9f8d29f5b /source/gameengine
parent08d02dd04d836976b25793bb1d4c6a86b3f924c7 (diff)
parentb0b787ef38f9947b3176642556f5282eb3518f69 (diff)
COLLADA branch: merge from trunk -r 28015:31610.soc-2009-chingachgook
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp76
-rw-r--r--source/gameengine/BlenderRoutines/CMakeLists.txt1
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp42
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderCanvas.h22
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderGL.cpp4
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderInputDevice.cpp4
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h13
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp4
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h4
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp4
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h4
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h2
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderSystem.cpp4
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderSystem.h2
-rw-r--r--source/gameengine/BlenderRoutines/Makefile2
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp4
-rw-r--r--source/gameengine/Converter/BL_ArmatureActuator.cpp6
-rw-r--r--source/gameengine/Converter/BL_ArmatureChannel.cpp15
-rw-r--r--source/gameengine/Converter/BL_ArmatureConstraint.cpp6
-rw-r--r--source/gameengine/Converter/BL_ArmatureObject.cpp14
-rw-r--r--source/gameengine/Converter/BL_ArmatureObject.h2
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp12
-rw-r--r--source/gameengine/Converter/BL_DeformableGameObject.cpp4
-rw-r--r--source/gameengine/Converter/BL_DeformableGameObject.h2
-rw-r--r--source/gameengine/Converter/BL_MeshDeformer.cpp4
-rw-r--r--source/gameengine/Converter/BL_MeshDeformer.h2
-rw-r--r--source/gameengine/Converter/BL_ModifierDeformer.cpp16
-rw-r--r--source/gameengine/Converter/BL_ModifierDeformer.h3
-rw-r--r--source/gameengine/Converter/BL_ShapeActionActuator.cpp4
-rw-r--r--source/gameengine/Converter/BL_ShapeDeformer.h2
-rw-r--r--source/gameengine/Converter/BL_SkinDeformer.h2
-rw-r--r--source/gameengine/Converter/BlenderWorldInfo.cpp4
-rw-r--r--source/gameengine/Converter/BlenderWorldInfo.h2
-rw-r--r--source/gameengine/Converter/CMakeLists.txt1
-rw-r--r--source/gameengine/Converter/KX_BlenderScalarInterpolator.h4
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp12
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.h2
-rw-r--r--source/gameengine/Converter/KX_ConvertControllers.cpp12
-rw-r--r--source/gameengine/Converter/KX_ConvertProperties.cpp4
-rw-r--r--source/gameengine/Converter/KX_ConvertSensors.cpp14
-rw-r--r--source/gameengine/Converter/KX_IpoConvert.cpp6
-rw-r--r--source/gameengine/Converter/KX_SoftBodyDeformer.h2
-rw-r--r--source/gameengine/Converter/Makefile2
-rw-r--r--source/gameengine/Expressions/BoolValue.cpp4
-rw-r--r--source/gameengine/Expressions/BoolValue.h2
-rw-r--r--source/gameengine/Expressions/CMakeLists.txt1
-rw-r--r--source/gameengine/Expressions/ConstExpr.cpp4
-rw-r--r--source/gameengine/Expressions/ConstExpr.h2
-rw-r--r--source/gameengine/Expressions/EXP_C-Api.cpp4
-rw-r--r--source/gameengine/Expressions/EmptyValue.cpp4
-rw-r--r--source/gameengine/Expressions/EmptyValue.h2
-rw-r--r--source/gameengine/Expressions/ErrorValue.cpp4
-rw-r--r--source/gameengine/Expressions/ErrorValue.h2
-rw-r--r--source/gameengine/Expressions/Expression.cpp4
-rw-r--r--source/gameengine/Expressions/Expression.h4
-rw-r--r--source/gameengine/Expressions/FloatValue.cpp4
-rw-r--r--source/gameengine/Expressions/FloatValue.h2
-rw-r--r--source/gameengine/Expressions/IdentifierExpr.cpp4
-rw-r--r--source/gameengine/Expressions/IdentifierExpr.h2
-rw-r--r--source/gameengine/Expressions/IfExpr.cpp4
-rw-r--r--source/gameengine/Expressions/IfExpr.h2
-rw-r--r--source/gameengine/Expressions/InputParser.cpp4
-rw-r--r--source/gameengine/Expressions/InputParser.h2
-rw-r--r--source/gameengine/Expressions/IntValue.cpp4
-rw-r--r--source/gameengine/Expressions/IntValue.h2
-rw-r--r--source/gameengine/Expressions/KX_HashedPtr.cpp4
-rw-r--r--source/gameengine/Expressions/KX_HashedPtr.h2
-rw-r--r--source/gameengine/Expressions/ListValue.cpp10
-rw-r--r--source/gameengine/Expressions/Makefile2
-rw-r--r--source/gameengine/Expressions/Operator1Expr.cpp4
-rw-r--r--source/gameengine/Expressions/Operator1Expr.h2
-rw-r--r--source/gameengine/Expressions/Operator2Expr.cpp4
-rw-r--r--source/gameengine/Expressions/Operator2Expr.h2
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp8
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h18
-rw-r--r--source/gameengine/Expressions/StringValue.cpp4
-rw-r--r--source/gameengine/Expressions/StringValue.h2
-rw-r--r--source/gameengine/Expressions/Value.cpp4
-rw-r--r--source/gameengine/Expressions/Value.h4
-rw-r--r--source/gameengine/Expressions/VectorValue.cpp4
-rw-r--r--source/gameengine/Expressions/VectorValue.h2
-rw-r--r--source/gameengine/Expressions/VoidValue.h2
-rw-r--r--source/gameengine/GameLogic/CMakeLists.txt1
-rw-r--r--source/gameengine/GameLogic/Joystick/Makefile2
-rw-r--r--source/gameengine/GameLogic/Makefile6
-rw-r--r--source/gameengine/GameLogic/SCA_2DFilterActuator.cpp3
-rw-r--r--source/gameengine/GameLogic/SCA_ANDController.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_ActuatorEventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_ActuatorSensor.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_AlwaysEventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_AlwaysSensor.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_BasicEventManager.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_BasicEventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_DelaySensor.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_EventManager.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_EventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_ExpressionController.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_ExpressionController.h2
-rw-r--r--source/gameengine/GameLogic/SCA_IActuator.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_IActuator.h2
-rw-r--r--source/gameengine/GameLogic/SCA_IController.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_IInputDevice.h11
-rw-r--r--source/gameengine/GameLogic/SCA_ILogicBrick.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_IObject.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_IScene.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_IScene.h2
-rw-r--r--source/gameengine/GameLogic/SCA_ISensor.cpp21
-rw-r--r--source/gameengine/GameLogic/SCA_ISensor.h15
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickManager.cpp3
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickSensor.cpp5
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardSensor.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_LogicManager.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_LogicManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_MouseManager.cpp18
-rw-r--r--source/gameengine/GameLogic/SCA_MouseManager.h5
-rw-r--r--source/gameengine/GameLogic/SCA_MouseSensor.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_NANDController.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_NORController.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_ORController.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_PropertyActuator.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_PropertyEventManager.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_PropertyEventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_PropertySensor.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_PythonController.cpp74
-rw-r--r--source/gameengine/GameLogic/SCA_PythonKeyboard.cpp104
-rw-r--r--source/gameengine/GameLogic/SCA_PythonKeyboard.h44
-rw-r--r--source/gameengine/GameLogic/SCA_PythonMouse.cpp178
-rw-r--r--source/gameengine/GameLogic/SCA_PythonMouse.h53
-rw-r--r--source/gameengine/GameLogic/SCA_RandomActuator.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_RandomEventManager.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_RandomEventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_RandomNumberGenerator.h2
-rw-r--r--source/gameengine/GameLogic/SCA_RandomSensor.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_TimeEventManager.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_TimeEventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_XNORController.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_XORController.cpp4
-rw-r--r--source/gameengine/GamePlayer/Makefile2
-rw-r--r--source/gameengine/GamePlayer/common/CMakeLists.txt1
-rw-r--r--source/gameengine/GamePlayer/common/GPC_Canvas.cpp10
-rw-r--r--source/gameengine/GamePlayer/common/GPC_Engine.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/GPC_MouseDevice.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/GPC_RawImage.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/GPC_System.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/Makefile2
-rw-r--r--source/gameengine/GamePlayer/common/bmfont.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/unix/GPU_Canvas.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/unix/GPU_Engine.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/unix/GPU_Engine.h2
-rw-r--r--source/gameengine/GamePlayer/common/unix/GPU_KeyboardDevice.cpp2
-rw-r--r--source/gameengine/GamePlayer/common/unix/GPU_System.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/unix/Makefile2
-rw-r--r--source/gameengine/GamePlayer/common/windows/GPW_Canvas.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/windows/GPW_Engine.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/windows/GPW_KeyboardDevice.cpp13
-rw-r--r--source/gameengine/GamePlayer/common/windows/GPW_System.cpp4
-rw-r--r--source/gameengine/GamePlayer/common/windows/Makefile2
-rw-r--r--source/gameengine/GamePlayer/ghost/CMakeLists.txt1
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp12
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp16
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Canvas.h4
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp14
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_System.cpp4
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp8
-rw-r--r--source/gameengine/GamePlayer/ghost/Makefile2
-rw-r--r--source/gameengine/Ketsji/BL_BlenderShader.h9
-rw-r--r--source/gameengine/Ketsji/BL_Material.h2
-rw-r--r--source/gameengine/Ketsji/BL_Shader.cpp2
-rw-r--r--source/gameengine/Ketsji/BL_Shader.h6
-rw-r--r--source/gameengine/Ketsji/BL_Texture.h2
-rw-r--r--source/gameengine/Ketsji/CMakeLists.txt1
-rw-r--r--source/gameengine/Ketsji/KXNetwork/CMakeLists.txt1
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp4
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp4
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkObjectActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkObjectSensor.cpp4
-rw-r--r--source/gameengine/Ketsji/KXNetwork/Makefile2
-rw-r--r--source/gameengine/Ketsji/KX_ArmatureSensor.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.cpp43
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.h14
-rw-r--r--source/gameengine/Ketsji/KX_BulletPhysicsController.h2
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp37
-rw-r--r--source/gameengine/Ketsji/KX_Camera.h4
-rw-r--r--source/gameengine/Ketsji/KX_CameraActuator.cpp6
-rw-r--r--source/gameengine/Ketsji/KX_CameraIpoSGController.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_CameraIpoSGController.h2
-rw-r--r--source/gameengine/Ketsji/KX_ClientObjectInfo.h2
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintWrapper.cpp12
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintWrapper.h2
-rw-r--r--source/gameengine/Ketsji/KX_Dome.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_Dome.h2
-rw-r--r--source/gameengine/Ketsji/KX_EmptyObject.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_EmptyObject.h2
-rw-r--r--source/gameengine/Ketsji/KX_GameActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp98
-rw-r--r--source/gameengine/Ketsji/KX_IInterpolator.h2
-rw-r--r--source/gameengine/Ketsji/KX_IPO_SGController.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_IPO_SGController.h2
-rw-r--r--source/gameengine/Ketsji/KX_IPhysicsController.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_IPhysicsController.h2
-rw-r--r--source/gameengine/Ketsji/KX_IScalarInterpolator.h2
-rw-r--r--source/gameengine/Ketsji/KX_ISceneConverter.h2
-rw-r--r--source/gameengine/Ketsji/KX_ISystem.h2
-rw-r--r--source/gameengine/Ketsji/KX_IpoActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp46
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.h5
-rw-r--r--source/gameengine/Ketsji/KX_Light.cpp13
-rw-r--r--source/gameengine/Ketsji/KX_LightIpoSGController.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_LightIpoSGController.h2
-rw-r--r--source/gameengine/Ketsji/KX_MaterialIpoController.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_MaterialIpoController.h2
-rw-r--r--source/gameengine/Ketsji/KX_MeshProxy.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_MotionState.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_MotionState.h2
-rw-r--r--source/gameengine/Ketsji/KX_NearSensor.cpp3
-rw-r--r--source/gameengine/Ketsji/KX_ObColorIpoSGController.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_ObColorIpoSGController.h2
-rw-r--r--source/gameengine/Ketsji/KX_ObjectActuator.cpp47
-rw-r--r--source/gameengine/Ketsji/KX_OrientationInterpolator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_OrientationInterpolator.h2
-rw-r--r--source/gameengine/Ketsji/KX_ParentActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_PolyProxy.cpp165
-rw-r--r--source/gameengine/Ketsji/KX_PolyProxy.h10
-rw-r--r--source/gameengine/Ketsji/KX_PolygonMaterial.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_PolygonMaterial.h1
-rw-r--r--source/gameengine/Ketsji/KX_PositionInterpolator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_PositionInterpolator.h2
-rw-r--r--source/gameengine/Ketsji/KX_PyConstraintBinding.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_PyMath.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_PyMath.h2
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp145
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.h1
-rw-r--r--source/gameengine/Ketsji/KX_PythonInitTypes.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_PythonSeq.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_RadarSensor.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_RayCast.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_RayCast.h4
-rw-r--r--source/gameengine/Ketsji/KX_RayEventManager.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_RayEventManager.h2
-rw-r--r--source/gameengine/Ketsji/KX_RaySensor.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h2
-rw-r--r--source/gameengine/Ketsji/KX_SG_NodeRelationships.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_SG_NodeRelationships.h6
-rw-r--r--source/gameengine/Ketsji/KX_ScalarInterpolator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_ScalarInterpolator.h2
-rw-r--r--source/gameengine/Ketsji/KX_ScalingInterpolator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_ScalingInterpolator.h2
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp20
-rw-r--r--source/gameengine/Ketsji/KX_Scene.h10
-rw-r--r--source/gameengine/Ketsji/KX_SceneActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_SoundActuator.cpp203
-rw-r--r--source/gameengine/Ketsji/KX_SoundActuator.h4
-rw-r--r--source/gameengine/Ketsji/KX_StateActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_TimeCategoryLogger.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_TimeCategoryLogger.h2
-rw-r--r--source/gameengine/Ketsji/KX_TimeLogger.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_TimeLogger.h2
-rw-r--r--source/gameengine/Ketsji/KX_TouchEventManager.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_TouchEventManager.h2
-rw-r--r--source/gameengine/Ketsji/KX_TouchSensor.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_TrackToActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_VehicleWrapper.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_VertexProxy.cpp458
-rw-r--r--source/gameengine/Ketsji/KX_VertexProxy.h31
-rw-r--r--source/gameengine/Ketsji/KX_VisibilityActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_WorldInfo.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_WorldInfo.h2
-rw-r--r--source/gameengine/Ketsji/KX_WorldIpoController.cpp7
-rw-r--r--source/gameengine/Ketsji/KX_WorldIpoController.h2
-rw-r--r--source/gameengine/Ketsji/Makefile6
-rw-r--r--source/gameengine/Makefile2
-rw-r--r--source/gameengine/Network/CMakeLists.txt1
-rw-r--r--source/gameengine/Network/LoopBackNetwork/CMakeLists.txt1
-rw-r--r--source/gameengine/Network/LoopBackNetwork/Makefile2
-rw-r--r--source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.cpp9
-rw-r--r--source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.h8
-rw-r--r--source/gameengine/Network/Makefile2
-rw-r--r--source/gameengine/Network/NG_NetworkDeviceInterface.h8
-rw-r--r--source/gameengine/Network/NG_NetworkMessage.cpp4
-rw-r--r--source/gameengine/Network/NG_NetworkMessage.h2
-rw-r--r--source/gameengine/Network/NG_NetworkObject.cpp4
-rw-r--r--source/gameengine/Network/NG_NetworkObject.h2
-rw-r--r--source/gameengine/Network/NG_NetworkScene.cpp6
-rw-r--r--source/gameengine/Network/NG_NetworkScene.h2
-rw-r--r--source/gameengine/Network/TerraplayNetwork/Makefile2
-rw-r--r--source/gameengine/Network/TerraplayNetwork/NG_TerraplayNetworkDeviceInterface.cpp4
-rw-r--r--source/gameengine/Network/TerraplayNetwork/NG_TerraplayNetworkDeviceInterface.h2
-rw-r--r--source/gameengine/Physics/Bullet/CMakeLists.txt1
-rw-r--r--source/gameengine/Physics/Bullet/CcdGraphicController.h2
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp2
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.h6
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h2
-rw-r--r--source/gameengine/Physics/Bullet/Makefile2
-rw-r--r--source/gameengine/Physics/Dummy/CMakeLists.txt1
-rw-r--r--source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp4
-rw-r--r--source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h2
-rw-r--r--source/gameengine/Physics/Dummy/Makefile2
-rw-r--r--source/gameengine/Physics/Makefile2
-rw-r--r--source/gameengine/Physics/common/CMakeLists.txt1
-rw-r--r--source/gameengine/Physics/common/Makefile2
-rw-r--r--source/gameengine/Physics/common/PHY_IController.cpp4
-rw-r--r--source/gameengine/Physics/common/PHY_IController.h2
-rw-r--r--source/gameengine/Physics/common/PHY_IGraphicController.cpp4
-rw-r--r--source/gameengine/Physics/common/PHY_IGraphicController.h2
-rw-r--r--source/gameengine/Physics/common/PHY_IMotionState.cpp4
-rw-r--r--source/gameengine/Physics/common/PHY_IMotionState.h2
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsController.cpp4
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsController.h2
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsEnvironment.cpp4
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h4
-rw-r--r--source/gameengine/Physics/common/PHY_IVehicle.h2
-rw-r--r--source/gameengine/PyDoc/API_intro.py2
-rw-r--r--source/gameengine/PyDoc/GameKeys.py174
-rw-r--r--source/gameengine/PyDoc/GameLogic.py515
-rw-r--r--source/gameengine/PyDoc/GameTypes.py6147
-rw-r--r--source/gameengine/PyDoc/PhysicsConstraints.py326
-rw-r--r--source/gameengine/PyDoc/Rasterizer.py221
-rw-r--r--source/gameengine/PyDoc/SConscript34
-rw-r--r--source/gameengine/PyDoc/VideoTexture.py54
-rw-r--r--source/gameengine/PyDoc/bge.events.rst229
-rw-r--r--source/gameengine/PyDoc/bge.logic.rst930
-rw-r--r--source/gameengine/PyDoc/bge.render.rst242
-rw-r--r--source/gameengine/PyDoc/bge.types.rst5202
-rw-r--r--source/gameengine/Rasterizer/CMakeLists.txt1
-rw-r--r--source/gameengine/Rasterizer/Makefile6
-rw-r--r--source/gameengine/Rasterizer/RAS_2DFilterManager.cpp4
-rw-r--r--source/gameengine/Rasterizer/RAS_2DFilterManager.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.cpp10
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.h4
-rw-r--r--source/gameengine/Rasterizer/RAS_Deformer.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_FramingManager.cpp4
-rw-r--r--source/gameengine/Rasterizer/RAS_FramingManager.h4
-rw-r--r--source/gameengine/Rasterizer/RAS_ICanvas.h31
-rw-r--r--source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp4
-rw-r--r--source/gameengine/Rasterizer/RAS_IPolygonMaterial.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_IRasterizer.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_IRenderTools.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_MaterialBucket.h6
-rw-r--r--source/gameengine/Rasterizer/RAS_MeshObject.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt1
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile6
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp8
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_Polygon.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_Rect.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_TexVert.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_texmatrix.cpp4
-rw-r--r--source/gameengine/SceneGraph/CMakeLists.txt1
-rw-r--r--source/gameengine/SceneGraph/Makefile2
-rw-r--r--source/gameengine/SceneGraph/SG_BBox.h2
-rw-r--r--source/gameengine/SceneGraph/SG_Controller.cpp4
-rw-r--r--source/gameengine/SceneGraph/SG_Controller.h2
-rw-r--r--source/gameengine/SceneGraph/SG_DList.h2
-rw-r--r--source/gameengine/SceneGraph/SG_IObject.cpp4
-rw-r--r--source/gameengine/SceneGraph/SG_IObject.h2
-rw-r--r--source/gameengine/SceneGraph/SG_Node.cpp4
-rw-r--r--source/gameengine/SceneGraph/SG_Node.h2
-rw-r--r--source/gameengine/SceneGraph/SG_ParentRelation.h2
-rw-r--r--source/gameengine/SceneGraph/SG_QList.h2
-rw-r--r--source/gameengine/SceneGraph/SG_Spatial.cpp4
-rw-r--r--source/gameengine/SceneGraph/SG_Spatial.h2
-rw-r--r--source/gameengine/SceneGraph/SG_Tree.h4
-rw-r--r--source/gameengine/VideoTexture/CMakeLists.txt1
-rw-r--r--source/gameengine/VideoTexture/ImageBase.cpp4
-rw-r--r--source/gameengine/VideoTexture/ImageBuff.cpp2
-rw-r--r--source/gameengine/VideoTexture/Makefile2
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.cpp3
-rw-r--r--source/gameengine/VideoTexture/blendVideoTex.cpp2
385 files changed, 8569 insertions, 8817 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index 00f556b3e96..01a9e621304 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -28,10 +28,6 @@
* Blender's Ketsji startpoint
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
@@ -76,6 +72,7 @@ extern "C" {
/***/
#include "DNA_view3d_types.h"
#include "DNA_screen_types.h"
+#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
#include "BKE_global.h"
#include "BKE_report.h"
@@ -88,6 +85,7 @@ extern "C" {
#include "BLI_blenlib.h"
#include "BLO_readfile.h"
#include "DNA_scene_types.h"
+#include "BKE_ipo.h"
/***/
#include "AUD_C-API.h"
@@ -124,7 +122,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
{
/* context values */
struct wmWindow *win= CTX_wm_window(C);
- struct Scene *scene= CTX_data_scene(C);
+ struct Scene *startscene= CTX_data_scene(C);
struct Main* maggie1= CTX_data_main(C);
@@ -137,7 +135,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
int exitrequested = KX_EXIT_REQUEST_NO_REQUEST;
Main* blenderdata = maggie1;
- char* startscenename = scene->id.name+2;
+ char* startscenename = startscene->id.name+2;
char pathname[FILE_MAXDIR+FILE_MAXFILE], oldsce[FILE_MAXDIR+FILE_MAXFILE];
STR_String exitstring = "";
BlendFileData *bfd= NULL;
@@ -157,6 +155,10 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
bgl::InitExtensions(true);
+ // VBO code for derived mesh is not compatible with BGE (couldn't find why), so disable
+ int disableVBO = (U.gameflags & USER_DISABLE_VBO);
+ U.gameflags |= USER_DISABLE_VBO;
+
do
{
View3D *v3d= CTX_wm_view3d(C);
@@ -170,12 +172,14 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0);
bool animation_record = (SYS_GetCommandLineInt(syshandle, "animation_record", 0) != 0);
bool displaylists = (SYS_GetCommandLineInt(syshandle, "displaylists", 0) != 0);
+#ifndef DISABLE_PYTHON
bool nodepwarnings = (SYS_GetCommandLineInt(syshandle, "ignore_deprecation_warnings", 0) != 0);
+#endif
bool novertexarrays = (SYS_GetCommandLineInt(syshandle, "novertexarrays", 0) != 0);
if(animation_record) usefixed= true; /* override since you's always want fixed time for sim recording */
// create the canvas, rasterizer and rendertools
- RAS_ICanvas* canvas = new KX_BlenderCanvas(win, area_rect);
+ RAS_ICanvas* canvas = new KX_BlenderCanvas(win, area_rect, ar);
canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE);
RAS_IRenderTools* rendertools = new KX_BlenderRenderTools();
RAS_IRasterizer* rasterizer = NULL;
@@ -222,12 +226,12 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
#endif
//lock frame and camera enabled - storing global values
- int tmp_lay= scene->lay;
- Object *tmp_camera = scene->camera;
+ int tmp_lay= startscene->lay;
+ Object *tmp_camera = startscene->camera;
if (v3d->scenelock==0){
- scene->lay= v3d->lay;
- scene->camera= v3d->camera;
+ startscene->lay= v3d->lay;
+ startscene->camera= v3d->camera;
}
// some blender stuff
@@ -248,7 +252,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
}
if(rv3d->persp==RV3D_CAMOB) {
- if(scene->gm.framing.type == SCE_GAMEFRAMING_BARS) { /* Letterbox */
+ if(startscene->gm.framing.type == SCE_GAMEFRAMING_BARS) { /* Letterbox */
camzoom = 1.0f;
}
else {
@@ -319,22 +323,22 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
}
}
- Scene *blscene= bfd ? bfd->curscene : (Scene *)BLI_findstring(&blenderdata->scene, startscenename, offsetof(ID, name) + 2);
+ Scene *scene= bfd ? bfd->curscene : (Scene *)BLI_findstring(&blenderdata->scene, startscenename, offsetof(ID, name) + 2);
- if (blscene)
+ if (scene)
{
- int startFrame = blscene->r.cfra;
+ int startFrame = scene->r.cfra;
ketsjiengine->SetAnimRecordMode(animation_record, startFrame);
// Quad buffered needs a special window.
- if(blscene->gm.stereoflag == STEREO_ENABLED){
- if (blscene->gm.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED)
- rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) blscene->gm.stereomode);
+ if(scene->gm.stereoflag == STEREO_ENABLED){
+ if (scene->gm.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED)
+ rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) scene->gm.stereomode);
- rasterizer->SetEyeSeparation(blscene->gm.eyeseparation);
+ rasterizer->SetEyeSeparation(scene->gm.eyeseparation);
}
- rasterizer->SetBackColor(blscene->gm.framing.col[0], blscene->gm.framing.col[1], blscene->gm.framing.col[2], 0.0f);
+ rasterizer->SetBackColor(scene->gm.framing.col[0], scene->gm.framing.col[1], scene->gm.framing.col[2], 0.0f);
}
if (exitrequested != KX_EXIT_REQUEST_QUIT_GAME)
@@ -363,19 +367,20 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
if(GPU_glsl_support())
useglslmat = true;
- else if(blscene->gm.matmode == GAME_MAT_GLSL)
+ else if(scene->gm.matmode == GAME_MAT_GLSL)
usemat = false;
- if(usemat && (blscene->gm.matmode != GAME_MAT_TEXFACE))
+ if(usemat && (scene->gm.matmode != GAME_MAT_TEXFACE))
sceneconverter->SetMaterials(true);
- if(useglslmat && (blscene->gm.matmode == GAME_MAT_GLSL))
+ if(useglslmat && (scene->gm.matmode == GAME_MAT_GLSL))
sceneconverter->SetGLSLMaterials(true);
KX_Scene* startscene = new KX_Scene(keyboarddevice,
mousedevice,
networkdevice,
startscenename,
- blscene);
+ scene,
+ canvas);
#ifndef DISABLE_PYTHON
// some python things
@@ -384,13 +389,19 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
#endif // DISABLE_PYTHON
//initialize Dome Settings
- if(blscene->gm.stereoflag == STEREO_DOME)
- ketsjiengine->InitDome(blscene->gm.dome.res, blscene->gm.dome.mode, blscene->gm.dome.angle, blscene->gm.dome.resbuf, blscene->gm.dome.tilt, blscene->gm.dome.warptext);
+ if(scene->gm.stereoflag == STEREO_DOME)
+ ketsjiengine->InitDome(scene->gm.dome.res, scene->gm.dome.mode, scene->gm.dome.angle, scene->gm.dome.resbuf, scene->gm.dome.tilt, scene->gm.dome.warptext);
// initialize 3D Audio Settings
- AUD_set3DSetting(AUD_3DS_SPEED_OF_SOUND, blscene->audio.speed_of_sound);
- AUD_set3DSetting(AUD_3DS_DOPPLER_FACTOR, blscene->audio.doppler_factor);
- AUD_set3DSetting(AUD_3DS_DISTANCE_MODEL, blscene->audio.distance_model);
+ AUD_setSpeedOfSound(scene->audio.speed_of_sound);
+ AUD_setDopplerFactor(scene->audio.doppler_factor);
+ AUD_setDistanceModel(AUD_DistanceModel(scene->audio.distance_model));
+
+ // from see blender.c:
+ // FIXME: this version patching should really be part of the file-reading code,
+ // but we still get too many unrelated data-corruption crashes otherwise...
+ if (blenderdata->versionfile < 250)
+ do_versions_ipos_to_animato(blenderdata);
if (sceneconverter)
{
@@ -506,8 +517,8 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
}
//lock frame and camera enabled - restoring global values
if (v3d->scenelock==0){
- scene->lay= tmp_lay;
- scene->camera= tmp_camera;
+ startscene->lay= tmp_lay;
+ startscene->camera= tmp_camera;
}
// set the cursor back to normal
@@ -557,6 +568,9 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
} while (exitrequested == KX_EXIT_REQUEST_RESTART_GAME || exitrequested == KX_EXIT_REQUEST_START_OTHER_GAME);
+ if (!disableVBO)
+ U.gameflags &= ~USER_DISABLE_VBO;
+
if (bfd) BLO_blendfiledata_free(bfd);
BLI_strncpy(G.sce, oldsce, sizeof(G.sce));
diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt
index 625ad006e0c..57d28561647 100644
--- a/source/gameengine/BlenderRoutines/CMakeLists.txt
+++ b/source/gameengine/BlenderRoutines/CMakeLists.txt
@@ -50,4 +50,3 @@ ELSE(WITH_PYTHON)
ENDIF(WITH_PYTHON)
BLENDERLIB(bf_blroutines "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_bloutines', sources, Split(incs), [], libtype=['game', 'game2', 'player'], priority=[0, 0, 55] , compileflags=cxxflags)
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
index 40775f0355b..b04e951028d 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
@@ -30,15 +30,14 @@
#include "DNA_screen_types.h"
#include "stdio.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-KX_BlenderCanvas::KX_BlenderCanvas(struct wmWindow *win, RAS_Rect &rect) :
+KX_BlenderCanvas::KX_BlenderCanvas(struct wmWindow *win, RAS_Rect &rect, struct ARegion *ar) :
m_win(win),
m_frame_rect(rect)
{
+ // area boundaries needed for mouse coordinates in Letterbox framing mode
+ m_area_left = ar->winrct.xmin;
+ m_area_top = ar->winrct.ymax;
}
KX_BlenderCanvas::~KX_BlenderCanvas()
@@ -104,6 +103,30 @@ int KX_BlenderCanvas::GetHeight(
return m_frame_rect.GetHeight();
}
+int KX_BlenderCanvas::GetMouseX(int x)
+{
+ float left = GetWindowArea().GetLeft();
+ return float(x - (left - m_area_left));
+}
+
+int KX_BlenderCanvas::GetMouseY(int y)
+{
+ float top = GetWindowArea().GetTop();
+ return float(y - (m_area_top - top));
+}
+
+float KX_BlenderCanvas::GetMouseNormalizedX(int x)
+{
+ int can_x = GetMouseX(x);
+ return float(can_x)/this->GetWidth();
+}
+
+float KX_BlenderCanvas::GetMouseNormalizedY(int y)
+{
+ int can_y = GetMouseY(y);
+ return float(can_y)/this->GetHeight();
+}
+
RAS_Rect &
KX_BlenderCanvas::
GetWindowArea(
@@ -117,6 +140,11 @@ SetViewPort(
int x1, int y1,
int x2, int y2
){
+ /* x1 and y1 are the min pixel coordinate (e.g. 0)
+ x2 and y2 are the max pixel coordinate
+ the width,height is calculated including both pixels
+ therefore: max - min + 1
+ */
int vp_width = (x2 - x1) + 1;
int vp_height = (y2 - y1) + 1;
int minx = m_frame_rect.GetLeft();
@@ -134,6 +162,8 @@ SetViewPort(
void KX_BlenderCanvas::SetMouseState(RAS_MouseState mousestate)
{
+ m_mousestate = mousestate;
+
switch (mousestate)
{
case MOUSE_INVISIBLE:
@@ -166,7 +196,7 @@ void KX_BlenderCanvas::SetMousePosition(int x,int y)
int winY = m_frame_rect.GetBottom();
int winH = m_frame_rect.GetHeight();
- BL_warp_pointer(m_win, winX + x, winY + (winH-y-1));
+ BL_warp_pointer(m_win, winX + x, winY + (winH-y));
}
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
index f352a082421..42f956cafcd 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
@@ -64,7 +64,7 @@ public:
*
* @param area The Blender ARegion to run the game within.
*/
- KX_BlenderCanvas(struct wmWindow* win, class RAS_Rect &rect);
+ KX_BlenderCanvas(struct wmWindow* win, class RAS_Rect &rect, struct ARegion* ar);
~KX_BlenderCanvas();
void
@@ -109,6 +109,22 @@ public:
GetHeight(
) const ;
+ int
+ GetMouseX(int x
+ );
+
+ int
+ GetMouseY(int y
+ );
+
+ float
+ GetMouseNormalizedX(int x
+ );
+
+ float
+ GetMouseNormalizedY(int y
+ );
+
const
RAS_Rect &
GetDisplayArea(
@@ -170,11 +186,13 @@ private:
struct wmWindow* m_win;
RAS_Rect m_frame_rect;
RAS_Rect m_area_rect;
+ short m_area_left;
+ short m_area_top;
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderCanvas"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderCanvas"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
index 1f79c03c045..55a687c0baa 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
@@ -36,10 +36,6 @@ extern "C" {
}
#endif
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/*
* This little block needed for linking to Blender...
*/
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.cpp b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.cpp
index 760dd09077e..697687d1b95 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.cpp
@@ -28,7 +28,3 @@
*/
#include "KX_BlenderInputDevice.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
index 9345d6a9284..5bdf0ccd81d 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
@@ -199,7 +199,14 @@ public:
m_reverseKeyTranslateTable[F9KEY ] = KX_F9KEY ;
m_reverseKeyTranslateTable[F10KEY ] = KX_F10KEY ;
m_reverseKeyTranslateTable[F11KEY ] = KX_F11KEY ;
- m_reverseKeyTranslateTable[F12KEY ] = KX_F12KEY ;
+ m_reverseKeyTranslateTable[F12KEY ] = KX_F12KEY ;
+ m_reverseKeyTranslateTable[F13KEY ] = KX_F13KEY ;
+ m_reverseKeyTranslateTable[F14KEY ] = KX_F14KEY ;
+ m_reverseKeyTranslateTable[F15KEY ] = KX_F15KEY ;
+ m_reverseKeyTranslateTable[F16KEY ] = KX_F16KEY ;
+ m_reverseKeyTranslateTable[F17KEY ] = KX_F17KEY ;
+ m_reverseKeyTranslateTable[F18KEY ] = KX_F18KEY ;
+ m_reverseKeyTranslateTable[F19KEY ] = KX_F19KEY ;
m_reverseKeyTranslateTable[PAUSEKEY ] = KX_PAUSEKEY ;
m_reverseKeyTranslateTable[INSERTKEY ] = KX_INSERTKEY ;
@@ -227,8 +234,8 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderInputDevice"); }
- void operator delete( void *mem ) { MEM_freeN(mem); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderInputDevice"); }
+ void operator delete(void *mem) { MEM_freeN(mem); }
#endif
};
#endif //__KX_BLENDERINPUTDEVICE
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp
index 1c5989be301..e8cb25af868 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.cpp
@@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
// annoying warnings about truncated STL debug info
#pragma warning (disable :4786)
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h
index 6cd47a5d93e..eab052895db 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h
@@ -51,8 +51,8 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderKeyboardDevice"); }
- void operator delete( void *mem ) { MEM_freeN(mem); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderKeyboardDevice"); }
+ void operator delete(void *mem) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp
index 7952c3142b4..c3e3935fca5 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp
@@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
// annoying warnings about truncated STL debug info
#pragma warning (disable :4786)
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h
index 8f037ae5b07..ce067ffb379 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h
@@ -49,8 +49,8 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderMouseDevice"); }
- void operator delete( void *mem ) { MEM_freeN(mem); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderMouseDevice"); }
+ void operator delete(void *mem) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
index 07226524538..9a7d9c7bcc0 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
@@ -99,7 +99,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderRenderTools"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderRenderTools"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderSystem.cpp b/source/gameengine/BlenderRoutines/KX_BlenderSystem.cpp
index 2f192666dcd..813869dd032 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderSystem.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderSystem.cpp
@@ -28,10 +28,6 @@
#include "KX_ISystem.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#pragma warning (disable :4786)
#include <windows.h>
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h
index 7c848a7a856..fb40ded9292 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h
@@ -51,7 +51,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSystem"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSystem"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/BlenderRoutines/Makefile b/source/gameengine/BlenderRoutines/Makefile
index 4a437aff97d..3d0f5344c74 100644
--- a/source/gameengine/BlenderRoutines/Makefile
+++ b/source/gameengine/BlenderRoutines/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index 10453fb1253..b8d4c4e0f04 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -53,10 +53,6 @@
#include "PyObjectPlus.h"
#include "KX_PyMath.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
extern "C" {
#include "BKE_animsys.h"
#include "BKE_action.h"
diff --git a/source/gameengine/Converter/BL_ArmatureActuator.cpp b/source/gameengine/Converter/BL_ArmatureActuator.cpp
index 47e1a50857a..82b8307a2bc 100644
--- a/source/gameengine/Converter/BL_ArmatureActuator.cpp
+++ b/source/gameengine/Converter/BL_ArmatureActuator.cpp
@@ -182,13 +182,7 @@ bool BL_ArmatureActuator::Update(double curtime, bool frame)
/* ------------------------------------------------------------------------- */
PyTypeObject BL_ArmatureActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"BL_ArmatureActuator",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/Converter/BL_ArmatureChannel.cpp b/source/gameengine/Converter/BL_ArmatureChannel.cpp
index d4ecc5098d8..8f5ec230486 100644
--- a/source/gameengine/Converter/BL_ArmatureChannel.cpp
+++ b/source/gameengine/Converter/BL_ArmatureChannel.cpp
@@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "DNA_armature_types.h"
#include "BL_ArmatureChannel.h"
#include "BL_ArmatureObject.h"
@@ -124,7 +120,7 @@ PyAttributeDef BL_ArmatureChannel::AttributesPtr[] = {
KX_PYATTRIBUTE_FLOAT_VECTOR_RW("location",-FLT_MAX,FLT_MAX,bPoseChannel,loc,3),
KX_PYATTRIBUTE_FLOAT_VECTOR_RW("scale",-FLT_MAX,FLT_MAX,bPoseChannel,size,3),
KX_PYATTRIBUTE_FLOAT_VECTOR_RW("rotation_quaternion",-1.0f,1.0f,bPoseChannel,quat,4),
- KX_PYATTRIBUTE_FLOAT_VECTOR_RW("rotaion_euler",-10.f,10.f,bPoseChannel,eul,3),
+ KX_PYATTRIBUTE_FLOAT_VECTOR_RW("rotation_euler",-10.f,10.f,bPoseChannel,eul,3),
KX_PYATTRIBUTE_SHORT_RW("rotation_mode",0,ROT_MODE_MAX-1,false,bPoseChannel,rotmode),
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("channel_matrix",bPoseChannel,chan_mat,4),
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("pose_matrix",bPoseChannel,pose_mat,4),
@@ -201,8 +197,7 @@ int BL_ArmatureChannel::py_attr_setattr(void *self_v, const struct KX_PYATTRIBUT
PyObject* BL_ArmatureChannel::py_attr_get_joint_rotation(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef)
{
- BL_ArmatureChannel* self= static_cast<BL_ArmatureChannel*>(self_v);
- bPoseChannel* pchan = self->m_posechannel;
+ bPoseChannel* pchan = static_cast<bPoseChannel*>(self_v);
// decompose the pose matrix in euler rotation
float rest_mat[3][3];
float pose_mat[3][3];
@@ -436,13 +431,13 @@ PyAttributeDef BL_ArmatureBone::AttributesPtr[] = {
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("arm_mat",Bone,arm_mat,4),
KX_PYATTRIBUTE_FLOAT_MATRIX_RO("bone_mat",Bone,bone_mat,4),
KX_PYATTRIBUTE_RO_FUNCTION("parent",BL_ArmatureBone,py_bone_get_parent),
- KX_PYATTRIBUTE_RO_FUNCTION("children",BL_ArmatureBone,py_bone_get_parent),
+ KX_PYATTRIBUTE_RO_FUNCTION("children",BL_ArmatureBone,py_bone_get_children),
{ NULL } //Sentinel
};
PyObject *BL_ArmatureBone::py_bone_get_parent(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
{
- Bone* bone = reinterpret_cast<Bone*>BGE_PROXY_PTR(self);
+ Bone* bone = reinterpret_cast<Bone*>(self);
if (bone->parent) {
// create a proxy unconnected to any GE object
return NewProxyPlus_Ext(NULL,&Type,bone->parent,false);
@@ -452,7 +447,7 @@ PyObject *BL_ArmatureBone::py_bone_get_parent(void *self, const struct KX_PYATTR
PyObject *BL_ArmatureBone::py_bone_get_children(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
{
- Bone* bone = reinterpret_cast<Bone*>BGE_PROXY_PTR(self);
+ Bone* bone = reinterpret_cast<Bone*>(self);
Bone* child;
int count = 0;
for (child=(Bone*)bone->childbase.first; child; child=(Bone*)child->next)
diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.cpp b/source/gameengine/Converter/BL_ArmatureConstraint.cpp
index f9455d37622..0b7ab043d16 100644
--- a/source/gameengine/Converter/BL_ArmatureConstraint.cpp
+++ b/source/gameengine/Converter/BL_ArmatureConstraint.cpp
@@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "DNA_constraint_types.h"
#include "DNA_action_types.h"
#include "BL_ArmatureConstraint.h"
@@ -74,7 +70,7 @@ BL_ArmatureConstraint::BL_ArmatureConstraint(
bConstraint *constraint,
KX_GameObject* target,
KX_GameObject* subtarget)
- : PyObjectPlus(), m_armature(armature), m_constraint(constraint), m_posechannel(posechannel)
+ : PyObjectPlus(), m_constraint(constraint), m_posechannel(posechannel), m_armature(armature)
{
m_target = target;
m_blendtarget = (target) ? target->GetBlenderObject() : NULL;
diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp
index 18204d1deab..97d6b6efd27 100644
--- a/source/gameengine/Converter/BL_ArmatureObject.cpp
+++ b/source/gameengine/Converter/BL_ArmatureObject.cpp
@@ -30,6 +30,7 @@
#include "BL_ArmatureObject.h"
#include "BL_ActionActuator.h"
#include "KX_BlenderSceneConverter.h"
+#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
@@ -53,10 +54,6 @@
#include "MT_Matrix4x4.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/**
* Move here pose function for game engine so that we can mix with GE objects
* Principle is as follow:
@@ -97,7 +94,7 @@ void game_copy_pose(bPose **dst, bPose *src, int copy_constraint)
BLI_duplicatelist(&out->chanbase, &src->chanbase);
/* remap pointers */
- ghash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
+ ghash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "game_copy_pose gh");
pchan= (bPoseChannel*)src->chanbase.first;
outpchan= (bPoseChannel*)out->chanbase.first;
@@ -112,12 +109,17 @@ void game_copy_pose(bPose **dst, bPose *src, int copy_constraint)
if (copy_constraint) {
ListBase listb;
// copy all constraint for backward compatibility
- copy_constraints(&listb, &pchan->constraints); // copy_constraints NULLs listb
+ copy_constraints(&listb, &pchan->constraints, FALSE); // copy_constraints NULLs listb, no need to make extern for this operation.
pchan->constraints= listb;
} else {
pchan->constraints.first = NULL;
pchan->constraints.last = NULL;
}
+
+ // fails to link, props are not used in the BGE yet.
+ /* if(pchan->prop)
+ pchan->prop= IDP_CopyProperty(pchan->prop); */
+ pchan->prop= NULL;
}
BLI_ghash_free(ghash, NULL, NULL);
diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h
index 6ad7de03489..646e9d45365 100644
--- a/source/gameengine/Converter/BL_ArmatureObject.h
+++ b/source/gameengine/Converter/BL_ArmatureObject.h
@@ -94,7 +94,7 @@ public:
BL_ArmatureConstraint* GetConstraint(int index);
// for pose channel python API
void LoadChannels();
- size_t GetChannelNumber() const { return m_constraintNumber; }
+ size_t GetChannelNumber() const { return m_channelNumber; }
BL_ArmatureChannel* GetChannel(bPoseChannel* channel);
BL_ArmatureChannel* GetChannel(const char* channel);
BL_ArmatureChannel* GetChannel(int index);
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index d8484559d91..fa32cfdb866 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -28,10 +28,6 @@
* Convert blender data to ketsji
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#pragma warning (disable : 4786)
#endif
@@ -1552,7 +1548,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
objprop.m_boundclass = KX_BOUNDMESH;
break;
}
- // Object is not a mesh... can't use polyheder.
+ // Object is not a mesh... can't use polyhedron.
// Fall through and become a sphere.
case OB_BOUND_SPHERE:
{
@@ -1733,7 +1729,7 @@ static KX_GameObject *gameobject_from_blenderobject(
// only support relative shape key
bool bHasShapeKey = mesh->key != NULL && mesh->key->type==KEY_RELATIVE;
bool bHasDvert = mesh->dvert != NULL && ob->defbase.first;
- bool bHasArmature = (ob->parent && ob->parent->type == OB_ARMATURE && ob->partype==PARSKEL && bHasDvert);
+ bool bHasArmature = (BL_ModifierDeformer::HasArmatureDeformer(ob) && ob->parent && ob->parent->type == OB_ARMATURE && bHasDvert);
bool bHasModifier = BL_ModifierDeformer::HasCompatibleDeformer(ob);
bool bHasSoftBody = (!ob->parent && (ob->gameflag & OB_SOFT_BODY));
@@ -2361,8 +2357,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
if (me->dvert){
BL_DeformableGameObject *obj = (BL_DeformableGameObject*)converter->FindGameObject(blenderobj);
-
- if (obj && blenderobj->parent && blenderobj->parent->type==OB_ARMATURE && blenderobj->partype==PARSKEL){
+
+ if (obj && BL_ModifierDeformer::HasArmatureDeformer(blenderobj) && blenderobj->parent && blenderobj->parent->type==OB_ARMATURE){
KX_GameObject *par = converter->FindGameObject(blenderobj->parent);
if (par && obj->GetDeformer())
((BL_SkinDeformer*)obj->GetDeformer())->SetArmature((BL_ArmatureObject*) par);
diff --git a/source/gameengine/Converter/BL_DeformableGameObject.cpp b/source/gameengine/Converter/BL_DeformableGameObject.cpp
index 879322fba07..f076d52c745 100644
--- a/source/gameengine/Converter/BL_DeformableGameObject.cpp
+++ b/source/gameengine/Converter/BL_DeformableGameObject.cpp
@@ -33,10 +33,6 @@
#include "RAS_MaterialBucket.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
BL_DeformableGameObject::~BL_DeformableGameObject()
{
if (m_pDeformer)
diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h
index 0696a61eb41..5d16e3ba1a8 100644
--- a/source/gameengine/Converter/BL_DeformableGameObject.h
+++ b/source/gameengine/Converter/BL_DeformableGameObject.h
@@ -102,7 +102,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DeformableGameObject"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DeformableGameObject"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp
index d8fcf8eb35d..332c6fee2cf 100644
--- a/source/gameengine/Converter/BL_MeshDeformer.cpp
+++ b/source/gameengine/Converter/BL_MeshDeformer.cpp
@@ -28,10 +28,6 @@
* Simple deformation controller that restores a mesh to its rest position
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
// This warning tells us about truncation of __long__ stl-generated names.
// It can occasionally cause DevStudio to have internal compiler warnings.
diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h
index c8f58dc7b17..50bad254b42 100644
--- a/source/gameengine/Converter/BL_MeshDeformer.h
+++ b/source/gameengine/Converter/BL_MeshDeformer.h
@@ -89,7 +89,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_MeshDeformer"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_MeshDeformer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp
index e28ea47b162..5ccf8de29b1 100644
--- a/source/gameengine/Converter/BL_ModifierDeformer.cpp
+++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp
@@ -114,11 +114,27 @@ bool BL_ModifierDeformer::HasCompatibleDeformer(Object *ob)
continue;
if (!(md->mode & eModifierMode_Realtime))
continue;
+ /* armature modifier are handled by SkinDeformer, not ModifierDeformer */
+ if (md->type == eModifierType_Armature )
+ continue;
return true;
}
return false;
}
+bool BL_ModifierDeformer::HasArmatureDeformer(Object *ob)
+{
+ if (!ob->modifiers.first)
+ return false;
+
+ ModifierData* md;
+ for (md = (ModifierData*)ob->modifiers.first; md; md = (ModifierData*)md->next) {
+ if (md->type == eModifierType_Armature )
+ return true;
+ }
+ return false;
+}
+
bool BL_ModifierDeformer::Update(void)
{
bool bShapeUpdate = BL_ShapeDeformer::Update();
diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h
index 1122d5e8b32..6e0ede8e62f 100644
--- a/source/gameengine/Converter/BL_ModifierDeformer.h
+++ b/source/gameengine/Converter/BL_ModifierDeformer.h
@@ -45,6 +45,7 @@ class BL_ModifierDeformer : public BL_ShapeDeformer
{
public:
static bool HasCompatibleDeformer(Object *ob);
+ static bool HasArmatureDeformer(Object *ob);
BL_ModifierDeformer(BL_DeformableGameObject *gameobj,
@@ -104,7 +105,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ModifierDeformer"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ModifierDeformer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
index 0b6d8363d73..08d3e54a7c5 100644
--- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
@@ -56,10 +56,6 @@ extern "C" {
#include "BKE_animsys.h"
}
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
BL_ShapeActionActuator::~BL_ShapeActionActuator()
{
}
diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h
index 0ae349642c4..98bd4a1b4ba 100644
--- a/source/gameengine/Converter/BL_ShapeDeformer.h
+++ b/source/gameengine/Converter/BL_ShapeDeformer.h
@@ -86,7 +86,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ShapeDeformer"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ShapeDeformer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h
index 80bdd96febd..df7e8f6dffc 100644
--- a/source/gameengine/Converter/BL_SkinDeformer.h
+++ b/source/gameengine/Converter/BL_SkinDeformer.h
@@ -109,7 +109,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_SkinDeformer"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_SkinDeformer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Converter/BlenderWorldInfo.cpp b/source/gameengine/Converter/BlenderWorldInfo.cpp
index d2ddf108794..47653519cfd 100644
--- a/source/gameengine/Converter/BlenderWorldInfo.cpp
+++ b/source/gameengine/Converter/BlenderWorldInfo.cpp
@@ -31,10 +31,6 @@
#include "BlenderWorldInfo.h"
#include "KX_BlenderGL.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* This little block needed for linking to Blender... */
#ifdef WIN32
#include "BLI_winstuff.h"
diff --git a/source/gameengine/Converter/BlenderWorldInfo.h b/source/gameengine/Converter/BlenderWorldInfo.h
index b2762e9a73e..b500c55a7f2 100644
--- a/source/gameengine/Converter/BlenderWorldInfo.h
+++ b/source/gameengine/Converter/BlenderWorldInfo.h
@@ -98,7 +98,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BlenderWorldInfo"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BlenderWorldInfo"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt
index 26689be644f..97c367dd1f1 100644
--- a/source/gameengine/Converter/CMakeLists.txt
+++ b/source/gameengine/Converter/CMakeLists.txt
@@ -70,4 +70,3 @@ ELSE(WITH_PYTHON)
ENDIF(WITH_PYTHON)
BLENDERLIB(bf_converter "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_converter', sources, Split(incs), [], libtype=['game','player'], priority=[5,70] )
diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
index ad4779fee6a..7b49cbcf668 100644
--- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
+++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
@@ -53,7 +53,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ScalarInterpolator"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ScalarInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -69,7 +69,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_InterpolatorList"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_InterpolatorList"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index 3a5bb92b4fa..b4ddc4f9e54 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -100,6 +100,7 @@ extern "C"
extern "C" {
#include "BKE_context.h"
#include "BLO_readfile.h"
+ #include "BKE_idcode.h"
#include "BKE_report.h"
#include "DNA_space_types.h"
#include "DNA_windowmanager_types.h" /* report api */
@@ -752,22 +753,21 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
{
KX_Scene* scene = scenes->at(i);
//PHY_IPhysicsEnvironment* physEnv = scene->GetPhysicsEnvironment();
- CListValue* parentList = scene->GetRootParentList();
+ CListValue* parentList = scene->GetObjectList();
int numObjects = parentList->GetCount();
int g;
for (g=0;g<numObjects;g++)
{
KX_GameObject* gameObj = (KX_GameObject*)parentList->GetValue(g);
- if (gameObj->IsDynamic())
+ Object* blenderObject = gameObj->GetBlenderObject();
+ if (blenderObject && blenderObject->parent==NULL && gameObj->GetPhysicsController() != NULL)
{
//KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController();
-
- Object* blenderObject = gameObj->GetBlenderObject();
if(blenderObject->adt==NULL)
BKE_id_add_animdata(&blenderObject->id);
- if (blenderObject && blenderObject->adt)
+ if (blenderObject->adt)
{
const MT_Point3& position = gameObj->NodeGetWorldPosition();
//const MT_Vector3& scale = gameObj->NodeGetWorldScaling();
@@ -939,7 +939,7 @@ bool KX_BlenderSceneConverter::LinkBlendFile(const char *path, char *group, KX_S
Main *main_tmp= NULL; /* created only for linking, then freed */
LinkNode *names = NULL;
BlendHandle *bpy_openlib = NULL; /* ptr to the open .blend file */
- int idcode= BLO_idcode_from_name(group);
+ int idcode= BKE_idcode_from_name(group);
short flag= 0; /* dont need any special options */
ReportList reports;
static char err_local[255];
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h
index 3dd3afb5662..23d506c98ff 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.h
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h
@@ -178,7 +178,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSceneConverter"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSceneConverter"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp
index c1a99423fc7..a6b62ecb7b0 100644
--- a/source/gameengine/Converter/KX_ConvertControllers.cpp
+++ b/source/gameengine/Converter/KX_ConvertControllers.cpp
@@ -46,10 +46,6 @@
#include "KX_GameObject.h"
#include "IntValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* This little block needed for linking to Blender... */
#ifdef WIN32
#include "BLI_winstuff.h"
@@ -180,11 +176,11 @@ void BL_ConvertControllers(
/* let the controller print any warnings here when importing */
pyctrl->SetScriptText(STR_String(pycont->module));
pyctrl->SetScriptName(pycont->module); /* will be something like module.func so using it as the name is OK */
- }
- if(pycont->flag & CONT_PY_DEBUG) {
- printf("\nDebuging \"%s\", module for object %s\n\texpect worse performance.\n", pycont->module, blenderobject->id.name+2);
- pyctrl->SetDebug(true);
+ if(pycont->flag & CONT_PY_DEBUG) {
+ printf("\nDebuging \"%s\", module for object %s\n\texpect worse performance.\n", pycont->module, blenderobject->id.name+2);
+ pyctrl->SetDebug(true);
+ }
}
#endif // DISABLE_PYTHON
diff --git a/source/gameengine/Converter/KX_ConvertProperties.cpp b/source/gameengine/Converter/KX_ConvertProperties.cpp
index c5294e64d3d..44c0ad38909 100644
--- a/source/gameengine/Converter/KX_ConvertProperties.cpp
+++ b/source/gameengine/Converter/KX_ConvertProperties.cpp
@@ -28,10 +28,6 @@
#include "KX_ConvertProperties.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "DNA_object_types.h"
#include "DNA_property_types.h"
diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp
index 2f81e82b2c7..d65fee93a12 100644
--- a/source/gameengine/Converter/KX_ConvertSensors.cpp
+++ b/source/gameengine/Converter/KX_ConvertSensors.cpp
@@ -30,10 +30,6 @@
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#pragma warning (disable : 4786)
#endif //WIN32
@@ -257,7 +253,15 @@ void BL_ConvertSensors(struct Object* blenderobject,
gReverseKeyTranslateTable[F9KEY ] = SCA_IInputDevice::KX_F9KEY;
gReverseKeyTranslateTable[F10KEY ] = SCA_IInputDevice::KX_F10KEY;
gReverseKeyTranslateTable[F11KEY ] = SCA_IInputDevice::KX_F11KEY;
- gReverseKeyTranslateTable[F12KEY ] = SCA_IInputDevice::KX_F12KEY;
+ gReverseKeyTranslateTable[F12KEY ] = SCA_IInputDevice::KX_F12KEY;
+ gReverseKeyTranslateTable[F13KEY ] = SCA_IInputDevice::KX_F13KEY;
+ gReverseKeyTranslateTable[F14KEY ] = SCA_IInputDevice::KX_F14KEY;
+ gReverseKeyTranslateTable[F15KEY ] = SCA_IInputDevice::KX_F15KEY;
+ gReverseKeyTranslateTable[F16KEY ] = SCA_IInputDevice::KX_F16KEY;
+ gReverseKeyTranslateTable[F17KEY ] = SCA_IInputDevice::KX_F17KEY;
+ gReverseKeyTranslateTable[F18KEY ] = SCA_IInputDevice::KX_F18KEY;
+ gReverseKeyTranslateTable[F19KEY ] = SCA_IInputDevice::KX_F19KEY;
+
gReverseKeyTranslateTable[PAUSEKEY ] = SCA_IInputDevice::KX_PAUSEKEY;
gReverseKeyTranslateTable[INSERTKEY ] = SCA_IInputDevice::KX_INSERTKEY;
diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp
index 7c6b59a42bd..c983c8a5100 100644
--- a/source/gameengine/Converter/KX_IpoConvert.cpp
+++ b/source/gameengine/Converter/KX_IpoConvert.cpp
@@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
// don't show stl-warnings
@@ -121,7 +117,7 @@ void BL_ConvertIpos(struct Object* blenderobject,KX_GameObject* gameobj,KX_Blend
)
);
- char *rotmode, *drotmode;
+ const char *rotmode, *drotmode;
switch(blenderobject->rotmode)
{
diff --git a/source/gameengine/Converter/KX_SoftBodyDeformer.h b/source/gameengine/Converter/KX_SoftBodyDeformer.h
index 89407f2a279..ce3f695ef11 100644
--- a/source/gameengine/Converter/KX_SoftBodyDeformer.h
+++ b/source/gameengine/Converter/KX_SoftBodyDeformer.h
@@ -92,7 +92,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ShapeDeformer"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ShapeDeformer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Converter/Makefile b/source/gameengine/Converter/Makefile
index b6da47930d3..142841b2b36 100644
--- a/source/gameengine/Converter/Makefile
+++ b/source/gameengine/Converter/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Expressions/BoolValue.cpp b/source/gameengine/Expressions/BoolValue.cpp
index 62e43da335b..e6bb454a1b5 100644
--- a/source/gameengine/Expressions/BoolValue.cpp
+++ b/source/gameengine/Expressions/BoolValue.cpp
@@ -18,10 +18,6 @@
#include "ErrorValue.h"
#include "VoidValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/BoolValue.h b/source/gameengine/Expressions/BoolValue.h
index baec6bdee69..dac70e3c0b7 100644
--- a/source/gameengine/Expressions/BoolValue.h
+++ b/source/gameengine/Expressions/BoolValue.h
@@ -55,7 +55,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CBoolValue"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CBoolValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/CMakeLists.txt b/source/gameengine/Expressions/CMakeLists.txt
index 41f771e12bd..85b5daa3b4a 100644
--- a/source/gameengine/Expressions/CMakeLists.txt
+++ b/source/gameengine/Expressions/CMakeLists.txt
@@ -43,4 +43,3 @@ ELSE(WITH_PYTHON)
ENDIF(WITH_PYTHON)
BLENDERLIB(bf_expressions "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['game','player'], priority = [45,125] )
diff --git a/source/gameengine/Expressions/ConstExpr.cpp b/source/gameengine/Expressions/ConstExpr.cpp
index 6b64be9c9a9..e873e968c86 100644
--- a/source/gameengine/Expressions/ConstExpr.cpp
+++ b/source/gameengine/Expressions/ConstExpr.cpp
@@ -17,10 +17,6 @@
#include "ConstExpr.h"
#include "VectorValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/ConstExpr.h b/source/gameengine/Expressions/ConstExpr.h
index f48b8d34355..aef2ddc2467 100644
--- a/source/gameengine/Expressions/ConstExpr.h
+++ b/source/gameengine/Expressions/ConstExpr.h
@@ -45,7 +45,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CConstExpr"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CConstExpr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/EXP_C-Api.cpp b/source/gameengine/Expressions/EXP_C-Api.cpp
index f944dd38447..d97e13b7784 100644
--- a/source/gameengine/Expressions/EXP_C-Api.cpp
+++ b/source/gameengine/Expressions/EXP_C-Api.cpp
@@ -33,10 +33,6 @@
#include "ErrorValue.h"
#include "InputParser.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
EXP_ValueHandle EXP_CreateInt(int innie)
{
return (EXP_ValueHandle) new CIntValue(innie);
diff --git a/source/gameengine/Expressions/EmptyValue.cpp b/source/gameengine/Expressions/EmptyValue.cpp
index 5d1273b5301..22215ba5ed1 100644
--- a/source/gameengine/Expressions/EmptyValue.cpp
+++ b/source/gameengine/Expressions/EmptyValue.cpp
@@ -21,10 +21,6 @@
#include "ListValue.h"
#include "VoidValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/EmptyValue.h b/source/gameengine/Expressions/EmptyValue.h
index 01029d1655d..f00bc6cfcd7 100644
--- a/source/gameengine/Expressions/EmptyValue.h
+++ b/source/gameengine/Expressions/EmptyValue.h
@@ -38,7 +38,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CEmptyValue"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CEmptyValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/ErrorValue.cpp b/source/gameengine/Expressions/ErrorValue.cpp
index a44abf8b22e..3063d02d69d 100644
--- a/source/gameengine/Expressions/ErrorValue.cpp
+++ b/source/gameengine/Expressions/ErrorValue.cpp
@@ -14,10 +14,6 @@
#include "ErrorValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/ErrorValue.h b/source/gameengine/Expressions/ErrorValue.h
index 2f65850c4f1..6bd131b762d 100644
--- a/source/gameengine/Expressions/ErrorValue.h
+++ b/source/gameengine/Expressions/ErrorValue.h
@@ -37,7 +37,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CErrorValue"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CErrorValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/Expression.cpp b/source/gameengine/Expressions/Expression.cpp
index f16f572c322..7ef0d4cc84c 100644
--- a/source/gameengine/Expressions/Expression.cpp
+++ b/source/gameengine/Expressions/Expression.cpp
@@ -15,10 +15,6 @@
#include "Expression.h"
#include "ErrorValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/Expression.h b/source/gameengine/Expressions/Expression.h
index bd346fd0552..de0c0821727 100644
--- a/source/gameengine/Expressions/Expression.h
+++ b/source/gameengine/Expressions/Expression.h
@@ -66,7 +66,7 @@ class CBrokenLinkInfo
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CBrokenLinkInfo"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CBrokenLinkInfo"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -136,7 +136,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CExpression"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CExpression"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/FloatValue.cpp b/source/gameengine/Expressions/FloatValue.cpp
index b1ac0e1ea9a..82c86ac68b2 100644
--- a/source/gameengine/Expressions/FloatValue.cpp
+++ b/source/gameengine/Expressions/FloatValue.cpp
@@ -19,10 +19,6 @@
#include "ErrorValue.h"
#include "VoidValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/FloatValue.h b/source/gameengine/Expressions/FloatValue.h
index f1469734a1f..49d4efa9f74 100644
--- a/source/gameengine/Expressions/FloatValue.h
+++ b/source/gameengine/Expressions/FloatValue.h
@@ -47,7 +47,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CFloatValue"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CFloatValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/IdentifierExpr.cpp b/source/gameengine/Expressions/IdentifierExpr.cpp
index 23211b7eed3..3cbd5b748d1 100644
--- a/source/gameengine/Expressions/IdentifierExpr.cpp
+++ b/source/gameengine/Expressions/IdentifierExpr.cpp
@@ -28,10 +28,6 @@
#include "IdentifierExpr.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
CIdentifierExpr::CIdentifierExpr(const STR_String& identifier,CValue* id_context)
:m_identifier(identifier)
{
diff --git a/source/gameengine/Expressions/IdentifierExpr.h b/source/gameengine/Expressions/IdentifierExpr.h
index c47a63659c1..0e67b17a9c2 100644
--- a/source/gameengine/Expressions/IdentifierExpr.h
+++ b/source/gameengine/Expressions/IdentifierExpr.h
@@ -50,7 +50,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIdentifierExpr"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CIdentifierExpr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/IfExpr.cpp b/source/gameengine/Expressions/IfExpr.cpp
index fcb37bff52d..0aa9cfbd3c6 100644
--- a/source/gameengine/Expressions/IfExpr.cpp
+++ b/source/gameengine/Expressions/IfExpr.cpp
@@ -17,10 +17,6 @@
#include "ErrorValue.h"
#include "BoolValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/IfExpr.h b/source/gameengine/Expressions/IfExpr.h
index f06718c851f..b2a953bd36d 100644
--- a/source/gameengine/Expressions/IfExpr.h
+++ b/source/gameengine/Expressions/IfExpr.h
@@ -48,7 +48,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIfExpr"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CIfExpr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp
index 96a52aec028..8187ff6a9e8 100644
--- a/source/gameengine/Expressions/InputParser.cpp
+++ b/source/gameengine/Expressions/InputParser.cpp
@@ -29,10 +29,6 @@
#include "Operator1Expr.h"
#include "IdentifierExpr.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
// this is disable at the moment, I expected a memleak from it, but the error-cleanup was the reason
// well, looks we don't need it anyway, until maybe the Curved Surfaces are integrated into CSG
// cool things like (IF(LOD==1,CCurvedValue,IF(LOD==2,CCurvedValue2)) etc...
diff --git a/source/gameengine/Expressions/InputParser.h b/source/gameengine/Expressions/InputParser.h
index 0d7eab27aeb..b640d4eedc7 100644
--- a/source/gameengine/Expressions/InputParser.h
+++ b/source/gameengine/Expressions/InputParser.h
@@ -106,7 +106,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CParser"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CParser"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/IntValue.cpp b/source/gameengine/Expressions/IntValue.cpp
index badba8ead63..83e57200db0 100644
--- a/source/gameengine/Expressions/IntValue.cpp
+++ b/source/gameengine/Expressions/IntValue.cpp
@@ -19,10 +19,6 @@
#include "StringValue.h"
#include "VoidValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/IntValue.h b/source/gameengine/Expressions/IntValue.h
index 26150674c93..63efea56d14 100644
--- a/source/gameengine/Expressions/IntValue.h
+++ b/source/gameengine/Expressions/IntValue.h
@@ -62,7 +62,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIntValue"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CIntValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/KX_HashedPtr.cpp b/source/gameengine/Expressions/KX_HashedPtr.cpp
index dbf8058d012..1743e55c2bf 100644
--- a/source/gameengine/Expressions/KX_HashedPtr.cpp
+++ b/source/gameengine/Expressions/KX_HashedPtr.cpp
@@ -28,10 +28,6 @@
#include "KX_HashedPtr.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
unsigned int KX_Hash(void * inDWord)
{
#if defined(_WIN64)
diff --git a/source/gameengine/Expressions/KX_HashedPtr.h b/source/gameengine/Expressions/KX_HashedPtr.h
index c4abf3b3279..09332377918 100644
--- a/source/gameengine/Expressions/KX_HashedPtr.h
+++ b/source/gameengine/Expressions/KX_HashedPtr.h
@@ -52,7 +52,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CHashedPtr"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CHashedPtr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp
index 6e47ed913db..4d9d82efb98 100644
--- a/source/gameengine/Expressions/ListValue.cpp
+++ b/source/gameengine/Expressions/ListValue.cpp
@@ -24,10 +24,6 @@
#include "BLO_sys_types.h" /* for intptr_t support */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
@@ -366,8 +362,8 @@ PyObject* listvalue_buffer_slice(PyObject* self,Py_ssize_t ilow, Py_ssize_t ihig
if (ihigh >= n)
ihigh = n;
- if (ihigh < ilow)
- ihigh = ilow;
+ if (ihigh < ilow)
+ ihigh = ilow;
newlist = PyList_New(ihigh - ilow);
if (!newlist)
@@ -495,6 +491,8 @@ static PySequenceMethods listvalue_as_sequence = {
NULL, /*sq_ass_item*/
NULL, /*sq_ass_slice*/
(objobjproc)listvalue_buffer_contains, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
diff --git a/source/gameengine/Expressions/Makefile b/source/gameengine/Expressions/Makefile
index 09512c3ae87..892a8c2b246 100644
--- a/source/gameengine/Expressions/Makefile
+++ b/source/gameengine/Expressions/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Expressions/Operator1Expr.cpp b/source/gameengine/Expressions/Operator1Expr.cpp
index 85b3c669802..ca852020e5a 100644
--- a/source/gameengine/Expressions/Operator1Expr.cpp
+++ b/source/gameengine/Expressions/Operator1Expr.cpp
@@ -15,10 +15,6 @@
#include "Operator1Expr.h"
#include "EmptyValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/Operator1Expr.h b/source/gameengine/Expressions/Operator1Expr.h
index c2bc68076a0..62f178fb9f7 100644
--- a/source/gameengine/Expressions/Operator1Expr.h
+++ b/source/gameengine/Expressions/Operator1Expr.h
@@ -50,7 +50,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator1Expr"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator1Expr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/Operator2Expr.cpp b/source/gameengine/Expressions/Operator2Expr.cpp
index da0a3e9a9f9..9428559c607 100644
--- a/source/gameengine/Expressions/Operator2Expr.cpp
+++ b/source/gameengine/Expressions/Operator2Expr.cpp
@@ -20,10 +20,6 @@
#include "StringValue.h"
#include "VoidValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/Operator2Expr.h b/source/gameengine/Expressions/Operator2Expr.h
index bb26b7c03be..73ea177f0d0 100644
--- a/source/gameengine/Expressions/Operator2Expr.h
+++ b/source/gameengine/Expressions/Operator2Expr.h
@@ -56,7 +56,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator2Expr"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator2Expr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index 7c830a33bbb..32bf4ba95c4 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/*------------------------------
* PyObjectPlus cpp
*
@@ -170,7 +166,7 @@ PyObject * PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObjec
return NULL;
}
- /* use base_type rather then Py_TYPE(base) because we could alredy be subtyped */
+ /* use base_type rather then Py_TYPE(base) because we could already be subtyped */
if(!PyType_IsSubtype(type, base_type)) {
PyErr_Format(PyExc_TypeError, "can't subclass blender game type <%s> from <%s> because it is not a subclass", base_type->tp_name, type->tp_name);
return NULL;
@@ -282,7 +278,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *
// the attribute has no field correspondance, handover processing to function.
if (attrdef->m_getFunction == NULL)
return NULL;
- return (*attrdef->m_getFunction)(ref, attrdef);
+ return (*attrdef->m_getFunction)(ptr, attrdef);
}
ptr += attrdef->m_offset;
if (attrdef->m_length > 1)
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index d81753ce64d..625549a272e 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -46,7 +46,7 @@
#ifndef DISABLE_PYTHON
#ifdef USE_MATHUTILS
extern "C" {
-#include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */
+#include "../../blender/python/generic/mathutils.h" /* so we can have mathutils callbacks */
}
#endif
@@ -135,8 +135,8 @@ typedef struct PyObjectPlus_Proxy {
// leave above line empty (macro)!
#ifdef WITH_CXX_GUARDEDALLOC
#define Py_Header __Py_Header \
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \
- void operator delete( void *mem ) { MEM_freeN(mem); } \
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \
+ void operator delete(void *mem) { MEM_freeN(mem); } \
#else
#define Py_Header __Py_Header
@@ -144,7 +144,7 @@ typedef struct PyObjectPlus_Proxy {
#ifdef WITH_CXX_GUARDEDALLOC
#define Py_HeaderPtr __Py_HeaderPtr \
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \
void operator delete( void *mem ) { MEM_freeN(mem); } \
#else
@@ -319,9 +319,6 @@ typedef struct KX_PYATTRIBUTE_DEF {
} m_typeCheck;
} PyAttributeDef;
-#define KX_PYATTRIBUTE_DUMMY(name) \
- { name, KX_PYATTRIBUTE_TYPE_DUMMY, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, false, 0, 0, 1, NULL, NULL, NULL, {NULL, NULL, NULL, NULL, NULL, NULL, NULL} }
-
#define KX_PYATTRIBUTE_BOOL_RW(name,object,field) \
{ name, KX_PYATTRIBUTE_TYPE_BOOL, KX_PYATTRIBUTE_RW, 0, 1, 0.f, 0.f, false, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {&((object *)0)->field, NULL, NULL, NULL, NULL, NULL, NULL} }
#define KX_PYATTRIBUTE_BOOL_RW_CHECK(name,object,field,function) \
@@ -466,16 +463,17 @@ typedef PyTypeObject * PyParentObject; // Define the PyParent Object
#define Py_Header \
public: \
-
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PyObjectPlus"); } \
+ void operator delete( void *mem ) { MEM_freeN(mem); } \
#define Py_HeaderPtr \
public: \
-
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PyObjectPlusPtr"); } \
+ void operator delete( void *mem ) { MEM_freeN(mem); } \
#endif
-
// By making SG_QList the ultimate parent for PyObjectPlus objects, it
// allows to put them in 2 different dynamic lists at the same time
// The use of these links is interesting because they free of memory allocation
diff --git a/source/gameengine/Expressions/StringValue.cpp b/source/gameengine/Expressions/StringValue.cpp
index a7033fcf11c..d0aa8d26678 100644
--- a/source/gameengine/Expressions/StringValue.cpp
+++ b/source/gameengine/Expressions/StringValue.cpp
@@ -17,10 +17,6 @@
#include "ErrorValue.h"
#include "VoidValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/StringValue.h b/source/gameengine/Expressions/StringValue.h
index a23bb4ec3e2..d28e435e2a7 100644
--- a/source/gameengine/Expressions/StringValue.h
+++ b/source/gameengine/Expressions/StringValue.h
@@ -52,7 +52,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CStringValue"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CStringValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp
index 6d2dfe2a6e3..1f4f961268b 100644
--- a/source/gameengine/Expressions/Value.cpp
+++ b/source/gameengine/Expressions/Value.cpp
@@ -23,10 +23,6 @@
#include "ErrorValue.h"
#include "ListValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h
index f639ae5af78..2bb9e39cafc 100644
--- a/source/gameengine/Expressions/Value.h
+++ b/source/gameengine/Expressions/Value.h
@@ -181,7 +181,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CAction"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CAction"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -436,7 +436,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CPropValue"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CPropValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/VectorValue.cpp b/source/gameengine/Expressions/VectorValue.cpp
index c58c78e6ebe..59ff601746f 100644
--- a/source/gameengine/Expressions/VectorValue.cpp
+++ b/source/gameengine/Expressions/VectorValue.cpp
@@ -12,10 +12,6 @@
*
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#pragma warning (disable:4786)
#endif
diff --git a/source/gameengine/Expressions/VectorValue.h b/source/gameengine/Expressions/VectorValue.h
index 49fb1e7ea08..cc4deda2041 100644
--- a/source/gameengine/Expressions/VectorValue.h
+++ b/source/gameengine/Expressions/VectorValue.h
@@ -83,7 +83,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CVectorValue"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CVectorValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Expressions/VoidValue.h b/source/gameengine/Expressions/VoidValue.h
index 5281fb4f8a3..f30f8c1be7c 100644
--- a/source/gameengine/Expressions/VoidValue.h
+++ b/source/gameengine/Expressions/VoidValue.h
@@ -63,7 +63,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CVoidValue"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CVoidValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/CMakeLists.txt b/source/gameengine/GameLogic/CMakeLists.txt
index 3ffba14ec95..93183dafeee 100644
--- a/source/gameengine/GameLogic/CMakeLists.txt
+++ b/source/gameengine/GameLogic/CMakeLists.txt
@@ -49,4 +49,3 @@ ELSE(WITH_PYTHON)
ENDIF(WITH_PYTHON)
BLENDERLIB(bf_logic "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_logic', sources, Split(incs), [], libtype=['game','player'], priority=[30, 110] )
diff --git a/source/gameengine/GameLogic/Joystick/Makefile b/source/gameengine/GameLogic/Joystick/Makefile
index 02def1cec62..5ab297824dd 100644
--- a/source/gameengine/GameLogic/Joystick/Makefile
+++ b/source/gameengine/GameLogic/Joystick/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/GameLogic/Makefile b/source/gameengine/GameLogic/Makefile
index a1794a60452..9c8bd73cdc0 100644
--- a/source/gameengine/GameLogic/Makefile
+++ b/source/gameengine/GameLogic/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
@@ -38,10 +38,10 @@ include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
-CPPFLAGS += -I../Expressions
+CPPFLAGS += -I../Expressions
CPPFLAGS += -I../SceneGraph
CPPFLAGS += -I../Rasterizer
-CPPFLAGS += -I$(NAN_STRING)/include
+CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../../blender/makesdna
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
index 24f919b7364..f6d24af0e67 100644
--- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
+++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
@@ -26,9 +26,6 @@
#include "SCA_IActuator.h"
#include "SCA_2DFilterActuator.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
#include <iostream>
SCA_2DFilterActuator::~SCA_2DFilterActuator()
diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp
index 134e363708c..53c9be5215e 100644
--- a/source/gameengine/GameLogic/SCA_ANDController.cpp
+++ b/source/gameengine/GameLogic/SCA_ANDController.cpp
@@ -34,10 +34,6 @@
#include "SCA_LogicManager.h"
#include "BoolValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp
index 5b2bdb07892..9a6ed25a203 100644
--- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp
@@ -30,10 +30,6 @@
#include "SCA_ActuatorEventManager.h"
#include "SCA_ActuatorSensor.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SCA_ActuatorEventManager::SCA_ActuatorEventManager(class SCA_LogicManager* logicmgr)
: SCA_EventManager(logicmgr, ACTUATOR_EVENTMGR)
diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h
index 9adb9fcca39..859cc5023f1 100644
--- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h
+++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h
@@ -47,7 +47,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ActuatorEventManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ActuatorEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
index af5c3e7d364..c77e58d2f3b 100644
--- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
@@ -34,10 +34,6 @@
#include "SCA_EventManager.h"
#include "SCA_LogicManager.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SCA_ActuatorSensor::SCA_ActuatorSensor(SCA_EventManager* eventmgr,
SCA_IObject* gameobj,
const STR_String& actname)
diff --git a/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp b/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp
index d1d7ac2095e..7ecd286ea43 100644
--- a/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp
@@ -35,10 +35,6 @@
#include <vector>
#include "SCA_ISensor.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
using namespace std;
SCA_AlwaysEventManager::SCA_AlwaysEventManager(class SCA_LogicManager* logicmgr)
diff --git a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h
index cbbb5debd3c..59429303fc4 100644
--- a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h
+++ b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h
@@ -41,7 +41,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_AlwaysEventManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_AlwaysEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp
index 6198a3ba471..0f3b81a057e 100644
--- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp
@@ -29,10 +29,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
// This warning tells us about truncation of __long__ stl-generated names.
// It can occasionally cause DevStudio to have internal compiler warnings.
diff --git a/source/gameengine/GameLogic/SCA_BasicEventManager.cpp b/source/gameengine/GameLogic/SCA_BasicEventManager.cpp
index f07d3309386..2fdb1a96216 100644
--- a/source/gameengine/GameLogic/SCA_BasicEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_BasicEventManager.cpp
@@ -35,10 +35,6 @@
#include <vector>
#include "SCA_ISensor.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
using namespace std;
SCA_BasicEventManager::SCA_BasicEventManager(class SCA_LogicManager* logicmgr)
diff --git a/source/gameengine/GameLogic/SCA_BasicEventManager.h b/source/gameengine/GameLogic/SCA_BasicEventManager.h
index a0fae4958c1..db67b180fd8 100644
--- a/source/gameengine/GameLogic/SCA_BasicEventManager.h
+++ b/source/gameengine/GameLogic/SCA_BasicEventManager.h
@@ -48,7 +48,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_BasicEventManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_BasicEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp
index 502c2cb6370..701bcb2fc2f 100644
--- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp
+++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp
@@ -29,10 +29,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
// This warning tells us about truncation of __long__ stl-generated names.
// It can occasionally cause DevStudio to have internal compiler warnings.
diff --git a/source/gameengine/GameLogic/SCA_EventManager.cpp b/source/gameengine/GameLogic/SCA_EventManager.cpp
index c78acd380e0..3a4a06ebfbd 100644
--- a/source/gameengine/GameLogic/SCA_EventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_EventManager.cpp
@@ -30,10 +30,6 @@
#include "SCA_EventManager.h"
#include "SCA_ISensor.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SCA_EventManager::SCA_EventManager(SCA_LogicManager* logicmgr, EVENT_MANAGER_TYPE mgrtype)
:m_logicmgr(logicmgr),
diff --git a/source/gameengine/GameLogic/SCA_EventManager.h b/source/gameengine/GameLogic/SCA_EventManager.h
index 8f77e7d4905..b01d3641cdb 100644
--- a/source/gameengine/GameLogic/SCA_EventManager.h
+++ b/source/gameengine/GameLogic/SCA_EventManager.h
@@ -82,7 +82,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_EventManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_EventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.cpp b/source/gameengine/GameLogic/SCA_ExpressionController.cpp
index 0db36099984..b678648ca58 100644
--- a/source/gameengine/GameLogic/SCA_ExpressionController.cpp
+++ b/source/gameengine/GameLogic/SCA_ExpressionController.cpp
@@ -38,10 +38,6 @@
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.h b/source/gameengine/GameLogic/SCA_ExpressionController.h
index d7bb8edebb1..38e3904a8d6 100644
--- a/source/gameengine/GameLogic/SCA_ExpressionController.h
+++ b/source/gameengine/GameLogic/SCA_ExpressionController.h
@@ -57,7 +57,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ExpressionController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ExpressionController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_IActuator.cpp b/source/gameengine/GameLogic/SCA_IActuator.cpp
index 9755d151fb3..b836227895f 100644
--- a/source/gameengine/GameLogic/SCA_IActuator.cpp
+++ b/source/gameengine/GameLogic/SCA_IActuator.cpp
@@ -29,10 +29,6 @@
#include "SCA_IActuator.h"
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
using namespace std;
SCA_IActuator::SCA_IActuator(SCA_IObject* gameobj, KX_ACTUATOR_TYPE type) :
diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h
index f456183a16c..d3ead7c7460 100644
--- a/source/gameengine/GameLogic/SCA_IActuator.h
+++ b/source/gameengine/GameLogic/SCA_IActuator.h
@@ -157,7 +157,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IActuator"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IActuator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp
index c72dfcc696c..c291ff091aa 100644
--- a/source/gameengine/GameLogic/SCA_IController.cpp
+++ b/source/gameengine/GameLogic/SCA_IController.cpp
@@ -35,10 +35,6 @@
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SCA_IController::SCA_IController(SCA_IObject* gameobj)
:
SCA_ILogicBrick(gameobj),
diff --git a/source/gameengine/GameLogic/SCA_IInputDevice.h b/source/gameengine/GameLogic/SCA_IInputDevice.h
index b49168f325b..a13efee1316 100644
--- a/source/gameengine/GameLogic/SCA_IInputDevice.h
+++ b/source/gameengine/GameLogic/SCA_IInputDevice.h
@@ -230,6 +230,13 @@ public:
KX_F10KEY,
KX_F11KEY,
KX_F12KEY,
+ KX_F13KEY,
+ KX_F14KEY,
+ KX_F15KEY,
+ KX_F16KEY,
+ KX_F17KEY,
+ KX_F18KEY,
+ KX_F19KEY,
KX_PAUSEKEY,
KX_INSERTKEY,
@@ -309,8 +316,8 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_InputEvent"); }
- void operator delete( void *mem ) { MEM_freeN(mem); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_InputEvent"); }
+ void operator delete(void *mem) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
index b82fc4e2dd7..f2e1a8dd151 100644
--- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
+++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
@@ -29,10 +29,6 @@
#include "SCA_ILogicBrick.h"
#include "PyObjectPlus.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SCA_LogicManager* SCA_ILogicBrick::m_sCurrentLogicManager = NULL;
SCA_ILogicBrick::SCA_ILogicBrick(SCA_IObject* gameobj)
diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp
index c43e5ed0598..7c0a5b2db15 100644
--- a/source/gameengine/GameLogic/SCA_IObject.cpp
+++ b/source/gameengine/GameLogic/SCA_IObject.cpp
@@ -35,10 +35,6 @@
#include "MT_Point3.h"
#include "ListValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
MT_Point3 SCA_IObject::m_sDummy=MT_Point3(0,0,0);
SG_QList SCA_IObject::m_activeBookmarkedControllers;
diff --git a/source/gameengine/GameLogic/SCA_IScene.cpp b/source/gameengine/GameLogic/SCA_IScene.cpp
index b11daf6653f..75e323efe94 100644
--- a/source/gameengine/GameLogic/SCA_IScene.cpp
+++ b/source/gameengine/GameLogic/SCA_IScene.cpp
@@ -29,10 +29,6 @@
#include "SCA_IScene.h"
#include "Value.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SCA_DebugProp::SCA_DebugProp(): m_obj(NULL)
{
}
diff --git a/source/gameengine/GameLogic/SCA_IScene.h b/source/gameengine/GameLogic/SCA_IScene.h
index 7fd04e9d27f..93b040c9a31 100644
--- a/source/gameengine/GameLogic/SCA_IScene.h
+++ b/source/gameengine/GameLogic/SCA_IScene.h
@@ -72,7 +72,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IScene"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IScene"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp
index c9c858fd868..fada69848b2 100644
--- a/source/gameengine/GameLogic/SCA_ISensor.cpp
+++ b/source/gameengine/GameLogic/SCA_ISensor.cpp
@@ -37,10 +37,6 @@
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* Native functions */
void SCA_ISensor::ReParent(SCA_IObject* parent)
{
@@ -361,9 +357,8 @@ PyAttributeDef SCA_ISensor::Attributes[] = {
KX_PYATTRIBUTE_RO_FUNCTION("triggered", SCA_ISensor, pyattr_get_triggered),
KX_PYATTRIBUTE_RO_FUNCTION("positive", SCA_ISensor, pyattr_get_positive),
KX_PYATTRIBUTE_RO_FUNCTION("status", SCA_ISensor, pyattr_get_status),
- //KX_PYATTRIBUTE_TODO("links"),
- //KX_PYATTRIBUTE_TODO("posTicks"),
- //KX_PYATTRIBUTE_TODO("negTicks"),
+ KX_PYATTRIBUTE_RO_FUNCTION("pos_ticks", SCA_ISensor, pyattr_get_posTicks),
+ KX_PYATTRIBUTE_RO_FUNCTION("neg_ticks", SCA_ISensor, pyattr_get_negTicks),
{ NULL } //Sentinel
};
@@ -405,6 +400,18 @@ PyObject* SCA_ISensor::pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF
return PyLong_FromSsize_t(status);
}
+PyObject* SCA_ISensor::pyattr_get_posTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
+ return PyLong_FromLong(self->GetPosTicks());
+}
+
+PyObject* SCA_ISensor::pyattr_get_negTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
+ return PyLong_FromLong(self->GetNegTicks());
+}
+
int SCA_ISensor::pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h
index 42d06d856b6..2d3a3ef08a0 100644
--- a/source/gameengine/GameLogic/SCA_ISensor.h
+++ b/source/gameengine/GameLogic/SCA_ISensor.h
@@ -167,6 +167,18 @@ public:
return m_prev_state;
}
+ /** get the number of ticks since the last positive pulse */
+ int GetPosTicks()
+ {
+ return m_pos_ticks;
+ }
+
+ /** get the number of ticks since the last negative pulse */
+ int GetNegTicks()
+ {
+ return m_neg_ticks;
+ }
+
/** Resume sensing. */
void Resume();
@@ -185,6 +197,9 @@ public:
static PyObject* pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_posTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_negTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+
static int pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_check_tap(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.cpp b/source/gameengine/GameLogic/SCA_JoystickManager.cpp
index 94330e52da9..5a975552d3d 100644
--- a/source/gameengine/GameLogic/SCA_JoystickManager.cpp
+++ b/source/gameengine/GameLogic/SCA_JoystickManager.cpp
@@ -30,9 +30,6 @@
//#include <vector>
#include "SCA_ISensor.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
//using namespace std;
diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.h b/source/gameengine/GameLogic/SCA_JoystickManager.h
index cde2e866815..e5f53442049 100644
--- a/source/gameengine/GameLogic/SCA_JoystickManager.h
+++ b/source/gameengine/GameLogic/SCA_JoystickManager.h
@@ -48,7 +48,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_JoystickManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_JoystickManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
index b79b014a161..29a6a73b865 100644
--- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
@@ -36,10 +36,6 @@
#include <iostream>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SCA_JoystickSensor::SCA_JoystickSensor(class SCA_JoystickManager* eventmgr,
SCA_IObject* gameobj,
@@ -294,7 +290,6 @@ PyAttributeDef SCA_JoystickSensor::Attributes[] = {
KX_PYATTRIBUTE_RO_FUNCTION("numButtons", SCA_JoystickSensor, pyattr_get_num_buttons),
KX_PYATTRIBUTE_RO_FUNCTION("numHats", SCA_JoystickSensor, pyattr_get_num_hats),
KX_PYATTRIBUTE_RO_FUNCTION("connected", SCA_JoystickSensor, pyattr_get_connected),
- //KX_PYATTRIBUTE_TODO("events"),
{ NULL } //Sentinel
};
diff --git a/source/gameengine/GameLogic/SCA_KeyboardManager.h b/source/gameengine/GameLogic/SCA_KeyboardManager.h
index a9fe208eaca..53735f9fae1 100644
--- a/source/gameengine/GameLogic/SCA_KeyboardManager.h
+++ b/source/gameengine/GameLogic/SCA_KeyboardManager.h
@@ -58,7 +58,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_KeyboardManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_KeyboardManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
index 224a3bbaf80..c49d65226dc 100644
--- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
@@ -33,10 +33,6 @@
#include "StringValue.h"
#include "SCA_IInputDevice.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp
index 9f9eb8a785f..d003c5618f1 100644
--- a/source/gameengine/GameLogic/SCA_LogicManager.cpp
+++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp
@@ -36,10 +36,6 @@
#include "SCA_PythonController.h"
#include <set>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SCA_LogicManager::SCA_LogicManager()
{
diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h
index 85733275a45..c5f377eeb44 100644
--- a/source/gameengine/GameLogic/SCA_LogicManager.h
+++ b/source/gameengine/GameLogic/SCA_LogicManager.h
@@ -146,7 +146,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_LogicManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_LogicManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_MouseManager.cpp b/source/gameengine/GameLogic/SCA_MouseManager.cpp
index 4f5d199e163..f7f9a566c8d 100644
--- a/source/gameengine/GameLogic/SCA_MouseManager.cpp
+++ b/source/gameengine/GameLogic/SCA_MouseManager.cpp
@@ -30,10 +30,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
// This warning tells us about truncation of __long__ stl-generated names.
// It can occasionally cause DevStudio to have internal compiler warnings.
@@ -44,12 +40,15 @@
#include "SCA_MouseManager.h"
#include "SCA_MouseSensor.h"
#include "IntValue.h"
+#include "RAS_ICanvas.h"
SCA_MouseManager::SCA_MouseManager(SCA_LogicManager* logicmgr,
- SCA_IInputDevice* mousedev)
+ SCA_IInputDevice* mousedev,
+ RAS_ICanvas* canvas)
: SCA_EventManager(logicmgr, MOUSE_EVENTMGR),
- m_mousedevice (mousedev)
+ m_mousedevice (mousedev),
+ m_canvas(canvas)
{
m_xpos = 0;
m_ypos = 0;
@@ -82,12 +81,13 @@ void SCA_MouseManager::NextFrame()
// coordinates
if (!mousesensor->IsSuspended())
{
- const SCA_InputEvent& event =
+ const SCA_InputEvent& event1 =
m_mousedevice->GetEventValue(SCA_IInputDevice::KX_MOUSEX);
- int mx = event.m_eventval;
const SCA_InputEvent& event2 =
m_mousedevice->GetEventValue(SCA_IInputDevice::KX_MOUSEY);
- int my = event2.m_eventval;
+
+ int mx = this->m_canvas->GetMouseX(event1.m_eventval);
+ int my = this->m_canvas->GetMouseY(event2.m_eventval);
mousesensor->setX(mx);
mousesensor->setY(my);
diff --git a/source/gameengine/GameLogic/SCA_MouseManager.h b/source/gameengine/GameLogic/SCA_MouseManager.h
index 82a8c996ef5..8bf060537ca 100644
--- a/source/gameengine/GameLogic/SCA_MouseManager.h
+++ b/source/gameengine/GameLogic/SCA_MouseManager.h
@@ -47,12 +47,13 @@ class SCA_MouseManager : public SCA_EventManager
{
class SCA_IInputDevice* m_mousedevice;
+ class RAS_ICanvas* m_canvas;
unsigned short m_xpos; // Cached location of the mouse pointer
unsigned short m_ypos;
public:
- SCA_MouseManager(class SCA_LogicManager* logicmgr,class SCA_IInputDevice* mousedev);
+ SCA_MouseManager(class SCA_LogicManager* logicmgr,class SCA_IInputDevice* mousedev, class RAS_ICanvas* canvas);
virtual ~SCA_MouseManager();
/**
@@ -66,7 +67,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_MouseManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_MouseManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp
index 10835f13d54..9f4b25986b0 100644
--- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp
@@ -38,10 +38,6 @@
#include "ConstExpr.h"
#include <iostream>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp
index 233adcb76dd..c09a53d8ac7 100644
--- a/source/gameengine/GameLogic/SCA_NANDController.cpp
+++ b/source/gameengine/GameLogic/SCA_NANDController.cpp
@@ -34,10 +34,6 @@
#include "SCA_LogicManager.h"
#include "BoolValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp
index 7c0a4e89e22..8ebd79efcfa 100644
--- a/source/gameengine/GameLogic/SCA_NORController.cpp
+++ b/source/gameengine/GameLogic/SCA_NORController.cpp
@@ -34,10 +34,6 @@
#include "SCA_LogicManager.h"
#include "BoolValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp
index 6df566f4695..a638147e211 100644
--- a/source/gameengine/GameLogic/SCA_ORController.cpp
+++ b/source/gameengine/GameLogic/SCA_ORController.cpp
@@ -34,10 +34,6 @@
#include "SCA_LogicManager.h"
#include "BoolValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
index 4ead0c54392..c1b49d32712 100644
--- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
+++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
@@ -34,10 +34,6 @@
#include "Operator2Expr.h"
#include "ConstExpr.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp b/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp
index d78a9afbaca..f6a1b257c18 100644
--- a/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp
@@ -29,10 +29,6 @@
#include "SCA_ISensor.h"
#include "SCA_PropertyEventManager.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SCA_PropertyEventManager::SCA_PropertyEventManager(class SCA_LogicManager* logicmgr)
: SCA_EventManager(logicmgr, PROPERTY_EVENTMGR)
diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.h b/source/gameengine/GameLogic/SCA_PropertyEventManager.h
index 159b6d8b827..4e2920d9d70 100644
--- a/source/gameengine/GameLogic/SCA_PropertyEventManager.h
+++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.h
@@ -46,7 +46,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_PropertyEventManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_PropertyEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp
index 24dbdb94f95..be86b976a70 100644
--- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp
+++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp
@@ -41,10 +41,6 @@
#include "FloatValue.h"
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SCA_PropertySensor::SCA_PropertySensor(SCA_EventManager* eventmgr,
SCA_IObject* gameobj,
const STR_String& propname,
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp
index b7367221f80..1f05846abe4 100644
--- a/source/gameengine/GameLogic/SCA_PythonController.cpp
+++ b/source/gameengine/GameLogic/SCA_PythonController.cpp
@@ -43,10 +43,6 @@
#include <algorithm>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
// initialize static member variables
SCA_PythonController* SCA_PythonController::m_sCurrentController = NULL;
@@ -182,7 +178,7 @@ PyObject* SCA_PythonController::sPyGetCurrentController(PyObject *self)
{
if(m_sCurrentController==NULL)
{
- PyErr_SetString(PyExc_SystemError, "GameLogic.getCurrentController(), this function is being run outside the python controllers context, or blenders internal state is corrupt.");
+ PyErr_SetString(PyExc_SystemError, "bge.logic.getCurrentController(), this function is being run outside the python controllers context, or blenders internal state is corrupt.");
return NULL;
}
return m_sCurrentController->GetProxy();
@@ -268,7 +264,7 @@ void SCA_PythonController::ErrorPrint(const char *error_msg)
/* Added in 2.48a, the last_traceback can reference Objects for example, increasing
* their user count. Not to mention holding references to wrapped data.
* This is especially bad when the PyObject for the wrapped data is free'd, after blender
- * has alredy dealocated the pointer */
+ * has already dealocated the pointer */
PySys_SetObject( (char *)"last_traceback", NULL);
PyErr_Clear(); /* just to be sure */
}
@@ -299,49 +295,47 @@ bool SCA_PythonController::Import()
{
//printf("py module modified '%s'\n", m_scriptName.Ptr());
m_bModified= false;
-
+
/* incase we re-import */
Py_XDECREF(m_function);
m_function= NULL;
- vector<STR_String> py_function_path = m_scriptText.Explode('.');
-
- if(py_function_path.size() < 2) {
+ STR_String mod_path_str= m_scriptText; /* just for storage, use C style string access */
+ char *mod_path= mod_path_str.Ptr();
+ char *function_string;
+
+ function_string= strrchr(mod_path, '.');
+
+ if(function_string == NULL) {
printf("Python module name formatting error \"%s\":\n\texpected \"SomeModule.Func\", got \"%s\"\n", GetName().Ptr(), m_scriptText.Ptr());
return false;
}
-
- PyObject *mod = PyImport_ImportModule((char *)py_function_path[0].Ptr());
- /* Dont reload yet, do this within the loop so packages reload too */
-
- if(mod==NULL) {
- ErrorPrint("Python module not found");
+
+ *function_string= '\0';
+ function_string++;
+
+ // Import the module and print an error if it's not found
+ PyObject *mod = PyImport_ImportModule(mod_path);
+
+ if (mod == NULL) {
+ ErrorPrint("Python module can't be imported");
return false;
}
- /* 'mod' will be DECREF'd as 'base'
- * 'm_function' will be left holding a reference that the controller owns */
-
- PyObject *base= mod;
-
- for(unsigned int i=1; i < py_function_path.size(); i++) {
- if(m_debug && PyModule_Check(base)) { /* base could be a class */
- Py_DECREF(base); /* getting a new one so dont hold a ref to the old one */
- base= PyImport_ReloadModule(base);
- if (base==NULL) {
- m_function= NULL;
- break;
- }
- }
-
- m_function = PyObject_GetAttrString(base, py_function_path[i].Ptr());
- Py_DECREF(base);
- base = m_function; /* for the next loop if there is on */
-
- if(m_function==NULL) {
- break;
- }
+
+ if(m_debug)
+ mod = PyImport_ReloadModule(mod);
+
+ if (mod == NULL) {
+ ErrorPrint("Python module can't be reloaded");
+ return false;
}
-
+
+ // Get the function object
+ m_function = PyObject_GetAttrString(mod, function_string);
+
+ // DECREF the module as we don't need it anymore
+ Py_DECREF(mod);
+
if(m_function==NULL) {
if(PyErr_Occurred())
ErrorPrint("Python controller found the module but could not access the function");
@@ -456,7 +450,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
/* Added in 2.48a, the last_traceback can reference Objects for example, increasing
* their user count. Not to mention holding references to wrapped data.
* This is especially bad when the PyObject for the wrapped data is free'd, after blender
- * has alredy dealocated the pointer */
+ * has already dealocated the pointer */
PySys_SetObject( (char *)"last_traceback", NULL);
PyErr_Clear(); /* just to be sure */
}
diff --git a/source/gameengine/GameLogic/SCA_PythonKeyboard.cpp b/source/gameengine/GameLogic/SCA_PythonKeyboard.cpp
new file mode 100644
index 00000000000..7951a749254
--- /dev/null
+++ b/source/gameengine/GameLogic/SCA_PythonKeyboard.cpp
@@ -0,0 +1,104 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "SCA_PythonKeyboard.h"
+#include "SCA_IInputDevice.h"
+
+/* ------------------------------------------------------------------------- */
+/* Native functions */
+/* ------------------------------------------------------------------------- */
+
+SCA_PythonKeyboard::SCA_PythonKeyboard(SCA_IInputDevice* keyboard)
+: PyObjectPlus(),
+m_keyboard(keyboard)
+{
+}
+
+SCA_PythonKeyboard::~SCA_PythonKeyboard()
+{
+ /* intentionally empty */
+}
+
+#ifndef DISABLE_PYTHON
+
+/* ------------------------------------------------------------------------- */
+/* Python functions */
+/* ------------------------------------------------------------------------- */
+
+/* Integration hooks ------------------------------------------------------- */
+PyTypeObject SCA_PythonKeyboard::Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "SCA_PythonKeyboard",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &PyObjectPlus::Type,
+ 0,0,0,0,0,0,
+ py_base_new
+};
+
+PyMethodDef SCA_PythonKeyboard::Methods[] = {
+ {NULL,NULL} //Sentinel
+};
+
+PyAttributeDef SCA_PythonKeyboard::Attributes[] = {
+ KX_PYATTRIBUTE_RO_FUNCTION("events", SCA_PythonKeyboard, pyattr_get_events),
+ { NULL } //Sentinel
+};
+
+PyObject* SCA_PythonKeyboard::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ SCA_PythonKeyboard* self = static_cast<SCA_PythonKeyboard*>(self_v);
+
+ PyObject* resultlist = PyList_New(0);
+
+ for (int i=SCA_IInputDevice::KX_BEGINKEY; i<=SCA_IInputDevice::KX_ENDKEY; i++)
+ {
+ const SCA_InputEvent & inevent = self->m_keyboard->GetEventValue((SCA_IInputDevice::KX_EnumInputs)i);
+
+
+ if (inevent.m_status != SCA_InputEvent::KX_NO_INPUTSTATUS)
+ {
+ PyObject* keypair = PyTuple_New(2);
+ PyTuple_SET_ITEM(keypair, 0, PyLong_FromSsize_t(i));
+ PyTuple_SET_ITEM(keypair, 1, PyLong_FromSsize_t(inevent.m_status));
+ PyList_Append(resultlist, keypair);
+ }
+ }
+
+ return resultlist;
+}
+
+#endif
diff --git a/source/gameengine/GameLogic/SCA_PythonKeyboard.h b/source/gameengine/GameLogic/SCA_PythonKeyboard.h
new file mode 100644
index 00000000000..0b353ac444c
--- /dev/null
+++ b/source/gameengine/GameLogic/SCA_PythonKeyboard.h
@@ -0,0 +1,44 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __KX_PYKEYBOARD
+#define __KX_PYKEYBOARD
+
+#include "PyObjectPlus.h"
+
+class SCA_PythonKeyboard : public PyObjectPlus
+{
+ Py_Header;
+ class SCA_IInputDevice *m_keyboard;
+public:
+ SCA_PythonKeyboard(class SCA_IInputDevice* keyboard);
+ virtual ~SCA_PythonKeyboard();
+
+#ifndef DISABLE_PYTHON
+ static PyObject* pyattr_get_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+#endif
+};
+
+#endif //__KX_PYKEYBOARD
+
diff --git a/source/gameengine/GameLogic/SCA_PythonMouse.cpp b/source/gameengine/GameLogic/SCA_PythonMouse.cpp
new file mode 100644
index 00000000000..041a0169879
--- /dev/null
+++ b/source/gameengine/GameLogic/SCA_PythonMouse.cpp
@@ -0,0 +1,178 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "SCA_PythonMouse.h"
+#include "SCA_IInputDevice.h"
+#include "RAS_ICanvas.h"
+
+/* ------------------------------------------------------------------------- */
+/* Native functions */
+/* ------------------------------------------------------------------------- */
+
+SCA_PythonMouse::SCA_PythonMouse(SCA_IInputDevice* mouse, RAS_ICanvas* canvas)
+: PyObjectPlus(),
+m_mouse(mouse),
+m_canvas(canvas)
+{
+}
+
+SCA_PythonMouse::~SCA_PythonMouse()
+{
+ /* intentionally empty */
+}
+
+#ifndef DISABLE_PYTHON
+
+/* ------------------------------------------------------------------------- */
+/* Python functions */
+/* ------------------------------------------------------------------------- */
+
+/* Integration hooks ------------------------------------------------------- */
+PyTypeObject SCA_PythonMouse::Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "SCA_PythonMouse",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &PyObjectPlus::Type,
+ 0,0,0,0,0,0,
+ py_base_new
+};
+
+PyMethodDef SCA_PythonMouse::Methods[] = {
+// KX_PYMETHODTABLE(SCA_PythonMouse, show),
+ {NULL,NULL} //Sentinel
+};
+
+PyAttributeDef SCA_PythonMouse::Attributes[] = {
+ KX_PYATTRIBUTE_RO_FUNCTION("events", SCA_PythonMouse, pyattr_get_events),
+ KX_PYATTRIBUTE_RW_FUNCTION("position", SCA_PythonMouse, pyattr_get_position, pyattr_set_position),
+ KX_PYATTRIBUTE_RW_FUNCTION("visible", SCA_PythonMouse, pyattr_get_visible, pyattr_set_visible),
+ { NULL } //Sentinel
+};
+
+PyObject* SCA_PythonMouse::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ SCA_PythonMouse* self = static_cast<SCA_PythonMouse*>(self_v);
+
+ PyObject* resultlist = PyList_New(0);
+
+ for (int i=SCA_IInputDevice::KX_BEGINMOUSE; i<=SCA_IInputDevice::KX_ENDMOUSE; i++)
+ {
+ const SCA_InputEvent & inevent = self->m_mouse->GetEventValue((SCA_IInputDevice::KX_EnumInputs)i);
+
+
+ if (inevent.m_status != SCA_InputEvent::KX_NO_INPUTSTATUS)
+ {
+ PyObject* keypair = PyTuple_New(2);
+ PyTuple_SET_ITEM(keypair, 0, PyLong_FromSsize_t(i));
+ PyTuple_SET_ITEM(keypair, 1, PyLong_FromSsize_t(inevent.m_status));
+ PyList_Append(resultlist, keypair);
+ }
+ }
+
+ return resultlist;
+}
+
+PyObject* SCA_PythonMouse::pyattr_get_position(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ SCA_PythonMouse* self = static_cast<SCA_PythonMouse*>(self_v);
+ const SCA_InputEvent & xevent = self->m_mouse->GetEventValue(SCA_IInputDevice::KX_MOUSEX);
+ const SCA_InputEvent & yevent = self->m_mouse->GetEventValue(SCA_IInputDevice::KX_MOUSEY);
+
+ float x_coord, y_coord;
+
+ x_coord = self->m_canvas->GetMouseNormalizedX(xevent.m_eventval);
+ y_coord = self->m_canvas->GetMouseNormalizedY(yevent.m_eventval);
+
+ PyObject* ret = PyTuple_New(2);
+
+ PyTuple_SET_ITEM(ret, 0, PyFloat_FromDouble(x_coord));
+ PyTuple_SET_ITEM(ret, 1, PyFloat_FromDouble(y_coord));
+
+ return ret;
+}
+
+int SCA_PythonMouse::pyattr_set_position(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ SCA_PythonMouse* self = static_cast<SCA_PythonMouse*>(self_v);
+ int x, y;
+ float pyx, pyy;
+ if (!PyArg_ParseTuple(value, "ff:position", &pyx, &pyy))
+ return PY_SET_ATTR_FAIL;
+
+ x = (int)(pyx*self->m_canvas->GetWidth());
+ y = (int)(pyy*self->m_canvas->GetHeight());
+
+ self->m_canvas->SetMousePosition(x, y);
+
+ return PY_SET_ATTR_SUCCESS;
+}
+
+PyObject* SCA_PythonMouse::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ SCA_PythonMouse* self = static_cast<SCA_PythonMouse*>(self_v);
+
+ int visible;
+
+ if (self->m_canvas->GetMouseState() == RAS_ICanvas::MOUSE_INVISIBLE)
+ visible = 0;
+ else
+ visible = 1;
+
+ return PyBool_FromLong(visible);
+}
+
+int SCA_PythonMouse::pyattr_set_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ SCA_PythonMouse* self = static_cast<SCA_PythonMouse*>(self_v);
+
+ int visible = PyObject_IsTrue(value);
+
+ if (visible == -1)
+ {
+ PyErr_SetString(PyExc_AttributeError, "SCA_PythonMouse.visible = bool: SCA_PythonMouse, expected True or False");
+ return PY_SET_ATTR_FAIL;
+ }
+
+ if (visible)
+ self->m_canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL);
+ else
+ self->m_canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE);
+
+ return PY_SET_ATTR_SUCCESS;
+}
+
+#endif
diff --git a/source/gameengine/GameLogic/SCA_PythonMouse.h b/source/gameengine/GameLogic/SCA_PythonMouse.h
new file mode 100644
index 00000000000..c73e6683fc8
--- /dev/null
+++ b/source/gameengine/GameLogic/SCA_PythonMouse.h
@@ -0,0 +1,53 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __KX_PYMOUSE
+#define __KX_PYMOUSE
+
+#include "PyObjectPlus.h"
+
+class SCA_PythonMouse : public PyObjectPlus
+{
+ Py_Header;
+ class SCA_IInputDevice *m_mouse;
+ class RAS_ICanvas *m_canvas;
+public:
+ SCA_PythonMouse(class SCA_IInputDevice* mouse, class RAS_ICanvas* canvas);
+ virtual ~SCA_PythonMouse();
+
+ void Show(bool visible);
+
+#ifndef DISABLE_PYTHON
+ KX_PYMETHOD_DOC(SCA_PythonMouse, show);
+
+ static PyObject* pyattr_get_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_position(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static int pyattr_set_position(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value);
+ static PyObject* pyattr_get_visible(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static int pyattr_set_visible(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value);
+#endif
+};
+
+#endif //__KX_PYMOUSE
+
diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp
index ee9288cc0a6..4b90ca7dadf 100644
--- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp
+++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp
@@ -37,10 +37,6 @@
#include "math.h"
#include "MT_Transform.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/GameLogic/SCA_RandomEventManager.cpp b/source/gameengine/GameLogic/SCA_RandomEventManager.cpp
index dc5aa3739ee..a0ffed57ba5 100644
--- a/source/gameengine/GameLogic/SCA_RandomEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_RandomEventManager.cpp
@@ -37,10 +37,6 @@ using namespace std;
#include <iostream>
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SCA_RandomEventManager::SCA_RandomEventManager(class SCA_LogicManager* logicmgr)
: SCA_EventManager(logicmgr, RANDOM_EVENTMGR)
{
diff --git a/source/gameengine/GameLogic/SCA_RandomEventManager.h b/source/gameengine/GameLogic/SCA_RandomEventManager.h
index 386ec886f06..51d233c4321 100644
--- a/source/gameengine/GameLogic/SCA_RandomEventManager.h
+++ b/source/gameengine/GameLogic/SCA_RandomEventManager.h
@@ -47,7 +47,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomEventManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp
index 644b0a4a9ea..f5cd4b07458 100644
--- a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp
+++ b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp
@@ -37,10 +37,6 @@
#include <limits.h>
#include "SCA_RandomNumberGenerator.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* Period parameters */
#define N 624
#define M 397
diff --git a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h
index 1e644fe5c26..8402d0312fc 100644
--- a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h
+++ b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h
@@ -77,7 +77,7 @@ class SCA_RandomNumberGenerator {
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomNumberGenerator"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomNumberGenerator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp
index 6605752a209..a7d18ff40d4 100644
--- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp
@@ -36,10 +36,6 @@
#include "ConstExpr.h"
#include <iostream>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp
index cb0d232ffa8..d794a4f1227 100644
--- a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp
@@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
// This warning tells us about truncation of __long__ stl-generated names.
diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.h b/source/gameengine/GameLogic/SCA_TimeEventManager.h
index ad4f343d137..b2a2eb5fe5d 100644
--- a/source/gameengine/GameLogic/SCA_TimeEventManager.h
+++ b/source/gameengine/GameLogic/SCA_TimeEventManager.h
@@ -52,7 +52,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_TimeEventManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_TimeEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp
index 73e45542ce4..9f54e41d110 100644
--- a/source/gameengine/GameLogic/SCA_XNORController.cpp
+++ b/source/gameengine/GameLogic/SCA_XNORController.cpp
@@ -34,10 +34,6 @@
#include "SCA_LogicManager.h"
#include "BoolValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp
index ea7b162e7f3..a58f30a3bed 100644
--- a/source/gameengine/GameLogic/SCA_XORController.cpp
+++ b/source/gameengine/GameLogic/SCA_XORController.cpp
@@ -34,10 +34,6 @@
#include "SCA_LogicManager.h"
#include "BoolValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/GamePlayer/Makefile b/source/gameengine/GamePlayer/Makefile
index c4f78f23117..30a13f26503 100644
--- a/source/gameengine/GamePlayer/Makefile
+++ b/source/gameengine/GamePlayer/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/GamePlayer/common/CMakeLists.txt b/source/gameengine/GamePlayer/common/CMakeLists.txt
index 418b77357a4..08a4aa50a00 100644
--- a/source/gameengine/GamePlayer/common/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/common/CMakeLists.txt
@@ -74,4 +74,3 @@ SET(INC
ADD_DEFINITIONS(-DGLEW_STATIC)
BLENDERLIB_NOLIST(gp_common "${SRC}" "${INC}")
-#env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = [], libtype='player', priority=5, compileflags=cflags)
diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
index 3fa27b40928..b90aec75959 100644
--- a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
@@ -27,10 +27,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifndef NOPNG
#ifdef WIN32
#include "png.h"
@@ -100,6 +96,12 @@ void GPC_Canvas::ClearColor(float r, float g, float b, float a)
void GPC_Canvas::SetViewPort(int x1, int y1, int x2, int y2)
{
+ /* x1 and y1 are the min pixel coordinate (e.g. 0)
+ x2 and y2 are the max pixel coordinate
+ the width,height is calculated including both pixels
+ therefore: max - min + 1
+ */
+
/* XXX, nasty, this needs to go somewhere else,
* but where... definitly need to clean up this
* whole canvas/rendertools mess.
diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.cpp b/source/gameengine/GamePlayer/common/GPC_Engine.cpp
index 3222392ed9a..54ace227821 100644
--- a/source/gameengine/GamePlayer/common/GPC_Engine.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_Engine.cpp
@@ -27,10 +27,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#pragma warning (disable:4786) // suppress stl-MSVC debug info warning
#endif // WIN32
diff --git a/source/gameengine/GamePlayer/common/GPC_MouseDevice.cpp b/source/gameengine/GamePlayer/common/GPC_MouseDevice.cpp
index 08902aaa029..706c3d178cd 100644
--- a/source/gameengine/GamePlayer/common/GPC_MouseDevice.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_MouseDevice.cpp
@@ -29,10 +29,6 @@
#include "GPC_MouseDevice.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
GPC_MouseDevice::GPC_MouseDevice()
{
diff --git a/source/gameengine/GamePlayer/common/GPC_RawImage.cpp b/source/gameengine/GamePlayer/common/GPC_RawImage.cpp
index d13428b799f..42f3b2dc1e1 100644
--- a/source/gameengine/GamePlayer/common/GPC_RawImage.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_RawImage.cpp
@@ -33,10 +33,6 @@
#include "GPC_RawImage.h"
#include "GPC_RawLogoArrays.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
GPC_RawImage::GPC_RawImage()
: m_data(0), m_dataSize(0), m_width(0), m_height(0)
diff --git a/source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp b/source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp
index da25b689ad5..159a6f50776 100644
--- a/source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp
@@ -30,10 +30,6 @@
#include "GPC_RawLoadDotBlendArray.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void GetRawLoadingAnimation(unsigned char **data, int *dataSize)
{
// create an array that will automatically be deleted when)
diff --git a/source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp b/source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp
index f6934b1b4d2..761e53cf1d3 100644
--- a/source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp
@@ -30,10 +30,6 @@
#include "GPC_RawLogoArrays.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void GetRawBlenderLogo(unsigned char **data, int *width, int *height)
{
// create an array that will automatically be deleted when)
diff --git a/source/gameengine/GamePlayer/common/GPC_System.cpp b/source/gameengine/GamePlayer/common/GPC_System.cpp
index 77a1633ae82..36022bae9dd 100644
--- a/source/gameengine/GamePlayer/common/GPC_System.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_System.cpp
@@ -32,10 +32,6 @@
#include "GPC_KeyboardDevice.h"
#include "NG_NetworkDeviceInterface.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
GPC_System::GPC_System()
// : m_ndi(0)
{
diff --git a/source/gameengine/GamePlayer/common/Makefile b/source/gameengine/GamePlayer/common/Makefile
index e1b07a226f6..e28cacb826a 100644
--- a/source/gameengine/GamePlayer/common/Makefile
+++ b/source/gameengine/GamePlayer/common/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/GamePlayer/common/bmfont.cpp b/source/gameengine/GamePlayer/common/bmfont.cpp
index afe20ca5e3a..3532eb81f87 100644
--- a/source/gameengine/GamePlayer/common/bmfont.cpp
+++ b/source/gameengine/GamePlayer/common/bmfont.cpp
@@ -58,10 +58,6 @@
#include "BKE_bmfont.h"
#include "BKE_bmfont_types.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/*MAART:
void printfGlyph(bmGlyph * glyph)
{
diff --git a/source/gameengine/GamePlayer/common/unix/GPU_Canvas.cpp b/source/gameengine/GamePlayer/common/unix/GPU_Canvas.cpp
index 130740f2aff..bb7b55fbcf1 100644
--- a/source/gameengine/GamePlayer/common/unix/GPU_Canvas.cpp
+++ b/source/gameengine/GamePlayer/common/unix/GPU_Canvas.cpp
@@ -30,10 +30,6 @@
//#include <iostream>
#include "GPU_Canvas.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
GPU_Canvas::GPU_Canvas(KXH_plugin_handle p, int width, int height)
: GPC_Canvas(width, height), m_plugin(p)
{
diff --git a/source/gameengine/GamePlayer/common/unix/GPU_Engine.cpp b/source/gameengine/GamePlayer/common/unix/GPU_Engine.cpp
index 6094b66764f..3eb7147bd98 100644
--- a/source/gameengine/GamePlayer/common/unix/GPU_Engine.cpp
+++ b/source/gameengine/GamePlayer/common/unix/GPU_Engine.cpp
@@ -49,10 +49,6 @@
#include "GPC_RenderTools.h"
#include "GPC_RawImage.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void Redraw(GPU_Engine *engine); // -the- redraw function
// callback functions
diff --git a/source/gameengine/GamePlayer/common/unix/GPU_Engine.h b/source/gameengine/GamePlayer/common/unix/GPU_Engine.h
index d5d8ffdb138..12fb70c84ef 100644
--- a/source/gameengine/GamePlayer/common/unix/GPU_Engine.h
+++ b/source/gameengine/GamePlayer/common/unix/GPU_Engine.h
@@ -34,7 +34,7 @@
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
-#define Object DNA_Object // tricky stuff !!! but without it it doesn't compile...
+#define Object DNA_Object // tricky stuff !!! but without it, it doesn't compile...
#include "GPC_Engine.h"
diff --git a/source/gameengine/GamePlayer/common/unix/GPU_KeyboardDevice.cpp b/source/gameengine/GamePlayer/common/unix/GPU_KeyboardDevice.cpp
index 570c1fc170d..5444cf22ac9 100644
--- a/source/gameengine/GamePlayer/common/unix/GPU_KeyboardDevice.cpp
+++ b/source/gameengine/GamePlayer/common/unix/GPU_KeyboardDevice.cpp
@@ -67,7 +67,7 @@ GPU_KeyboardDevice::GPU_KeyboardDevice(void)
(((int)SCA_IInputDevice::KX_ZEROKEY) + i - XK_0);
}
- for (i = XK_F1; i< XK_F12; i++) {
+ for (i = XK_F1; i< XK_F19; i++) {
m_reverseKeyTranslateTable[i]
= (SCA_IInputDevice::KX_EnumInputs)
(((int)SCA_IInputDevice::KX_F1KEY) + i - XK_F1);
diff --git a/source/gameengine/GamePlayer/common/unix/GPU_System.cpp b/source/gameengine/GamePlayer/common/unix/GPU_System.cpp
index 7efe05972cd..8085ecb4380 100644
--- a/source/gameengine/GamePlayer/common/unix/GPU_System.cpp
+++ b/source/gameengine/GamePlayer/common/unix/GPU_System.cpp
@@ -30,10 +30,6 @@
#include <sys/time.h>
#include "GPU_System.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
static struct timeval startTime;
static int startTimeDone = 0;
diff --git a/source/gameengine/GamePlayer/common/unix/Makefile b/source/gameengine/GamePlayer/common/unix/Makefile
index c86f61b45d8..db29a087b28 100644
--- a/source/gameengine/GamePlayer/common/unix/Makefile
+++ b/source/gameengine/GamePlayer/common/unix/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/GamePlayer/common/windows/GPW_Canvas.cpp b/source/gameengine/GamePlayer/common/windows/GPW_Canvas.cpp
index 44b53fb9dda..44437820bd2 100644
--- a/source/gameengine/GamePlayer/common/windows/GPW_Canvas.cpp
+++ b/source/gameengine/GamePlayer/common/windows/GPW_Canvas.cpp
@@ -29,10 +29,6 @@
#include "GPW_Canvas.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
GPW_Canvas::GPW_Canvas(HWND hWnd, HDC hDC, int width, int height)
: GPC_Canvas(width, height), m_hWnd(hWnd), m_hRC(0), m_hDC(hDC)
{
diff --git a/source/gameengine/GamePlayer/common/windows/GPW_Engine.cpp b/source/gameengine/GamePlayer/common/windows/GPW_Engine.cpp
index e2b2486fd43..f5e9f2e767c 100644
--- a/source/gameengine/GamePlayer/common/windows/GPW_Engine.cpp
+++ b/source/gameengine/GamePlayer/common/windows/GPW_Engine.cpp
@@ -44,10 +44,6 @@
#include "NG_NetworkScene.h"
#include "NG_LoopBackNetworkDeviceInterface.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
GPW_Engine::GPW_Engine(char *customLoadingAnimationURL,
int foregroundColor, int backgroundColor, int frameRate) :
GPC_Engine(customLoadingAnimationURL, foregroundColor, backgroundColor,
diff --git a/source/gameengine/GamePlayer/common/windows/GPW_KeyboardDevice.cpp b/source/gameengine/GamePlayer/common/windows/GPW_KeyboardDevice.cpp
index 5c5d590c2bc..7e8a50915c8 100644
--- a/source/gameengine/GamePlayer/common/windows/GPW_KeyboardDevice.cpp
+++ b/source/gameengine/GamePlayer/common/windows/GPW_KeyboardDevice.cpp
@@ -29,10 +29,6 @@
#include "GPW_KeyboardDevice.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
// Key code values not found in winuser.h
#ifndef VK_MINUS
#define VK_MINUS 0xBD
@@ -140,7 +136,14 @@ GPW_KeyboardDevice::GPW_KeyboardDevice(void)
m_reverseKeyTranslateTable[VK_F9 ] = KX_F9KEY ;
m_reverseKeyTranslateTable[VK_F10 ] = KX_F10KEY ;
m_reverseKeyTranslateTable[VK_F11 ] = KX_F11KEY ;
- m_reverseKeyTranslateTable[VK_F12 ] = KX_F12KEY ;
+ m_reverseKeyTranslateTable[VK_F12 ] = KX_F12KEY ;
+ m_reverseKeyTranslateTable[VK_F13 ] = KX_F13KEY ;
+ m_reverseKeyTranslateTable[VK_F14 ] = KX_F14KEY ;
+ m_reverseKeyTranslateTable[VK_F15 ] = KX_F15KEY ;
+ m_reverseKeyTranslateTable[VK_F16 ] = KX_F16KEY ;
+ m_reverseKeyTranslateTable[VK_F17 ] = KX_F17KEY ;
+ m_reverseKeyTranslateTable[VK_F18 ] = KX_F18KEY ;
+ m_reverseKeyTranslateTable[VK_F19 ] = KX_F19KEY ;
// Numpad keys
m_reverseKeyTranslateTable[VK_NUMPAD0 ] = KX_PAD0 ;
diff --git a/source/gameengine/GamePlayer/common/windows/GPW_System.cpp b/source/gameengine/GamePlayer/common/windows/GPW_System.cpp
index b1dd5afaa6d..4f4a48a52f1 100644
--- a/source/gameengine/GamePlayer/common/windows/GPW_System.cpp
+++ b/source/gameengine/GamePlayer/common/windows/GPW_System.cpp
@@ -31,10 +31,6 @@
#include <windows.h>
#include "GPW_System.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
GPW_System::GPW_System(void)
{
m_freq = 0;
diff --git a/source/gameengine/GamePlayer/common/windows/Makefile b/source/gameengine/GamePlayer/common/windows/Makefile
index 3f1deb05f3a..200f84dd3e6 100644
--- a/source/gameengine/GamePlayer/common/windows/Makefile
+++ b/source/gameengine/GamePlayer/common/windows/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
index 848c2f73f06..8164878762c 100644
--- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
@@ -73,4 +73,3 @@ IF(WITH_FFMPEG)
ENDIF(WITH_FFMPEG)
BLENDERLIB_NOLIST(gp_ghost "${SRC}" "${INC}")
-#env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = [], libtype='player',priority=0, compileflags=cflags)
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index 43b26cf9a06..71507642226 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -28,10 +28,6 @@
* GHOST Blender Player application implementation file.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#pragma warning (disable:4786) // suppress stl-MSVC debug info warning
#include <windows.h>
@@ -677,7 +673,8 @@ bool GPG_Application::startEngine(void)
m_mouse,
m_networkdevice,
startscenename,
- m_startScene);
+ m_startScene,
+ m_canvas);
#ifndef DISABLE_PYTHON
// some python things
@@ -797,10 +794,7 @@ void GPG_Application::exitEngine()
m_canvas = 0;
}
- libtiff_exit();
-#ifdef WITH_QUICKTIME
- quicktime_exit();
-#endif
+ IMB_exit();
GPU_extensions_exit();
m_exitRequested = 0;
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp
index 0a96fbbe503..24c0102a87c 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp
@@ -31,10 +31,6 @@
#include <assert.h>
#include "GHOST_ISystem.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
GPG_Canvas::GPG_Canvas(GHOST_IWindow* window)
: GPC_Canvas(0, 0), m_window(window)
{
@@ -79,6 +75,8 @@ void GPG_Canvas::SetMousePosition(int x, int y)
void GPG_Canvas::SetMouseState(RAS_MouseState mousestate)
{
+ m_mousestate = mousestate;
+
if (m_window)
{
switch (mousestate)
@@ -106,3 +104,13 @@ void GPG_Canvas::SwapBuffers()
m_window->swapBuffers();
}
}
+
+float GPG_Canvas::GetMouseNormalizedX(int x)
+{
+ return float(x)/this->GetWidth();
+}
+
+float GPG_Canvas::GetMouseNormalizedY(int y)
+{
+ return float(y)/this->GetHeight();
+}
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h
index 18e58691d2c..7b19c03d3c3 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h
+++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h
@@ -53,6 +53,10 @@ public:
virtual void SetMousePosition(int x, int y);
virtual void SetMouseState(RAS_MouseState mousestate);
virtual void SwapBuffers();
+ virtual int GetMouseX(int x){return x;};
+ virtual int GetMouseY(int y){return y;};
+ virtual float GetMouseNormalizedX(int x);
+ virtual float GetMouseNormalizedY(int y);
bool BeginDraw() { return true;};
void EndDraw() {};
diff --git a/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp b/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp
index 243322b715d..2e9810ad0ae 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp
@@ -30,10 +30,6 @@
#include "GPG_KeyboardDevice.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
GPG_KeyboardDevice::GPG_KeyboardDevice(void)
{
m_reverseKeyTranslateTable[GHOST_kKeyA ] = KX_AKEY ;
@@ -101,7 +97,15 @@ GPG_KeyboardDevice::GPG_KeyboardDevice(void)
m_reverseKeyTranslateTable[GHOST_kKeyF9 ] = KX_F9KEY ;
m_reverseKeyTranslateTable[GHOST_kKeyF10 ] = KX_F10KEY ;
m_reverseKeyTranslateTable[GHOST_kKeyF11 ] = KX_F11KEY ;
- m_reverseKeyTranslateTable[GHOST_kKeyF12 ] = KX_F12KEY ;
+ m_reverseKeyTranslateTable[GHOST_kKeyF12 ] = KX_F12KEY ;
+ m_reverseKeyTranslateTable[GHOST_kKeyF13 ] = KX_F13KEY ;
+ m_reverseKeyTranslateTable[GHOST_kKeyF14 ] = KX_F14KEY ;
+ m_reverseKeyTranslateTable[GHOST_kKeyF15 ] = KX_F15KEY ;
+ m_reverseKeyTranslateTable[GHOST_kKeyF16 ] = KX_F16KEY ;
+ m_reverseKeyTranslateTable[GHOST_kKeyF17 ] = KX_F17KEY ;
+ m_reverseKeyTranslateTable[GHOST_kKeyF18 ] = KX_F18KEY ;
+ m_reverseKeyTranslateTable[GHOST_kKeyF19 ] = KX_F19KEY ;
+
// Numpad keys
m_reverseKeyTranslateTable[GHOST_kKeyNumpad0 ] = KX_PAD0 ;
diff --git a/source/gameengine/GamePlayer/ghost/GPG_System.cpp b/source/gameengine/GamePlayer/ghost/GPG_System.cpp
index d57b90dfff1..94756ec4ed5 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_System.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_System.cpp
@@ -32,10 +32,6 @@
#include <assert.h>
#include "GHOST_ISystem.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
GPG_System::GPG_System(GHOST_ISystem* system)
: m_system(system)
{
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 9d87adb7400..9cdee2a340c 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -376,11 +376,7 @@ int main(int argc, char** argv)
GEN_init_messaging_system();
-#ifdef WITH_QUICKTIME
- quicktime_init();
-#endif
-
- libtiff_init();
+ IMB_init();
// Parse command line options
#ifndef NDEBUG
@@ -664,7 +660,7 @@ int main(int argc, char** argv)
system->getMainDisplayDimensions(fullScreenWidth, fullScreenHeight);
// process first batch of events. If the user
// drops a file on top off the blenderplayer icon, we
- // recieve an event with the filename
+ // receive an event with the filename
system->processEvents(0);
diff --git a/source/gameengine/GamePlayer/ghost/Makefile b/source/gameengine/GamePlayer/ghost/Makefile
index a7fcf46b695..b2fcd2ac1ff 100644
--- a/source/gameengine/GamePlayer/ghost/Makefile
+++ b/source/gameengine/GamePlayer/ghost/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h
index 073ce8f1ca5..c2d4245b77f 100644
--- a/source/gameengine/Ketsji/BL_BlenderShader.h
+++ b/source/gameengine/Ketsji/BL_BlenderShader.h
@@ -56,12 +56,19 @@ public:
void ReloadMaterial();
int GetBlendMode();
+ void SetScene(KX_Scene *scene)
+ {
+ mScene = scene;
+ mBlenderScene = scene->GetBlenderScene();
+ ReloadMaterial();
+ }
+
bool Equals(BL_BlenderShader *blshader);
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderShader"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderShader"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h
index 6b53e7fa8b1..62e5a6e638b 100644
--- a/source/gameengine/Ketsji/BL_Material.h
+++ b/source/gameengine/Ketsji/BL_Material.h
@@ -106,7 +106,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Material"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Material"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp
index 55be606378d..8edefe7ac2d 100644
--- a/source/gameengine/Ketsji/BL_Shader.cpp
+++ b/source/gameengine/Ketsji/BL_Shader.cpp
@@ -884,7 +884,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" )
{
int loc = GetUniformLocation(uniform);
if(loc != -1) {
- if(index >= MAXTEX && index < 0)
+ if(index >= MAXTEX || index < 0)
spit("Invalid texture sample index: " << index);
#ifdef SORT_UNIFORMS
diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h
index ebd2e491f35..5108acea0ff 100644
--- a/source/gameengine/Ketsji/BL_Shader.h
+++ b/source/gameengine/Ketsji/BL_Shader.h
@@ -28,7 +28,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Sampler"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Sampler"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -75,7 +75,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Uniform"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Uniform"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -100,7 +100,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DefUniform"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DefUniform"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/BL_Texture.h b/source/gameengine/Ketsji/BL_Texture.h
index 2dfd9c542d3..eb3888b4862 100644
--- a/source/gameengine/Ketsji/BL_Texture.h
+++ b/source/gameengine/Ketsji/BL_Texture.h
@@ -70,7 +70,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Texture"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Texture"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt
index c4af701f87b..d8f6e3164ec 100644
--- a/source/gameengine/Ketsji/CMakeLists.txt
+++ b/source/gameengine/Ketsji/CMakeLists.txt
@@ -80,4 +80,3 @@ IF(WITH_FFMPEG)
ENDIF(WITH_FFMPEG)
BLENDERLIB(bf_ketsji "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_ketsji', sources, Split(incs), [], libtype=['game','player'], priority=[25, 72], compileflags = cflags )
diff --git a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt
index 40079f3f83e..ce3d8fa22fc 100644
--- a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt
+++ b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt
@@ -45,4 +45,3 @@ ELSE(WITH_PYTHON)
ENDIF(WITH_PYTHON)
BLENDERLIB(kx_network "${SRC}" "${INC}")
-#env.BlenderLib ( 'kx_network', Split(sources), Split(incs), defines=[],libtype=['game2', 'player'], priority=[5, 155] )
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp
index bc4c18ff795..d922fb63b4f 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp
@@ -39,10 +39,6 @@
#include "NG_NetworkMessage.h"
#include "NG_NetworkObject.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_NetworkEventManager::KX_NetworkEventManager(class SCA_LogicManager*
logicmgr, class NG_NetworkDeviceInterface *ndi) :
SCA_EventManager(logicmgr, NETWORK_EVENTMGR), m_ndi(ndi)
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
index a9b56836fa9..e047a9aa273 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
@@ -31,10 +31,6 @@
#include "NG_NetworkScene.h"
#include "KX_NetworkMessageActuator.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_NetworkMessageActuator::KX_NetworkMessageActuator(
SCA_IObject* gameobj, // the actuator controlling object
NG_NetworkScene* networkscene, // needed for replication
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
index ef9f4d33a28..56ccac9a93e 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
@@ -38,10 +38,6 @@
#include "ListValue.h"
#include "StringValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef NAN_NET_DEBUG
#include <iostream>
#endif
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkObjectActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkObjectActuator.cpp
index 948821b157b..5350c32fff7 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkObjectActuator.cpp
@@ -26,7 +26,3 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkObjectSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkObjectSensor.cpp
index f3898fc7bd4..aca0805c337 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkObjectSensor.cpp
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkObjectSensor.cpp
@@ -27,7 +27,3 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
diff --git a/source/gameengine/Ketsji/KXNetwork/Makefile b/source/gameengine/Ketsji/KXNetwork/Makefile
index 365ed8fc9c3..aebbd7921cb 100644
--- a/source/gameengine/Ketsji/KXNetwork/Makefile
+++ b/source/gameengine/Ketsji/KXNetwork/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Ketsji/KX_ArmatureSensor.cpp b/source/gameengine/Ketsji/KX_ArmatureSensor.cpp
index 31b92232de6..a47a1972beb 100644
--- a/source/gameengine/Ketsji/KX_ArmatureSensor.cpp
+++ b/source/gameengine/Ketsji/KX_ArmatureSensor.cpp
@@ -39,10 +39,6 @@
#include "SCA_EventManager.h"
#include "SCA_LogicManager.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_ArmatureSensor::KX_ArmatureSensor(class SCA_EventManager* eventmgr,
SCA_IObject* gameobj,
const char *posechannel,
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
index bab7c54a310..d88997e2128 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
@@ -2,10 +2,6 @@
// ------------------------------------
// ...
// ------------------------------------
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "GL/glew.h"
#include "KX_BlenderMaterial.h"
@@ -798,9 +794,9 @@ PyMethodDef KX_BlenderMaterial::Methods[] =
};
PyAttributeDef KX_BlenderMaterial::Attributes[] = {
- //KX_PYATTRIBUTE_TODO("shader"),
- //KX_PYATTRIBUTE_TODO("materialIndex"),
- //KX_PYATTRIBUTE_TODO("blending"),
+ KX_PYATTRIBUTE_RO_FUNCTION("shader", KX_BlenderMaterial, pyattr_get_shader),
+ KX_PYATTRIBUTE_RO_FUNCTION("material_index", KX_BlenderMaterial, pyattr_get_materialIndex),
+ KX_PYATTRIBUTE_RW_FUNCTION("blending", KX_BlenderMaterial, pyattr_get_blending, pyattr_set_blending),
{ NULL } //Sentinel
};
@@ -826,6 +822,37 @@ PyTypeObject KX_BlenderMaterial::Type = {
py_base_new
};
+PyObject* KX_BlenderMaterial::pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
+ return self->PygetShader(NULL, NULL);
+}
+
+PyObject* KX_BlenderMaterial::pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
+ return PyLong_FromSsize_t(self->GetMaterialIndex());
+}
+
+PyObject* KX_BlenderMaterial::pyattr_get_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
+ unsigned int* bfunc = self->getBlendFunc();
+ return Py_BuildValue("(ll)", (long int)bfunc[0], (long int)bfunc[1]);
+}
+
+int KX_BlenderMaterial::pyattr_set_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
+ PyObject* obj = self->PysetBlending(value, NULL);
+ if(obj)
+ {
+ Py_DECREF(obj);
+ return 0;
+ }
+ return -1;
+}
+
KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()")
{
if( !GLEW_ARB_fragment_shader) {
@@ -912,7 +939,7 @@ static unsigned int GL_array[11] = {
GL_SRC_ALPHA_SATURATE
};
-KX_PYMETHODDEF_DOC( KX_BlenderMaterial, setBlending , "setBlending( GameLogic.src, GameLogic.dest)")
+KX_PYMETHODDEF_DOC( KX_BlenderMaterial, setBlending , "setBlending( bge.logic.src, bge.logic.dest)")
{
unsigned int b[2];
if(PyArg_ParseTuple(args, "ii:setBlending", &b[0], &b[1]))
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h
index c5f5e23c6e7..239e334f68a 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.h
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h
@@ -79,6 +79,9 @@ public:
Image * getImage (unsigned int idx) {
return (idx < MAXTEX && mMaterial) ? mMaterial->img[idx] : NULL;
}
+ unsigned int* getBlendFunc() {
+ return mBlendFunc;
+ }
// for ipos
void UpdateIPO(
MT_Vector4 rgba, MT_Vector3 specrgb,
@@ -88,13 +91,22 @@ public:
virtual void Replace_IScene(SCA_IScene *val)
{
- mScene= static_cast<KX_Scene *>(val);
+ if (mBlenderShader)
+ {
+ mScene= static_cast<KX_Scene *>(val);
+ mBlenderShader->SetScene(mScene);
+ }
};
#ifndef DISABLE_PYTHON
// --------------------------------
virtual PyObject* py_repr(void) { return PyUnicode_FromString(mMaterial->matname.ReadPtr()); }
+ static PyObject* pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static int pyattr_set_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+
KX_PYMETHOD_DOC( KX_BlenderMaterial, getShader );
KX_PYMETHOD_DOC( KX_BlenderMaterial, getMaterialIndex );
KX_PYMETHOD_DOC( KX_BlenderMaterial, getTexture );
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h
index 7fc799abb7e..48a3c98ff81 100644
--- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h
+++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h
@@ -83,7 +83,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BulletPhysicsController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BulletPhysicsController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index 42d35798095..2402baf92ac 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -34,10 +34,6 @@
#include "KX_PythonInit.h"
#include "KX_Python.h"
#include "KX_PyMath.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_Camera::KX_Camera(void* sgReplicationInfo,
SG_Callbacks callbacks,
const RAS_CameraData& camdata,
@@ -503,6 +499,7 @@ PyAttributeDef KX_Camera::Attributes[] = {
KX_PYATTRIBUTE_RW_FUNCTION("perspective", KX_Camera, pyattr_get_perspective, pyattr_set_perspective),
KX_PYATTRIBUTE_RW_FUNCTION("lens", KX_Camera, pyattr_get_lens, pyattr_set_lens),
+ KX_PYATTRIBUTE_RW_FUNCTION("ortho_scale", KX_Camera, pyattr_get_ortho_scale, pyattr_set_ortho_scale),
KX_PYATTRIBUTE_RW_FUNCTION("near", KX_Camera, pyattr_get_near, pyattr_set_near),
KX_PYATTRIBUTE_RW_FUNCTION("far", KX_Camera, pyattr_get_far, pyattr_set_far),
@@ -556,8 +553,8 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, sphereInsideFrustum,
"\tcenter = the center of the sphere (in world coordinates.)\n"
"\tradius = the radius of the sphere\n\n"
"\tExample:\n"
-"\timport GameLogic\n\n"
-"\tco = GameLogic.getCurrentController()\n"
+"\timport bge.logic\n\n"
+"\tco = bge.logic.getCurrentController()\n"
"\tcam = co.GetOwner()\n\n"
"\t# A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0]\n"
"\tif (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE):\n"
@@ -589,8 +586,8 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, boxInsideFrustum,
"\tinside/outside/intersects this camera's viewing frustum.\n\n"
"\tbox = a list of the eight (8) corners of the box (in world coordinates.)\n\n"
"\tExample:\n"
-"\timport GameLogic\n\n"
-"\tco = GameLogic.getCurrentController()\n"
+"\timport bge.logic\n\n"
+"\tco = bge.logic.getCurrentController()\n"
"\tcam = co.GetOwner()\n\n"
"\tbox = []\n"
"\tbox.append([-1.0, -1.0, -1.0])\n"
@@ -633,8 +630,8 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, pointInsideFrustum,
"\treturns 1 if the given point is inside this camera's viewing frustum.\n\n"
"\tpoint = The point to test (in world coordinates.)\n\n"
"\tExample:\n"
-"\timport GameLogic\n\n"
-"\tco = GameLogic.getCurrentController()\n"
+"\timport bge.logic\n\n"
+"\tco = bge.logic.getCurrentController()\n"
"\tcam = co.GetOwner()\n\n"
"\t# Test point [0.0, 0.0, 0.0]"
"\tif (cam.pointInsideFrustum([0.0, 0.0, 0.0])):\n"
@@ -732,6 +729,26 @@ int KX_Camera::pyattr_set_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef,
return PY_SET_ATTR_SUCCESS;
}
+PyObject* KX_Camera::pyattr_get_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_Camera* self= static_cast<KX_Camera*>(self_v);
+ return PyFloat_FromDouble(self->m_camdata.m_scale);
+}
+
+int KX_Camera::pyattr_set_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_Camera* self= static_cast<KX_Camera*>(self_v);
+ float param = PyFloat_AsDouble(value);
+ if (param == -1) {
+ PyErr_SetString(PyExc_AttributeError, "camera.ortho_scale = float: KX_Camera, expected a float greater then zero");
+ return PY_SET_ATTR_FAIL;
+ }
+
+ self->m_camdata.m_scale= param;
+ self->m_set_projection_matrix = false;
+ return PY_SET_ATTR_SUCCESS;
+}
+
PyObject* KX_Camera::pyattr_get_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
KX_Camera* self= static_cast<KX_Camera*>(self_v);
diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h
index e209f0461b9..ad2460d34ef 100644
--- a/source/gameengine/Ketsji/KX_Camera.h
+++ b/source/gameengine/Ketsji/KX_Camera.h
@@ -51,7 +51,7 @@ class KX_Camera : public KX_GameObject
Py_Header;
protected:
friend class KX_Scene;
- /** Camera parameters (clips distances, focal lenght). These
+ /** Camera parameters (clips distances, focal length). These
* params are closely tied to Blender. In the gameengine, only the
* projection and modelview matrices are relevant. There's a
* conversion being done in the engine class. Why is it stored
@@ -289,6 +289,8 @@ public:
static PyObject* pyattr_get_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static PyObject* pyattr_get_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static int pyattr_set_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static PyObject* pyattr_get_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static PyObject* pyattr_get_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp
index f9ec503478c..bc67ecbe1a5 100644
--- a/source/gameengine/Ketsji/KX_CameraActuator.cpp
+++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp
@@ -38,10 +38,6 @@
#include "PyObjectPlus.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
@@ -380,7 +376,7 @@ PyTypeObject KX_CameraActuator::Type = {
};
PyMethodDef KX_CameraActuator::Methods[] = {
- {NULL,NULL,NULL,NULL} //Sentinel
+ {NULL, NULL} //Sentinel
};
PyAttributeDef KX_CameraActuator::Attributes[] = {
diff --git a/source/gameengine/Ketsji/KX_CameraIpoSGController.cpp b/source/gameengine/Ketsji/KX_CameraIpoSGController.cpp
index 6ae9bbc0931..0bfa1133a1c 100644
--- a/source/gameengine/Ketsji/KX_CameraIpoSGController.cpp
+++ b/source/gameengine/Ketsji/KX_CameraIpoSGController.cpp
@@ -31,10 +31,6 @@
#include "KX_Camera.h"
#include "RAS_CameraData.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#if defined(_WIN64)
typedef unsigned __int64 uint_ptr;
#else
diff --git a/source/gameengine/Ketsji/KX_CameraIpoSGController.h b/source/gameengine/Ketsji/KX_CameraIpoSGController.h
index 3690043f4a9..e6596edbd1d 100644
--- a/source/gameengine/Ketsji/KX_CameraIpoSGController.h
+++ b/source/gameengine/Ketsji/KX_CameraIpoSGController.h
@@ -88,7 +88,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_CameraIpoSGController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_CameraIpoSGController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_ClientObjectInfo.h b/source/gameengine/Ketsji/KX_ClientObjectInfo.h
index f08988c842a..c42843274b3 100644
--- a/source/gameengine/Ketsji/KX_ClientObjectInfo.h
+++ b/source/gameengine/Ketsji/KX_ClientObjectInfo.h
@@ -78,7 +78,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ClientObjectInfo"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ClientObjectInfo"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
index 3ef689ec94f..9380f4b5d2f 100644
--- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
@@ -40,10 +40,6 @@
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
index de6530bf54a..b1baa5fe9e1 100644
--- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
@@ -31,10 +31,6 @@
#include "KX_ConstraintWrapper.h"
#include "PHY_IPhysicsEnvironment.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_ConstraintWrapper::KX_ConstraintWrapper(
PHY_ConstraintType ctype,
int constraintId,
@@ -114,8 +110,14 @@ PyMethodDef KX_ConstraintWrapper::Methods[] = {
};
PyAttributeDef KX_ConstraintWrapper::Attributes[] = {
- //KX_PYATTRIBUTE_TODO("constraintId"),
+ KX_PYATTRIBUTE_RO_FUNCTION("constraint_id", KX_ConstraintWrapper, pyattr_get_constraintId),
{ NULL } //Sentinel
};
+PyObject* KX_ConstraintWrapper::pyattr_get_constraintId(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_ConstraintWrapper* self= static_cast<KX_ConstraintWrapper*>(self_v);
+ return self->PyGetConstraintId();
+}
+
#endif // DISABLE_PYTHON
diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h
index 530ecf16fed..db9543c23ae 100644
--- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h
+++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h
@@ -44,6 +44,8 @@ public:
KX_PYMETHOD_NOARGS(KX_ConstraintWrapper,GetConstraintId);
KX_PYMETHOD(KX_ConstraintWrapper,SetParam);
KX_PYMETHOD(KX_ConstraintWrapper,GetParam);
+
+ static PyObject* pyattr_get_constraintId(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
#endif
private:
diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp
index b62593b7911..94258088e9f 100644
--- a/source/gameengine/Ketsji/KX_Dome.cpp
+++ b/source/gameengine/Ketsji/KX_Dome.cpp
@@ -754,7 +754,7 @@ So I came out with this formula:
verts_height = tan((rad_ang/2) - (MT_PI/2))*sqrt(2.0);
Here we take half the sphere(rad_ang/2) and subtract a quarter of it (MT_PI/2)
-Therefore we have the lenght in radians of the dome/sphere over the horizon.
+Therefore we have the length in radians of the dome/sphere over the horizon.
Once we take the tangent of that angle, you have the verts coordinate corresponding to the verts on the side faces.
Then we need to multiply it by sqrt(2.0) to get the coordinate of the verts on the diagonal of the original cube.
*/
diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h
index 9ff33fe2852..749fbebe61c 100644
--- a/source/gameengine/Ketsji/KX_Dome.h
+++ b/source/gameengine/Ketsji/KX_Dome.h
@@ -188,7 +188,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_Dome"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_Dome"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_EmptyObject.cpp b/source/gameengine/Ketsji/KX_EmptyObject.cpp
index 61179b29e10..7dc66b3fb88 100644
--- a/source/gameengine/Ketsji/KX_EmptyObject.cpp
+++ b/source/gameengine/Ketsji/KX_EmptyObject.cpp
@@ -28,10 +28,6 @@
*/
#include "KX_EmptyObject.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_EmptyObject::~KX_EmptyObject()
{
diff --git a/source/gameengine/Ketsji/KX_EmptyObject.h b/source/gameengine/Ketsji/KX_EmptyObject.h
index c82c2ec1657..c41e40fdd41 100644
--- a/source/gameengine/Ketsji/KX_EmptyObject.h
+++ b/source/gameengine/Ketsji/KX_EmptyObject.h
@@ -41,7 +41,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_EmptyObject"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_EmptyObject"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp
index b7c9ce6d452..208c526398a 100644
--- a/source/gameengine/Ketsji/KX_GameActuator.cpp
+++ b/source/gameengine/Ketsji/KX_GameActuator.cpp
@@ -39,10 +39,6 @@
#include <stdio.h>
#include <stdlib.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 637b874ef5e..e44aac2699c 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -28,10 +28,6 @@
* Game object wrapper
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#if defined(_WIN64)
typedef unsigned __int64 uint_ptr;
#else
@@ -850,7 +846,7 @@ void KX_GameObject::AlignAxisToVect(const MT_Vector3& dir, int axis, float fac)
{
case 0: //x axis
ori.setValue(orimat[0][2], orimat[1][2], orimat[2][2]); //pivot axis
- if (MT_abs(vect.dot(ori)) > 1.0-3.0*MT_EPSILON) //is the vector paralell to the pivot?
+ if (MT_abs(vect.dot(ori)) > 1.0-3.0*MT_EPSILON) //is the vector parallel to the pivot?
ori.setValue(orimat[0][1], orimat[1][1], orimat[2][1]); //change the pivot!
if (fac == 1.0) {
x = vect;
@@ -1256,56 +1252,56 @@ void KX_GameObject::Relink(GEN_Map<GEN_HashedPtr, void*> *map_parameter)
static int mathutils_kxgameob_vector_cb_index= -1; /* index for our callbacks */
-static int mathutils_kxgameob_generic_check(PyObject *self_v)
+static int mathutils_kxgameob_generic_check(BaseMathObject *bmo)
{
- KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v);
+ KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user);
if(self==NULL)
return 0;
return 1;
}
-static int mathutils_kxgameob_vector_get(PyObject *self_v, int subtype, float *vec_from)
+static int mathutils_kxgameob_vector_get(BaseMathObject *bmo, int subtype)
{
- KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v);
+ KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user);
if(self==NULL)
return 0;
switch(subtype) {
case MATHUTILS_VEC_CB_POS_LOCAL:
- self->NodeGetLocalPosition().getValue(vec_from);
+ self->NodeGetLocalPosition().getValue(bmo->data);
break;
case MATHUTILS_VEC_CB_POS_GLOBAL:
- self->NodeGetWorldPosition().getValue(vec_from);
+ self->NodeGetWorldPosition().getValue(bmo->data);
break;
case MATHUTILS_VEC_CB_SCALE_LOCAL:
- self->NodeGetLocalScaling().getValue(vec_from);
+ self->NodeGetLocalScaling().getValue(bmo->data);
break;
case MATHUTILS_VEC_CB_SCALE_GLOBAL:
- self->NodeGetWorldScaling().getValue(vec_from);
+ self->NodeGetWorldScaling().getValue(bmo->data);
break;
case MATHUTILS_VEC_CB_INERTIA_LOCAL:
if(!self->GetPhysicsController()) return 0;
- self->GetPhysicsController()->GetLocalInertia().getValue(vec_from);
+ self->GetPhysicsController()->GetLocalInertia().getValue(bmo->data);
break;
case MATHUTILS_VEC_CB_OBJECT_COLOR:
- self->GetObjectColor().getValue(vec_from);
+ self->GetObjectColor().getValue(bmo->data);
break;
case MATHUTILS_VEC_CB_LINVEL_LOCAL:
if(!self->GetPhysicsController()) return 0;
- self->GetLinearVelocity(true).getValue(vec_from);
+ self->GetLinearVelocity(true).getValue(bmo->data);
break;
case MATHUTILS_VEC_CB_LINVEL_GLOBAL:
if(!self->GetPhysicsController()) return 0;
- self->GetLinearVelocity(false).getValue(vec_from);
+ self->GetLinearVelocity(false).getValue(bmo->data);
break;
case MATHUTILS_VEC_CB_ANGVEL_LOCAL:
if(!self->GetPhysicsController()) return 0;
- self->GetAngularVelocity(true).getValue(vec_from);
+ self->GetAngularVelocity(true).getValue(bmo->data);
break;
case MATHUTILS_VEC_CB_ANGVEL_GLOBAL:
if(!self->GetPhysicsController()) return 0;
- self->GetAngularVelocity(false).getValue(vec_from);
+ self->GetAngularVelocity(false).getValue(bmo->data);
break;
}
@@ -1313,73 +1309,69 @@ static int mathutils_kxgameob_vector_get(PyObject *self_v, int subtype, float *v
return 1;
}
-static int mathutils_kxgameob_vector_set(PyObject *self_v, int subtype, float *vec_to)
+static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype)
{
- KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v);
+ KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user);
if(self==NULL)
return 0;
switch(subtype) {
case MATHUTILS_VEC_CB_POS_LOCAL:
- self->NodeSetLocalPosition(MT_Point3(vec_to));
+ self->NodeSetLocalPosition(MT_Point3(bmo->data));
self->NodeUpdateGS(0.f);
break;
case MATHUTILS_VEC_CB_POS_GLOBAL:
- self->NodeSetWorldPosition(MT_Point3(vec_to));
+ self->NodeSetWorldPosition(MT_Point3(bmo->data));
self->NodeUpdateGS(0.f);
break;
case MATHUTILS_VEC_CB_SCALE_LOCAL:
- self->NodeSetLocalScale(MT_Point3(vec_to));
+ self->NodeSetLocalScale(MT_Point3(bmo->data));
self->NodeUpdateGS(0.f);
break;
case MATHUTILS_VEC_CB_SCALE_GLOBAL:
- break;
+ PyErr_SetString(PyExc_AttributeError, "KX_GameObject.worldScale is read-only");
+ return 0;
case MATHUTILS_VEC_CB_INERTIA_LOCAL:
/* read only */
break;
case MATHUTILS_VEC_CB_OBJECT_COLOR:
- self->SetObjectColor(MT_Vector4(vec_to));
+ self->SetObjectColor(MT_Vector4(bmo->data));
break;
case MATHUTILS_VEC_CB_LINVEL_LOCAL:
- self->setLinearVelocity(MT_Point3(vec_to),true);
+ self->setLinearVelocity(MT_Point3(bmo->data),true);
break;
case MATHUTILS_VEC_CB_LINVEL_GLOBAL:
- self->setLinearVelocity(MT_Point3(vec_to),false);
+ self->setLinearVelocity(MT_Point3(bmo->data),false);
break;
case MATHUTILS_VEC_CB_ANGVEL_LOCAL:
- self->setAngularVelocity(MT_Point3(vec_to),true);
+ self->setAngularVelocity(MT_Point3(bmo->data),true);
break;
case MATHUTILS_VEC_CB_ANGVEL_GLOBAL:
- self->setAngularVelocity(MT_Point3(vec_to),false);
+ self->setAngularVelocity(MT_Point3(bmo->data),false);
break;
}
return 1;
}
-static int mathutils_kxgameob_vector_get_index(PyObject *self_v, int subtype, float *vec_from, int index)
+static int mathutils_kxgameob_vector_get_index(BaseMathObject *bmo, int subtype, int index)
{
- float f[4];
/* lazy, avoid repeteing the case statement */
- if(!mathutils_kxgameob_vector_get(self_v, subtype, f))
+ if(!mathutils_kxgameob_vector_get(bmo, subtype))
return 0;
-
- vec_from[index]= f[index];
return 1;
}
-static int mathutils_kxgameob_vector_set_index(PyObject *self_v, int subtype, float *vec_to, int index)
+static int mathutils_kxgameob_vector_set_index(BaseMathObject *bmo, int subtype, int index)
{
- float f= vec_to[index];
+ float f= bmo->data[index];
/* lazy, avoid repeteing the case statement */
- if(!mathutils_kxgameob_vector_get(self_v, subtype, vec_to))
+ if(!mathutils_kxgameob_vector_get(bmo, subtype))
return 0;
- vec_to[index]= f;
- mathutils_kxgameob_vector_set(self_v, subtype, vec_to);
-
- return 1;
+ bmo->data[index]= f;
+ return mathutils_kxgameob_vector_set(bmo, subtype);
}
Mathutils_Callback mathutils_kxgameob_vector_cb = {
@@ -1396,18 +1388,18 @@ Mathutils_Callback mathutils_kxgameob_vector_cb = {
static int mathutils_kxgameob_matrix_cb_index= -1; /* index for our callbacks */
-static int mathutils_kxgameob_matrix_get(PyObject *self_v, int subtype, float *mat_from)
+static int mathutils_kxgameob_matrix_get(BaseMathObject *bmo, int subtype)
{
- KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v);
+ KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user);
if(self==NULL)
return 0;
-
+
switch(subtype) {
case MATHUTILS_MAT_CB_ORI_LOCAL:
- self->NodeGetLocalOrientation().getValue3x3(mat_from);
+ self->NodeGetLocalOrientation().getValue3x3(bmo->data);
break;
case MATHUTILS_MAT_CB_ORI_GLOBAL:
- self->NodeGetWorldOrientation().getValue3x3(mat_from);
+ self->NodeGetWorldOrientation().getValue3x3(bmo->data);
break;
}
@@ -1415,21 +1407,21 @@ static int mathutils_kxgameob_matrix_get(PyObject *self_v, int subtype, float *m
}
-static int mathutils_kxgameob_matrix_set(PyObject *self_v, int subtype, float *mat_to)
+static int mathutils_kxgameob_matrix_set(BaseMathObject *bmo, int subtype)
{
- KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v);
+ KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user);
if(self==NULL)
return 0;
MT_Matrix3x3 mat3x3;
switch(subtype) {
case MATHUTILS_MAT_CB_ORI_LOCAL:
- mat3x3.setValue3x3(mat_to);
+ mat3x3.setValue3x3(bmo->data);
self->NodeSetLocalOrientation(mat3x3);
self->NodeUpdateGS(0.f);
break;
case MATHUTILS_MAT_CB_ORI_GLOBAL:
- mat3x3.setValue3x3(mat_to);
+ mat3x3.setValue3x3(bmo->data);
self->NodeSetLocalOrientation(mat3x3);
self->NodeUpdateGS(0.f);
break;
@@ -1746,6 +1738,8 @@ PySequenceMethods KX_GameObject::Sequence = {
NULL, /* sq_ass_item */
NULL, /* sq_ass_slice */
(objobjproc)Seq_Contains, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
PyTypeObject KX_GameObject::Type = {
@@ -2740,7 +2734,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo,
KX_RayCast::Callback<KX_GameObject> callback(this,spc);
KX_RayCast::RayTest(pe, fromPoint, toPoint, callback);
- if (m_pHitObject)
+ if (m_pHitObject)
return m_pHitObject->GetProxy();
Py_RETURN_NONE;
diff --git a/source/gameengine/Ketsji/KX_IInterpolator.h b/source/gameengine/Ketsji/KX_IInterpolator.h
index b08a2368e5b..aadc964fe49 100644
--- a/source/gameengine/Ketsji/KX_IInterpolator.h
+++ b/source/gameengine/Ketsji/KX_IInterpolator.h
@@ -44,7 +44,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IInterpolator"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.cpp b/source/gameengine/Ketsji/KX_IPO_SGController.cpp
index c174e34ae7d..1d4c64483f5 100644
--- a/source/gameengine/Ketsji/KX_IPO_SGController.cpp
+++ b/source/gameengine/Ketsji/KX_IPO_SGController.cpp
@@ -28,10 +28,6 @@
* Scenegraph controller for ipos.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#if defined(_WIN64)
typedef unsigned __int64 uint_ptr;
#else
diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.h b/source/gameengine/Ketsji/KX_IPO_SGController.h
index 3841cae88da..12803cde2f1 100644
--- a/source/gameengine/Ketsji/KX_IPO_SGController.h
+++ b/source/gameengine/Ketsji/KX_IPO_SGController.h
@@ -119,7 +119,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IpoSGController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IpoSGController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.cpp b/source/gameengine/Ketsji/KX_IPhysicsController.cpp
index 07b73a5d245..18816e92bbb 100644
--- a/source/gameengine/Ketsji/KX_IPhysicsController.cpp
+++ b/source/gameengine/Ketsji/KX_IPhysicsController.cpp
@@ -29,10 +29,6 @@
*/
#include "KX_IPhysicsController.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "PHY_DynamicTypes.h"
KX_IPhysicsController::KX_IPhysicsController(bool dyna, bool sensor, bool compound, void* userdata)
diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.h b/source/gameengine/Ketsji/KX_IPhysicsController.h
index faab46c0673..288e779fee4 100644
--- a/source/gameengine/Ketsji/KX_IPhysicsController.h
+++ b/source/gameengine/Ketsji/KX_IPhysicsController.h
@@ -130,7 +130,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IPhysicsController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IPhysicsController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_IScalarInterpolator.h b/source/gameengine/Ketsji/KX_IScalarInterpolator.h
index 43e07d69611..a84e1b570fd 100644
--- a/source/gameengine/Ketsji/KX_IScalarInterpolator.h
+++ b/source/gameengine/Ketsji/KX_IScalarInterpolator.h
@@ -42,7 +42,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IScalarInterpolator"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IScalarInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_ISceneConverter.h b/source/gameengine/Ketsji/KX_ISceneConverter.h
index d4081daa2c4..8a11b875347 100644
--- a/source/gameengine/Ketsji/KX_ISceneConverter.h
+++ b/source/gameengine/Ketsji/KX_ISceneConverter.h
@@ -87,7 +87,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISceneConverter"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISceneConverter"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_ISystem.h b/source/gameengine/Ketsji/KX_ISystem.h
index 027e6348729..fb019299135 100644
--- a/source/gameengine/Ketsji/KX_ISystem.h
+++ b/source/gameengine/Ketsji/KX_ISystem.h
@@ -55,7 +55,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISystem"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISystem"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp
index 6d17dc45651..eca40cafb0e 100644
--- a/source/gameengine/Ketsji/KX_IpoActuator.cpp
+++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp
@@ -39,10 +39,6 @@
#include "KX_GameObject.h"
#include "FloatValue.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "KX_KetsjiEngine.h"
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index a13cd71fdac..1a6ae69f792 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -235,7 +235,7 @@ void KX_KetsjiEngine::SetRasterizer(RAS_IRasterizer* rasterizer)
#ifndef DISABLE_PYTHON
/*
- * At the moment the GameLogic module is imported into 'pythondictionary' after this function is called.
+ * At the moment the bge.logic module is imported into 'pythondictionary' after this function is called.
* if this function ever changes to assign a copy, make sure the game logic module is imported into this dictionary before hand.
*/
void KX_KetsjiEngine::SetPyNamespace(PyObject* pythondictionary)
@@ -966,44 +966,17 @@ void KX_KetsjiEngine::DoSound(KX_Scene* scene)
KX_Camera* cam = scene->GetActiveCamera();
if (!cam)
return;
- MT_Point3 listenerposition = cam->NodeGetWorldPosition();
- MT_Vector3 listenervelocity = cam->GetLinearVelocity();
- MT_Matrix3x3 listenerorientation = cam->NodeGetWorldOrientation();
- {
- AUD_3DData data;
- float f;
-
- listenerorientation.getValue3x3(data.orientation);
- listenerposition.getValue(data.position);
- listenervelocity.getValue(data.velocity);
-
- f = data.position[1];
- data.position[1] = data.position[2];
- data.position[2] = -f;
-
- f = data.velocity[1];
- data.velocity[1] = data.velocity[2];
- data.velocity[2] = -f;
+ float f[4];
- f = data.orientation[1];
- data.orientation[1] = data.orientation[2];
- data.orientation[2] = -f;
+ cam->NodeGetWorldPosition().getValue(f);
+ AUD_setListenerLocation(f);
- f = data.orientation[3];
- data.orientation[3] = -data.orientation[6];
- data.orientation[6] = f;
+ cam->GetLinearVelocity().getValue(f);
+ AUD_setListenerVelocity(f);
- f = data.orientation[4];
- data.orientation[4] = -data.orientation[8];
- data.orientation[8] = -f;
-
- f = data.orientation[5];
- data.orientation[5] = data.orientation[7];
- data.orientation[7] = f;
-
- AUD_updateListener(&data);
- }
+ cam->NodeGetWorldOrientation().getRotation().getValue(f);
+ AUD_setListenerOrientation(f);
}
@@ -1626,7 +1599,8 @@ KX_Scene* KX_KetsjiEngine::CreateScene(Scene *scene)
m_mousedevice,
m_networkdevice,
scene->id.name+2,
- scene);
+ scene,
+ m_canvas);
m_sceneconverter->ConvertScene(tmpscene,
m_rendertools,
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h
index 36db8685afb..f52ec8192cc 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.h
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h
@@ -71,6 +71,7 @@ private:
class KX_ISceneConverter* m_sceneconverter;
class NG_NetworkDeviceInterface* m_networkdevice;
#ifndef DISABLE_PYTHON
+ /* borrowed from sys.modules["__main__"], dont manage ref's */
PyObject* m_pythondictionary;
#endif
class SCA_IInputDevice* m_keyboarddevice;
@@ -213,6 +214,8 @@ public:
RAS_IRasterizer* GetRasterizer(){return m_rasterizer;};
RAS_ICanvas* GetCanvas(){return m_canvas;};
RAS_IRenderTools* GetRenderTools(){return m_rendertools;};
+ SCA_IInputDevice* GetKeyboardDevice(){return m_keyboarddevice;};
+ SCA_IInputDevice* GetMouseDevice(){return m_mousedevice;};
/// Dome functions
void InitDome(short res, short mode, short angle, float resbuf, short tilt, struct Text* text);
@@ -410,7 +413,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_KetsjiEngine"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_KetsjiEngine"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp
index db708d25d40..ac20b4f2f56 100644
--- a/source/gameengine/Ketsji/KX_Light.cpp
+++ b/source/gameengine/Ketsji/KX_Light.cpp
@@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#pragma warning (disable : 4786)
@@ -70,7 +66,7 @@ KX_LightObject::~KX_LightObject()
if((lamp = GetGPULamp())) {
float obmat[4][4] = {{0}};
- GPU_lamp_update(lamp, 0, obmat);
+ GPU_lamp_update(lamp, 0, 0, obmat);
}
m_rendertools->RemoveLight(&m_lightobj);
@@ -203,7 +199,7 @@ void KX_LightObject::Update()
for(int j=0; j<4; j++, dobmat++)
obmat[i][j] = (float)*dobmat;
- GPU_lamp_update(lamp, m_lightobj.m_layer, obmat);
+ GPU_lamp_update(lamp, m_lightobj.m_layer, 0, obmat);
GPU_lamp_update_colors(lamp, m_lightobj.m_red, m_lightobj.m_green,
m_lightobj.m_blue, m_lightobj.m_energy);
}
@@ -352,6 +348,11 @@ PyObject* KX_LightObject::pyattr_get_typeconst(void *self_v, const KX_PYATTRIBUT
} else if (!strcmp(type, "NORMAL")) {
retvalue = PyLong_FromSsize_t(RAS_LightObject::LIGHT_NORMAL);
}
+ else {
+ /* should never happen */
+ PyErr_SetString(PyExc_TypeError, "light.type: internal error, invalid light type");
+ retvalue = NULL;
+ }
return retvalue;
}
diff --git a/source/gameengine/Ketsji/KX_LightIpoSGController.cpp b/source/gameengine/Ketsji/KX_LightIpoSGController.cpp
index 9eae2590308..3a010556cfe 100644
--- a/source/gameengine/Ketsji/KX_LightIpoSGController.cpp
+++ b/source/gameengine/Ketsji/KX_LightIpoSGController.cpp
@@ -31,10 +31,6 @@
#include "KX_Light.h"
#include "RAS_LightObject.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#if defined(_WIN64)
typedef unsigned __int64 uint_ptr;
#else
diff --git a/source/gameengine/Ketsji/KX_LightIpoSGController.h b/source/gameengine/Ketsji/KX_LightIpoSGController.h
index 97034d34429..c857994d145 100644
--- a/source/gameengine/Ketsji/KX_LightIpoSGController.h
+++ b/source/gameengine/Ketsji/KX_LightIpoSGController.h
@@ -96,7 +96,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_LightIpoSGController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_LightIpoSGController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.cpp b/source/gameengine/Ketsji/KX_MaterialIpoController.cpp
index 85d514bd22f..13d272ee92d 100644
--- a/source/gameengine/Ketsji/KX_MaterialIpoController.cpp
+++ b/source/gameengine/Ketsji/KX_MaterialIpoController.cpp
@@ -5,10 +5,6 @@
#include "BLO_sys_types.h" // for intptr_t support
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
bool KX_MaterialIpoController::Update(double currentTime)
{
if (m_modified)
diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.h b/source/gameengine/Ketsji/KX_MaterialIpoController.h
index 906c12426eb..a979f59ec95 100644
--- a/source/gameengine/Ketsji/KX_MaterialIpoController.h
+++ b/source/gameengine/Ketsji/KX_MaterialIpoController.h
@@ -54,7 +54,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MaterialIpoController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MaterialIpoController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp
index 1cea0f88a24..a5ff7ebcbc1 100644
--- a/source/gameengine/Ketsji/KX_MeshProxy.cpp
+++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp
@@ -28,10 +28,6 @@
#ifndef DISABLE_PYTHON
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "KX_MeshProxy.h"
#include "RAS_IPolygonMaterial.h"
#include "RAS_MeshObject.h"
diff --git a/source/gameengine/Ketsji/KX_MotionState.cpp b/source/gameengine/Ketsji/KX_MotionState.cpp
index 57ef8e105a4..08f8ee556d1 100644
--- a/source/gameengine/Ketsji/KX_MotionState.cpp
+++ b/source/gameengine/Ketsji/KX_MotionState.cpp
@@ -29,10 +29,6 @@
#include "KX_MotionState.h"
#include "SG_Spatial.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_MotionState::KX_MotionState(SG_Spatial* node) : m_node(node)
{
diff --git a/source/gameengine/Ketsji/KX_MotionState.h b/source/gameengine/Ketsji/KX_MotionState.h
index 80bdd8bca48..1267abc7fa9 100644
--- a/source/gameengine/Ketsji/KX_MotionState.h
+++ b/source/gameengine/Ketsji/KX_MotionState.h
@@ -55,7 +55,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MotionState"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MotionState"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp
index a166f54d37b..36c1b0f5bd1 100644
--- a/source/gameengine/Ketsji/KX_NearSensor.cpp
+++ b/source/gameengine/Ketsji/KX_NearSensor.cpp
@@ -38,9 +38,6 @@
#include "PHY_IPhysicsController.h"
#include "PHY_IMotionState.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
KX_NearSensor::KX_NearSensor(SCA_EventManager* eventmgr,
KX_GameObject* gameobj,
float margin,
diff --git a/source/gameengine/Ketsji/KX_ObColorIpoSGController.cpp b/source/gameengine/Ketsji/KX_ObColorIpoSGController.cpp
index 69ed7d80744..108cff0232d 100644
--- a/source/gameengine/Ketsji/KX_ObColorIpoSGController.cpp
+++ b/source/gameengine/Ketsji/KX_ObColorIpoSGController.cpp
@@ -30,10 +30,6 @@
#include "KX_ScalarInterpolator.h"
#include "KX_GameObject.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#if defined(_WIN64)
typedef unsigned __int64 uint_ptr;
#else
diff --git a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h
index fd8de7a70d0..4bb18fb392b 100644
--- a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h
+++ b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h
@@ -71,7 +71,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ObColorIpoSGController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ObColorIpoSGController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
index df98d58b4e8..0d0cac3c084 100644
--- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
@@ -34,10 +34,6 @@
#include "KX_PyMath.h" // For PyVecTo - should this include be put in PyObjectPlus?
#include "KX_IPhysicsController.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
@@ -387,74 +383,69 @@ PyAttributeDef KX_ObjectActuator::Attributes[] = {
static int mathutils_kxobactu_vector_cb_index= -1; /* index for our callbacks */
-static int mathutils_obactu_generic_check(PyObject *self_v)
+static int mathutils_obactu_generic_check(BaseMathObject *bmo)
{
- KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(self_v);
+ KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user);
if(self==NULL)
return 0;
return 1;
}
-static int mathutils_obactu_vector_get(PyObject *self_v, int subtype, float *vec_from)
+static int mathutils_obactu_vector_get(BaseMathObject *bmo, int subtype)
{
- KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(self_v);
+ KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user);
if(self==NULL)
return 0;
switch(subtype) {
case MATHUTILS_VEC_CB_LINV:
- self->m_linear_velocity.getValue(vec_from);
+ self->m_linear_velocity.getValue(bmo->data);
break;
case MATHUTILS_VEC_CB_ANGV:
- self->m_angular_velocity.getValue(vec_from);
+ self->m_angular_velocity.getValue(bmo->data);
break;
}
return 1;
}
-static int mathutils_obactu_vector_set(PyObject *self_v, int subtype, float *vec_to)
+static int mathutils_obactu_vector_set(BaseMathObject *bmo, int subtype)
{
- KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(self_v);
+ KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user);
if(self==NULL)
return 0;
switch(subtype) {
case MATHUTILS_VEC_CB_LINV:
- self->m_linear_velocity.setValue(vec_to);
+ self->m_linear_velocity.setValue(bmo->data);
break;
case MATHUTILS_VEC_CB_ANGV:
- self->m_angular_velocity.setValue(vec_to);
+ self->m_angular_velocity.setValue(bmo->data);
break;
}
return 1;
}
-static int mathutils_obactu_vector_get_index(PyObject *self_v, int subtype, float *vec_from, int index)
+static int mathutils_obactu_vector_get_index(BaseMathObject *bmo, int subtype, int index)
{
- float f[4];
/* lazy, avoid repeteing the case statement */
- if(!mathutils_obactu_vector_get(self_v, subtype, f))
+ if(!mathutils_obactu_vector_get(bmo, subtype))
return 0;
-
- vec_from[index]= f[index];
return 1;
}
-static int mathutils_obactu_vector_set_index(PyObject *self_v, int subtype, float *vec_to, int index)
+static int mathutils_obactu_vector_set_index(BaseMathObject *bmo, int subtype, int index)
{
- float f= vec_to[index];
+ float f= bmo->data[index];
/* lazy, avoid repeteing the case statement */
- if(!mathutils_obactu_vector_get(self_v, subtype, vec_to))
+ if(!mathutils_obactu_vector_get(bmo, subtype))
return 0;
- vec_to[index]= f;
- mathutils_obactu_vector_set(self_v, subtype, vec_to);
-
- return 1;
+ bmo->data[index]= f;
+ return mathutils_obactu_vector_set(bmo, subtype);
}
Mathutils_Callback mathutils_obactu_vector_cb = {
@@ -476,6 +467,8 @@ int KX_ObjectActuator::pyattr_set_linV(void *self_v, const KX_PYATTRIBUTE_DEF *a
if (!PyVecTo(value, self->m_linear_velocity))
return PY_SET_ATTR_FAIL;
+ self->UpdateFuzzyFlags();
+
return PY_SET_ATTR_SUCCESS;
}
@@ -490,6 +483,8 @@ int KX_ObjectActuator::pyattr_set_angV(void *self_v, const KX_PYATTRIBUTE_DEF *a
if (!PyVecTo(value, self->m_angular_velocity))
return PY_SET_ATTR_FAIL;
+ self->UpdateFuzzyFlags();
+
return PY_SET_ATTR_SUCCESS;
}
diff --git a/source/gameengine/Ketsji/KX_OrientationInterpolator.cpp b/source/gameengine/Ketsji/KX_OrientationInterpolator.cpp
index b4bf052aac9..8949a85066c 100644
--- a/source/gameengine/Ketsji/KX_OrientationInterpolator.cpp
+++ b/source/gameengine/Ketsji/KX_OrientationInterpolator.cpp
@@ -30,10 +30,6 @@
#include "MT_Matrix3x3.h"
#include "KX_IScalarInterpolator.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void KX_OrientationInterpolator::Execute(float currentTime) const {
MT_Vector3 eul(m_ipos[0]->GetValue(currentTime),
m_ipos[1]->GetValue(currentTime),
diff --git a/source/gameengine/Ketsji/KX_OrientationInterpolator.h b/source/gameengine/Ketsji/KX_OrientationInterpolator.h
index fda331f126d..de41323c289 100644
--- a/source/gameengine/Ketsji/KX_OrientationInterpolator.h
+++ b/source/gameengine/Ketsji/KX_OrientationInterpolator.h
@@ -54,7 +54,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
private:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_OrientationInterpolator"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_OrientationInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp
index 750b0c9d195..62740585831 100644
--- a/source/gameengine/Ketsji/KX_ParentActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp
@@ -38,10 +38,6 @@
#include "PyObjectPlus.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
index d33417be53f..15fc3e5c471 100644
--- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
@@ -33,10 +33,6 @@
#include "PHY_IPhysicsEnvironment.h"
#include "PHY_IPhysicsController.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_PhysicsObjectWrapper::KX_PhysicsObjectWrapper(
PHY_IPhysicsController* ctrl,
PHY_IPhysicsEnvironment* physenv) :
diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp
index 94fcb392d24..9395e57e68b 100644
--- a/source/gameengine/Ketsji/KX_PolyProxy.cpp
+++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp
@@ -28,10 +28,6 @@
#ifndef DISABLE_PYTHON
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "KX_PolyProxy.h"
#include "KX_MeshProxy.h"
#include "RAS_MeshObject.h"
@@ -76,90 +72,19 @@ PyMethodDef KX_PolyProxy::Methods[] = {
};
PyAttributeDef KX_PolyProxy::Attributes[] = {
- /* All dummy's so they come up in a dir() */
- //KX_PYATTRIBUTE_TODO("DummyProps"),
- KX_PYATTRIBUTE_DUMMY("matname"),
- KX_PYATTRIBUTE_DUMMY("texture"),
- KX_PYATTRIBUTE_DUMMY("material"),
- KX_PYATTRIBUTE_DUMMY("matid"),
- KX_PYATTRIBUTE_DUMMY("v1"),
- KX_PYATTRIBUTE_DUMMY("v2"),
- KX_PYATTRIBUTE_DUMMY("v3"),
- KX_PYATTRIBUTE_DUMMY("v4"),
- KX_PYATTRIBUTE_DUMMY("visible"),
- KX_PYATTRIBUTE_DUMMY("collide"),
+ KX_PYATTRIBUTE_RO_FUNCTION("material_name", KX_PolyProxy, pyattr_get_material_name),
+ KX_PYATTRIBUTE_RO_FUNCTION("texture_name", KX_PolyProxy, pyattr_get_texture_name),
+ KX_PYATTRIBUTE_RO_FUNCTION("material", KX_PolyProxy, pyattr_get_material),
+ KX_PYATTRIBUTE_RO_FUNCTION("material_id", KX_PolyProxy, pyattr_get_material_id),
+ KX_PYATTRIBUTE_RO_FUNCTION("v1", KX_PolyProxy, pyattr_get_v1),
+ KX_PYATTRIBUTE_RO_FUNCTION("v2", KX_PolyProxy, pyattr_get_v2),
+ KX_PYATTRIBUTE_RO_FUNCTION("v3", KX_PolyProxy, pyattr_get_v3),
+ KX_PYATTRIBUTE_RO_FUNCTION("v4", KX_PolyProxy, pyattr_get_v4),
+ KX_PYATTRIBUTE_RO_FUNCTION("visible", KX_PolyProxy, pyattr_get_visible),
+ KX_PYATTRIBUTE_RO_FUNCTION("collide", KX_PolyProxy, pyattr_get_collide),
{ NULL } //Sentinel
};
-#if 0
-PyObject* KX_PolyProxy::py_getattro(PyObject *attr)
-{
- char *attr_str= _PyUnicode_AsString(attr);
- if (!strcmp(attr_str, "matname"))
- {
- return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName());
- }
- if (!strcmp(attr_str, "texture"))
- {
- return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName());
- }
- if (!strcmp(attr_str, "material"))
- {
- RAS_IPolyMaterial *polymat = m_polygon->GetMaterial()->GetPolyMaterial();
- if(polymat->GetFlag() & RAS_BLENDERMAT)
- {
- KX_BlenderMaterial* mat = static_cast<KX_BlenderMaterial*>(polymat);
- return mat->GetProxy();
- }
- else
- {
- KX_PolygonMaterial* mat = static_cast<KX_PolygonMaterial*>(polymat);
- return mat->GetProxy();
- }
- }
- if (!strcmp(attr_str, "matid"))
- {
- // we'll have to scan through the material bucket of the mes and compare with
- // the one of the polygon
- RAS_MaterialBucket* polyBucket = m_polygon->GetMaterial();
- unsigned int matid;
- for (matid=0; matid<(unsigned int)m_mesh->NumMaterials(); matid++)
- {
- RAS_MeshMaterial* meshMat = m_mesh->GetMeshMaterial(matid);
- if (meshMat->m_bucket == polyBucket)
- // found it
- break;
- }
- return PyLong_FromSsize_t(matid);
- }
- if (!strcmp(attr_str, "v1"))
- {
- return PyLong_FromSsize_t(m_polygon->GetVertexOffsetAbs(m_mesh, 0));
- }
- if (!strcmp(attr_str, "v2"))
- {
- return PyLong_FromSsize_t(m_polygon->GetVertexOffsetAbs(m_mesh, 1));
- }
- if (!strcmp(attr_str, "v3"))
- {
- return PyLong_FromSsize_t(m_polygon->GetVertexOffsetAbs(m_mesh, 2));
- }
- if (!strcmp(attr_str, "v4"))
- {
- return PyLong_FromSsize_t(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffsetAbs(m_mesh, 3):0));
- }
- if (!strcmp(attr_str, "visible"))
- {
- return PyLong_FromSsize_t(m_polygon->IsVisible());
- }
- if (!strcmp(attr_str, "collide"))
- {
- return PyLong_FromSsize_t(m_polygon->IsCollider());
- }
- // py_getattro_up(CValue); // XXX -- todo, make all these attributes
-}
-#endif
-
KX_PolyProxy::KX_PolyProxy(const RAS_MeshObject*mesh, RAS_Polygon* polygon)
: m_polygon(polygon),
m_mesh((RAS_MeshObject*)mesh)
@@ -183,7 +108,75 @@ CValue* KX_PolyProxy::GetReplica() { return NULL;}
// stuff for python integration
-KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialIndex,
+PyObject* KX_PolyProxy::pyattr_get_material_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PygetMaterialName();
+}
+
+PyObject* KX_PolyProxy::pyattr_get_texture_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PygetTextureName();
+}
+
+PyObject* KX_PolyProxy::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PygetMaterial();
+}
+
+PyObject* KX_PolyProxy::pyattr_get_material_id(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PygetMaterialIndex();
+}
+
+PyObject* KX_PolyProxy::pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+
+ return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 0));
+}
+
+PyObject* KX_PolyProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+
+ return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 1));
+}
+
+PyObject* KX_PolyProxy::pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+
+ return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 2));
+}
+
+PyObject* KX_PolyProxy::pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+
+ if (3 < self->m_polygon->VertexCount())
+ {
+ return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 3));
+ }
+ return PyLong_FromSsize_t(0);
+}
+
+PyObject* KX_PolyProxy::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PyisVisible();
+}
+
+PyObject* KX_PolyProxy::pyattr_get_collide(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
+ return self->PyisCollider();
+}
+
+KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialIndex,
"getMaterialIndex() : return the material index of the polygon in the mesh\n")
{
RAS_MaterialBucket* polyBucket = m_polygon->GetMaterial();
diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h
index 97d89b37435..3e669630e30 100644
--- a/source/gameengine/Ketsji/KX_PolyProxy.h
+++ b/source/gameengine/Ketsji/KX_PolyProxy.h
@@ -54,6 +54,16 @@ public:
// stuff for python integration
+ static PyObject* pyattr_get_material_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_texture_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_material_id(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_collide(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterialIndex)
KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getNumVertex)
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
index b94f3ee6c27..63204b16e8b 100644
--- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
@@ -25,10 +25,6 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "KX_PolygonMaterial.h"
#include "BKE_mesh.h"
@@ -119,7 +115,7 @@ bool KX_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingI
{
PyObject *pyRasty = PyCObject_FromVoidPtr((void*)rasty, NULL); /* new reference */
PyObject *pyCachingInfo = PyCObject_FromVoidPtr((void*) &cachingInfo, NULL); /* new reference */
- PyObject *ret = PyObject_CallMethod(m_pymaterial, "activate", "(NNO)", pyRasty, pyCachingInfo, (PyObject*) this->m_proxy);
+ PyObject *ret = PyObject_CallMethod(m_pymaterial, (char *)"activate", (char *)"(NNO)", pyRasty, pyCachingInfo, (PyObject*) this->m_proxy);
if (ret)
{
bool value = PyLong_AsSsize_t(ret);
@@ -237,7 +233,7 @@ PyAttributeDef KX_PolygonMaterial::Attributes[] = {
KX_PYATTRIBUTE_FLOAT_RW("shininess", 0.0f, 1000.0f, KX_PolygonMaterial, m_shininess),
KX_PYATTRIBUTE_FLOAT_RW("specularity", 0.0f, 1000.0f, KX_PolygonMaterial, m_specularity),
- KX_PYATTRIBUTE_RW_FUNCTION("diffuse", KX_PolygonMaterial, pyattr_get_texture, pyattr_set_diffuse),
+ KX_PYATTRIBUTE_RW_FUNCTION("diffuse", KX_PolygonMaterial, pyattr_get_diffuse, pyattr_set_diffuse),
KX_PYATTRIBUTE_RW_FUNCTION("specular",KX_PolygonMaterial, pyattr_get_specular, pyattr_set_specular),
KX_PYATTRIBUTE_RO_FUNCTION("tface", KX_PolygonMaterial, pyattr_get_tface), /* How the heck is this even useful??? - Campbell */
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h
index 9d538b4a3da..03b4bf11a18 100644
--- a/source/gameengine/Ketsji/KX_PolygonMaterial.h
+++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h
@@ -143,6 +143,7 @@ public:
static PyObject* pyattr_get_specular(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_specular(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
#endif
+
};
#endif // __KX_POLYGONMATERIAL_H__
diff --git a/source/gameengine/Ketsji/KX_PositionInterpolator.cpp b/source/gameengine/Ketsji/KX_PositionInterpolator.cpp
index 30864bb4baf..6e047180cdf 100644
--- a/source/gameengine/Ketsji/KX_PositionInterpolator.cpp
+++ b/source/gameengine/Ketsji/KX_PositionInterpolator.cpp
@@ -30,10 +30,6 @@
#include "MT_Point3.h"
#include "KX_IScalarInterpolator.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void KX_PositionInterpolator::Execute(float currentTime) const {
m_target.setValue(m_ipos[0]->GetValue(currentTime),
m_ipos[1]->GetValue(currentTime),
diff --git a/source/gameengine/Ketsji/KX_PositionInterpolator.h b/source/gameengine/Ketsji/KX_PositionInterpolator.h
index 3dd72a6b08f..764c7bd8750 100644
--- a/source/gameengine/Ketsji/KX_PositionInterpolator.h
+++ b/source/gameengine/Ketsji/KX_PositionInterpolator.h
@@ -54,7 +54,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
private:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_PositionInterpolator"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_PositionInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
index 94b98e783bc..bbf8152bd68 100644
--- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
+++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
@@ -37,10 +37,6 @@
#include "PyObjectPlus.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifndef DISABLE_PYTHON
// nasty glob variable to connect scripting language
diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp
index ba213ebc85d..59d1c197cf3 100644
--- a/source/gameengine/Ketsji/KX_PyMath.cpp
+++ b/source/gameengine/Ketsji/KX_PyMath.cpp
@@ -28,10 +28,6 @@
* Initialize Python thingies.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#pragma warning (disable : 4786)
#endif //WIN32
diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h
index 8c14ac0e96c..9c9688f79cd 100644
--- a/source/gameengine/Ketsji/KX_PyMath.h
+++ b/source/gameengine/Ketsji/KX_PyMath.h
@@ -45,7 +45,7 @@
#ifndef DISABLE_PYTHON
#ifdef USE_MATHUTILS
extern "C" {
-#include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */
+#include "../../blender/python/generic/mathutils.h" /* so we can have mathutils callbacks */
}
#endif
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 7dec4e4f97f..3785f715803 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -38,12 +38,17 @@
extern "C" {
#include "bpy_internal_import.h" /* from the blender python api, but we want to import text too! */
- #include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use.
- #include "Geometry.h" // Blender.Geometry module copied here so the blenderlayer can use.
+ #include "mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use.
+ #include "geometry.h" // Blender.Geometry module copied here so the blenderlayer can use.
#include "bgl.h"
+ #include "blf_api.h"
#include "marshal.h" /* python header for loading/saving dicts */
}
+
+#define WITH_PYTHON
+#include "AUD_PyInit.h"
+
#endif
#include "KX_PythonInit.h"
@@ -73,6 +78,8 @@ extern "C" {
#include "SCA_PropertySensor.h"
#include "SCA_RandomActuator.h"
#include "SCA_KeyboardSensor.h" /* IsPrintable, ToCharacter */
+#include "SCA_PythonKeyboard.h"
+#include "SCA_PythonMouse.h"
#include "KX_ConstraintActuator.h"
#include "KX_IpoActuator.h"
#include "KX_SoundActuator.h"
@@ -115,21 +122,24 @@ extern "C" {
#include "KX_BlenderSceneConverter.h"
#include "KX_MeshProxy.h" /* for creating a new library of mesh objects */
extern "C" {
- #include "BLO_readfile.h"
+ #include "BKE_idcode.h"
}
-
#include "NG_NetworkScene.h" //Needed for sendMessage()
-static void setSandbox(TPythonSecurityLevel level);
-
// 'local' copy of canvas ptr, for window height/width python scripts
+
+#ifndef DISABLE_PYTHON
+
static RAS_ICanvas* gp_Canvas = NULL;
+static char gp_GamePythonPath[FILE_MAXDIR + FILE_MAXFILE] = "";
+static char gp_GamePythonPathOrig[FILE_MAXDIR + FILE_MAXFILE] = ""; // not super happy about this, but we need to remember the first loaded file for the global/dict load save
+
+#endif // DISABLE_PYTHON
+
static KX_Scene* gp_KetsjiScene = NULL;
static KX_KetsjiEngine* gp_KetsjiEngine = NULL;
static RAS_IRasterizer* gp_Rasterizer = NULL;
-static char gp_GamePythonPath[FILE_MAXDIR + FILE_MAXFILE] = "";
-static char gp_GamePythonPathOrig[FILE_MAXDIR + FILE_MAXFILE] = ""; // not super happy about this, but we need to remember the first loaded file for the global/dict load save
void KX_SetActiveScene(class KX_Scene* scene)
{
@@ -256,8 +266,8 @@ static PyObject* gPyRestartGame(PyObject*)
}
static char gPySaveGlobalDict_doc[] =
-"saveGlobalDict()\n\
-Saves GameLogic.globalDict to a file";
+ "saveGlobalDict()\n"
+ "Saves bge.logic.globalDict to a file";
static PyObject* gPySaveGlobalDict(PyObject*)
{
@@ -293,8 +303,8 @@ static PyObject* gPySaveGlobalDict(PyObject*)
}
static char gPyLoadGlobalDict_doc[] =
-"LoadGlobalDict()\n\
-Loads GameLogic.globalDict from a file";
+ "LoadGlobalDict()\n"
+ "Loads bge.logic.globalDict from a file";
static PyObject* gPyLoadGlobalDict(PyObject*)
{
@@ -369,15 +379,6 @@ static PyObject* gPyGetSpectrum(PyObject*)
return resultlist;
}
-
-static PyObject* gPyStopDSP(PyObject*, PyObject* args)
-{
- PyErr_SetString(PyExc_RuntimeError, "no audio device available");
- return NULL;
-
- Py_RETURN_NONE;
-}
-
static PyObject* gPySetLogicTicRate(PyObject*, PyObject* args)
{
float ticrate;
@@ -660,7 +661,7 @@ static PyObject *gLibNew(PyObject*, PyObject* args)
return NULL;
}
- idcode= BLO_idcode_from_name(group);
+ idcode= BKE_idcode_from_name(group);
if(idcode==0) {
PyErr_Format(PyExc_ValueError, "invalid group given \"%s\"", group);
return NULL;
@@ -746,7 +747,6 @@ static struct PyMethodDef game_methods[] = {
{"getRandomFloat",(PyCFunction) gPyGetRandomFloat, METH_NOARGS, (const char *)gPyGetRandomFloat_doc},
{"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gravitation"},
{"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (const char *)"get audio spectrum"},
- {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS, (const char *)"stop using the audio dsp (for performance reasons)"},
{"getMaxLogicFrame", (PyCFunction) gPyGetMaxLogicFrame, METH_NOARGS, (const char *)"Gets the max number of logic frame per render frame"},
{"setMaxLogicFrame", (PyCFunction) gPySetMaxLogicFrame, METH_VARARGS, (const char *)"Sets the max number of logic frame per render frame"},
{"getMaxPhysicsFrame", (PyCFunction) gPyGetMaxPhysicsFrame, METH_NOARGS, (const char *)"Gets the max number of physics frame per render frame"},
@@ -929,7 +929,6 @@ static PyObject* gPyDisableMist(PyObject*)
Py_RETURN_NONE;
}
-
static PyObject* gPySetMistStart(PyObject*, PyObject* args)
{
@@ -1226,7 +1225,7 @@ static struct PyMethodDef rasterizer_methods[] = {
// Initialization function for the module (*must* be called initGameLogic)
static char GameLogic_module_documentation[] =
-"This is the Python API for the game engine of GameLogic"
+"This is the Python API for the game engine of bge.logic"
;
static char Rasterizer_module_documentation[] =
@@ -1280,6 +1279,13 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
PyDict_SetItemString(d, "globalDict", item=PyDict_New()); Py_DECREF(item);
+ // Add keyboard and mouse attributes to this module
+ SCA_PythonKeyboard* pykeyb = new SCA_PythonKeyboard(gp_KetsjiEngine->GetKeyboardDevice());
+ PyDict_SetItemString(d, "keyboard", pykeyb->NewProxy(true));
+
+ SCA_PythonMouse* pymouse = new SCA_PythonMouse(gp_KetsjiEngine->GetMouseDevice(), gp_Canvas);
+ PyDict_SetItemString(d, "mouse", pymouse->NewProxy(true));
+
ErrorObject = PyUnicode_FromString("GameLogic.error");
PyDict_SetItemString(d, "error", ErrorObject);
Py_DECREF(ErrorObject);
@@ -1308,19 +1314,25 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ROTZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTZ);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPX);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPY);
- KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPZ);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNX);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY);
- KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNZ);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIX);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIY);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIZ);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHPX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPX);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPY);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHPZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPZ);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHNX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNX);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNY);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_FHNZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNZ);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHPX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPX);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHPZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPZ);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHNX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNX);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_FHNZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNZ);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_NORMAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_NORMAL);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_MATERIAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_MATERIAL);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_PERMANENT, KX_ConstraintActuator::KX_ACT_CONSTRAINT_PERMANENT);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DISTANCE, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DISTANCE);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCAL);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DOROTFH, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DOROTFH);
/* 4. Ipo actuator, simple part */
KX_MACRO_addTypesToDict(d, KX_IPOACT_PLAY, KX_IpoActuator::KX_ACT_IPO_PLAY);
@@ -1459,6 +1471,7 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, KX_MOUSE_BUT_MIDDLE, SCA_IInputDevice::KX_MIDDLEMOUSE);
KX_MACRO_addTypesToDict(d, KX_MOUSE_BUT_RIGHT, SCA_IInputDevice::KX_RIGHTMOUSE);
+ /* 2D Filter Actuator */
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_ENABLED, RAS_2DFilterManager::RAS_2DFILTER_ENABLED);
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_DISABLED, RAS_2DFilterManager::RAS_2DFILTER_DISABLED);
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_NOFILTER, RAS_2DFilterManager::RAS_2DFILTER_NOFILTER);
@@ -1474,7 +1487,8 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_SEPIA, RAS_2DFilterManager::RAS_2DFILTER_SEPIA);
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_INVERT, RAS_2DFilterManager::RAS_2DFILTER_INVERT);
KX_MACRO_addTypesToDict(d, RAS_2DFILTER_CUSTOMFILTER, RAS_2DFilterManager::RAS_2DFILTER_CUSTOMFILTER);
-
+
+ /* Sound Actuator */
KX_MACRO_addTypesToDict(d, KX_SOUNDACT_PLAYSTOP, KX_SoundActuator::KX_SOUNDACT_PLAYSTOP);
KX_MACRO_addTypesToDict(d, KX_SOUNDACT_PLAYEND, KX_SoundActuator::KX_SOUNDACT_PLAYEND);
KX_MACRO_addTypesToDict(d, KX_SOUNDACT_LOOPSTOP, KX_SoundActuator::KX_SOUNDACT_LOOPSTOP);
@@ -1482,18 +1496,12 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SoundActuator::KX_SOUNDACT_LOOPBIDIRECTIONAL);
KX_MACRO_addTypesToDict(d, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP, KX_SoundActuator::KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP);
+ /* State Actuator */
KX_MACRO_addTypesToDict(d, KX_STATE_OP_CPY, KX_StateActuator::OP_CPY);
KX_MACRO_addTypesToDict(d, KX_STATE_OP_SET, KX_StateActuator::OP_SET);
KX_MACRO_addTypesToDict(d, KX_STATE_OP_CLR, KX_StateActuator::OP_CLR);
KX_MACRO_addTypesToDict(d, KX_STATE_OP_NEG, KX_StateActuator::OP_NEG);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_NORMAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_NORMAL);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_MATERIAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_MATERIAL);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_PERMANENT, KX_ConstraintActuator::KX_ACT_CONSTRAINT_PERMANENT);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_DISTANCE, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DISTANCE);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_LOCAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCAL);
- KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_DOROTFH, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DOROTFH);
-
/* Game Actuator Modes */
KX_MACRO_addTypesToDict(d, KX_GAME_LOAD, KX_GameActuator::KX_GAME_LOAD);
KX_MACRO_addTypesToDict(d, KX_GAME_START, KX_GameActuator::KX_GAME_START);
@@ -1566,7 +1574,7 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
// Check for errors
if (PyErr_Occurred())
{
- Py_FatalError("can't initialize module GameLogic");
+ Py_FatalError("can't initialize module bge.logic");
}
return m;
@@ -1622,7 +1630,7 @@ PyObject *KXpy_import(PyObject *self, PyObject *args)
/* quick hack for GamePython modules
TODO: register builtin modules properly by ExtendInittab */
if (!strcmp(name, "GameLogic") || !strcmp(name, "GameKeys") || !strcmp(name, "PhysicsConstraints") ||
- !strcmp(name, "Rasterizer") || !strcmp(name, "Mathutils") || !strcmp(name, "bgl") || !strcmp(name, "Geometry")) {
+ !strcmp(name, "Rasterizer") || !strcmp(name, "mathutils") || !strcmp(name, "bgl") || !strcmp(name, "geometry")) {
return PyImport_ImportModuleEx(name, globals, locals, fromlist);
}
@@ -1691,7 +1699,7 @@ static PyMethodDef meth_import[] = {{ "import", KXpy_import, METH_VARARGS, "our
//static PyObject *g_oldimport = 0;
//static int g_security = 0;
-void setSandbox(TPythonSecurityLevel level)
+static void setSandbox(TPythonSecurityLevel level)
{
PyObject *m = PyImport_AddModule("__builtin__");
PyObject *d = PyModule_GetDict(m);
@@ -1818,7 +1826,7 @@ static void initPySysObjects(Main *maggie)
while(lib) {
/* lib->name wont work in some cases (on win32),
* even when expanding with gp_GamePythonPath, using lib->filename is less trouble */
- initPySysObjects__append(sys_path, lib->filename);
+ initPySysObjects__append(sys_path, lib->filepath);
lib= (Library *)lib->id.next;
}
@@ -1896,9 +1904,8 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
first_time = false;
PyObjectPlus::ClearDeprecationWarning();
-
- PyObject* moduleobj = PyImport_AddModule("__main__");
- return PyModule_GetDict(moduleobj);
+
+ return bpy_namespace_dict_new(NULL);
}
void exitGamePlayerPythonScripting()
@@ -1933,9 +1940,8 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev
initPySysObjects(maggie);
PyObjectPlus::NullDeprecationWarning();
-
- PyObject* moduleobj = PyImport_AddModule("__main__");
- return PyModule_GetDict(moduleobj);
+
+ return bpy_namespace_dict_new(NULL);
}
void exitGamePythonScripting()
@@ -1965,20 +1971,18 @@ void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene* startscene, Main *
PyDict_SetItemString(PyModule_GetDict(*gameLogic), "globalDict", pyGlobalDict); // Same as importing the module.
*gameLogic_keys = PyDict_Keys(PyModule_GetDict(*gameLogic));
- PyDict_SetItemString(dictionaryobject, "GameLogic", *gameLogic); // Same as importing the module.
initGameKeys();
initPythonConstraintBinding();
initMathutils();
initGeometry();
initBGL();
-
-#ifdef WITH_FFMPEG
+ initBLF();
+ AUD_initPython();
initVideoTexture();
-#endif
/* could be done a lot more nicely, but for now a quick way to get bge.* working */
- PyRun_SimpleString("__import__('sys').modules['bge']=[mod for mod in (type(__builtins__)('bge'), ) if mod.__dict__.update({'logic':__import__('GameLogic'), 'render':__import__('Rasterizer'), 'keys':__import__('GameKeys'), 'constraints':__import__('PhysicsConstraints'), 'types':__import__('GameTypes')}) is None][0]");
+ PyRun_SimpleString("sys = __import__('sys');mod = sys.modules['bge'] = type(sys)('bge');mod.__dict__.update({'logic':__import__('GameLogic'), 'render':__import__('Rasterizer'), 'events':__import__('GameKeys'), 'constraints':__import__('PhysicsConstraints'), 'types':__import__('GameTypes')});import bge");
}
static struct PyModuleDef Rasterizer_module_def = {
@@ -2249,6 +2253,13 @@ PyObject* initGameKeys()
KX_MACRO_addTypesToDict(d, F10KEY, SCA_IInputDevice::KX_F10KEY);
KX_MACRO_addTypesToDict(d, F11KEY, SCA_IInputDevice::KX_F11KEY);
KX_MACRO_addTypesToDict(d, F12KEY, SCA_IInputDevice::KX_F12KEY);
+ KX_MACRO_addTypesToDict(d, F13KEY, SCA_IInputDevice::KX_F13KEY);
+ KX_MACRO_addTypesToDict(d, F14KEY, SCA_IInputDevice::KX_F14KEY);
+ KX_MACRO_addTypesToDict(d, F15KEY, SCA_IInputDevice::KX_F15KEY);
+ KX_MACRO_addTypesToDict(d, F16KEY, SCA_IInputDevice::KX_F16KEY);
+ KX_MACRO_addTypesToDict(d, F17KEY, SCA_IInputDevice::KX_F17KEY);
+ KX_MACRO_addTypesToDict(d, F18KEY, SCA_IInputDevice::KX_F18KEY);
+ KX_MACRO_addTypesToDict(d, F19KEY, SCA_IInputDevice::KX_F19KEY);
KX_MACRO_addTypesToDict(d, PAUSEKEY, SCA_IInputDevice::KX_PAUSEKEY);
KX_MACRO_addTypesToDict(d, INSERTKEY, SCA_IInputDevice::KX_INSERTKEY);
@@ -2257,6 +2268,15 @@ PyObject* initGameKeys()
KX_MACRO_addTypesToDict(d, PAGEDOWNKEY, SCA_IInputDevice::KX_PAGEDOWNKEY);
KX_MACRO_addTypesToDict(d, ENDKEY, SCA_IInputDevice::KX_ENDKEY);
+ // MOUSE
+ KX_MACRO_addTypesToDict(d, LEFTMOUSE, SCA_IInputDevice::KX_LEFTMOUSE);
+ KX_MACRO_addTypesToDict(d, MIDDLEMOUSE, SCA_IInputDevice::KX_MIDDLEMOUSE);
+ KX_MACRO_addTypesToDict(d, RIGHTMOUSE, SCA_IInputDevice::KX_RIGHTMOUSE);
+ KX_MACRO_addTypesToDict(d, WHEELUPMOUSE, SCA_IInputDevice::KX_WHEELUPMOUSE);
+ KX_MACRO_addTypesToDict(d, WHEELDOWNMOUSE, SCA_IInputDevice::KX_WHEELDOWNMOUSE);
+ KX_MACRO_addTypesToDict(d, MOUSEX, SCA_IInputDevice::KX_MOUSEX);
+ KX_MACRO_addTypesToDict(d, MOUSEY, SCA_IInputDevice::KX_MOUSEY);
+
// Check for errors
if (PyErr_Occurred())
{
@@ -2281,6 +2301,11 @@ PyObject* initBGL()
return BGL_Init();
}
+PyObject* initBLF()
+{
+ return BLF_Init();
+}
+
// utility function for loading and saving the globalDict
int saveGamePythonConfig( char **marshal_buffer)
{
@@ -2305,15 +2330,15 @@ int saveGamePythonConfig( char **marshal_buffer)
memcpy(*marshal_buffer, marshal_cstring, marshal_length);
Py_DECREF(pyGlobalDictMarshal);
} else {
- printf("Error, GameLogic.globalDict could not be marshal'd\n");
+ printf("Error, bge.logic.globalDict could not be marshal'd\n");
}
} else {
- printf("Error, GameLogic.globalDict was removed\n");
+ printf("Error, bge.logic.globalDict was removed\n");
}
Py_DECREF(gameLogic);
} else {
PyErr_Clear();
- printf("Error, GameLogic failed to import GameLogic.globalDict will be lost\n");
+ printf("Error, bge.logic failed to import bge.logic.globalDict will be lost\n");
}
return marshal_length;
}
@@ -2345,7 +2370,7 @@ int loadGamePythonConfig(char *marshal_buffer, int marshal_length)
}
} else {
PyErr_Clear();
- printf("Error, GameLogic failed to import GameLogic.globalDict will be lost\n");
+ printf("Error, bge.logic failed to import bge.logic.globalDict will be lost\n");
}
}
return 0;
diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h
index 7c2b1226bdb..fb59a2f21eb 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.h
+++ b/source/gameengine/Ketsji/KX_PythonInit.h
@@ -47,6 +47,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
PyObject* initMathutils();
PyObject* initGeometry();
PyObject* initBGL();
+PyObject* initBLF();
PyObject* initVideoTexture(void);
void exitGamePlayerPythonScripting();
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level, struct Main *maggie);
diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
index 278e0236b2e..6b9d7a2cccf 100644
--- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
@@ -79,6 +79,8 @@
#include "SCA_RandomSensor.h"
#include "SCA_XNORController.h"
#include "SCA_XORController.h"
+#include "SCA_PythonKeyboard.h"
+#include "SCA_PythonMouse.h"
#include "KX_IpoActuator.h"
#include "KX_NearSensor.h"
#include "KX_RadarSensor.h"
@@ -239,6 +241,8 @@ void initPyTypes(void)
PyType_Ready_Attr(dict, SCA_XNORController, init_getset);
PyType_Ready_Attr(dict, SCA_XORController, init_getset);
PyType_Ready_Attr(dict, SCA_IController, init_getset);
+ PyType_Ready_Attr(dict, SCA_PythonKeyboard, init_getset);
+ PyType_Ready_Attr(dict, SCA_PythonMouse, init_getset);
}
diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp
index f28c9518ac4..5c87fe2e757 100644
--- a/source/gameengine/Ketsji/KX_PythonSeq.cpp
+++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp
@@ -324,6 +324,8 @@ PySequenceMethods KX_PythonSeq_as_sequence = {
NULL, /* sq_ass_item */
NULL, /* sq_ass_slice */
(objobjproc)KX_PythonSeq_contains, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PyMappingMethods KX_PythonSeq_as_mapping = {
@@ -349,7 +351,7 @@ static PyObject *KX_PythonSeq_getIter(KX_PythonSeq *self)
return NULL;
}
- /* create a new iterator if were alredy using this one */
+ /* create a new iterator if were already using this one */
if (self->iter == -1) {
self->iter = 0;
Py_INCREF(self);
diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp
index bf4bcc91563..041559158dd 100644
--- a/source/gameengine/Ketsji/KX_RadarSensor.cpp
+++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp
@@ -32,10 +32,6 @@
#include "PHY_IPhysicsController.h"
#include "PHY_IMotionState.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/**
* RadarSensor constructor. Creates a near-sensor derived class, with a cone collision shape.
*/
diff --git a/source/gameengine/Ketsji/KX_RayCast.cpp b/source/gameengine/Ketsji/KX_RayCast.cpp
index 58bb61a51a2..7562265a536 100644
--- a/source/gameengine/Ketsji/KX_RayCast.cpp
+++ b/source/gameengine/Ketsji/KX_RayCast.cpp
@@ -86,7 +86,7 @@ bool KX_RayCast::RayTest(PHY_IPhysicsEnvironment* physics_environment, const MT_
break;
}
- // The biggest danger to to endless loop, prevent this by checking that the
+ // The biggest danger to endless loop, prevent this by checking that the
// hit point always progresses along the ray direction..
prevpoint -= callback.m_hitPoint;
if (prevpoint.length2() < MT_EPSILON)
diff --git a/source/gameengine/Ketsji/KX_RayCast.h b/source/gameengine/Ketsji/KX_RayCast.h
index f2084b7669d..1512d81e940 100644
--- a/source/gameengine/Ketsji/KX_RayCast.h
+++ b/source/gameengine/Ketsji/KX_RayCast.h
@@ -95,7 +95,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -134,7 +134,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast::Callback"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast::Callback"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_RayEventManager.cpp b/source/gameengine/Ketsji/KX_RayEventManager.cpp
index e9862fdd53f..9c9d6722784 100644
--- a/source/gameengine/Ketsji/KX_RayEventManager.cpp
+++ b/source/gameengine/Ketsji/KX_RayEventManager.cpp
@@ -38,10 +38,6 @@ using namespace std;
#include <iostream>
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void KX_RayEventManager::NextFrame()
{
SG_DList::iterator<SCA_ISensor> it(m_sensors);
diff --git a/source/gameengine/Ketsji/KX_RayEventManager.h b/source/gameengine/Ketsji/KX_RayEventManager.h
index 35bf57f130c..55c2b81b068 100644
--- a/source/gameengine/Ketsji/KX_RayEventManager.h
+++ b/source/gameengine/Ketsji/KX_RayEventManager.h
@@ -46,7 +46,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayEventManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp
index c66b55edf50..e745d1f0334 100644
--- a/source/gameengine/Ketsji/KX_RaySensor.cpp
+++ b/source/gameengine/Ketsji/KX_RaySensor.cpp
@@ -45,10 +45,6 @@
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_RaySensor::KX_RaySensor(class SCA_EventManager* eventmgr,
SCA_IObject* gameobj,
diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
index eddad69e4c5..eee6146f6ed 100644
--- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
@@ -40,10 +40,6 @@
#include "KX_IPhysicsController.h"
#include "PyObjectPlus.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
index 58085b74255..bc59c63dc69 100644
--- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
@@ -37,10 +37,6 @@
#include "KX_SCA_DynamicActuator.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifndef DISABLE_PYTHON
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
index d6a2da3e2c7..c9ead726905 100644
--- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
@@ -38,10 +38,6 @@
#include "KX_SCA_EndObjectActuator.h"
#include "SCA_IScene.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_SCA_EndObjectActuator::KX_SCA_EndObjectActuator(SCA_IObject *gameobj,
SCA_IScene* scene):
SCA_IActuator(gameobj, KX_ACT_END_OBJECT),
diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
index 0e7364bfa3e..20c3168d7ba 100644
--- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
@@ -40,10 +40,6 @@
#include "PyObjectPlus.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifndef DISABLE_PYTHON
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp
index 41aeace74c9..0529195e933 100644
--- a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp
+++ b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp
@@ -34,10 +34,6 @@
#include "BL_ArmatureObject.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/**
* Implementation of classes defined in KX_SG_BoneParentNodeRelationship.h
*/
diff --git a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h
index be8c4951935..05e9d9f02de 100644
--- a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h
+++ b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h
@@ -103,7 +103,7 @@ private :
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BoneParentRelation"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BoneParentRelation"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_SG_NodeRelationships.cpp b/source/gameengine/Ketsji/KX_SG_NodeRelationships.cpp
index 21913f8b885..ccdaac8edb7 100644
--- a/source/gameengine/Ketsji/KX_SG_NodeRelationships.cpp
+++ b/source/gameengine/Ketsji/KX_SG_NodeRelationships.cpp
@@ -28,10 +28,6 @@
#include "KX_SG_NodeRelationships.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/**
* Implementation of classes defined in KX_SG_NodeRelationships.h
*/
diff --git a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h
index f62e18b07c3..7bb6f767308 100644
--- a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h
+++ b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h
@@ -93,7 +93,7 @@ private :
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_NormalParentRelation"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_NormalParentRelation"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -150,7 +150,7 @@ private :
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_VertexParentRelation"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_VertexParentRelation"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -233,7 +233,7 @@ private :
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_SlowParentRelation"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_SlowParentRelation"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_ScalarInterpolator.cpp b/source/gameengine/Ketsji/KX_ScalarInterpolator.cpp
index 46ab82ef30b..9fc544feaff 100644
--- a/source/gameengine/Ketsji/KX_ScalarInterpolator.cpp
+++ b/source/gameengine/Ketsji/KX_ScalarInterpolator.cpp
@@ -29,10 +29,6 @@
#include "KX_ScalarInterpolator.h"
#include "KX_IScalarInterpolator.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void KX_ScalarInterpolator::Execute(float currentTime) const {
*m_target = m_ipo->GetValue(currentTime);
}
diff --git a/source/gameengine/Ketsji/KX_ScalarInterpolator.h b/source/gameengine/Ketsji/KX_ScalarInterpolator.h
index 29962ddf686..5b66ad42bd9 100644
--- a/source/gameengine/Ketsji/KX_ScalarInterpolator.h
+++ b/source/gameengine/Ketsji/KX_ScalarInterpolator.h
@@ -59,7 +59,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalarInterpolator"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalarInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_ScalingInterpolator.cpp b/source/gameengine/Ketsji/KX_ScalingInterpolator.cpp
index 9dcccd28187..3f5ac8ee8a4 100644
--- a/source/gameengine/Ketsji/KX_ScalingInterpolator.cpp
+++ b/source/gameengine/Ketsji/KX_ScalingInterpolator.cpp
@@ -30,10 +30,6 @@
#include "MT_Vector3.h"
#include "KX_IScalarInterpolator.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void KX_ScalingInterpolator::Execute(float currentTime) const {
m_target.setValue(m_ipos[0]->GetValue(currentTime),
m_ipos[1]->GetValue(currentTime),
diff --git a/source/gameengine/Ketsji/KX_ScalingInterpolator.h b/source/gameengine/Ketsji/KX_ScalingInterpolator.h
index 72e0e1185df..87b85a30d1f 100644
--- a/source/gameengine/Ketsji/KX_ScalingInterpolator.h
+++ b/source/gameengine/Ketsji/KX_ScalingInterpolator.h
@@ -54,7 +54,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalingInterpolator"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalingInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 5bcaa3ee01e..d4936d7054c 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -68,7 +68,6 @@
#include "SG_Tree.h"
#include "DNA_group_types.h"
#include "DNA_scene_types.h"
-#include "BKE_anim.h"
#include "KX_SG_NodeRelationships.h"
@@ -139,7 +138,8 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice,
class SCA_IInputDevice* mousedevice,
class NG_NetworkDeviceInterface *ndi,
const STR_String& sceneName,
- Scene *scene):
+ Scene *scene,
+ class RAS_ICanvas* canvas):
PyObjectPlus(),
m_keyboardmgr(NULL),
m_mousemgr(NULL),
@@ -170,7 +170,7 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice,
m_timemgr = new SCA_TimeEventManager(m_logicmgr);
m_keyboardmgr = new SCA_KeyboardManager(m_logicmgr,keyboarddevice);
- m_mousemgr = new SCA_MouseManager(m_logicmgr,mousedevice);
+ m_mousemgr = new SCA_MouseManager(m_logicmgr,mousedevice, canvas);
//SCA_AlwaysEventManager* alwaysmgr = new SCA_AlwaysEventManager(m_logicmgr);
//SCA_PropertyEventManager* propmgr = new SCA_PropertyEventManager(m_logicmgr);
@@ -529,7 +529,7 @@ KX_GameObject* KX_Scene::AddNodeReplicaObject(class SG_IObject* node, class CVal
// replica of the hierarchy in order to make cross-links work properly
// !
// It is VERY important that the order of sensors and actuators in
-// the replicated object is preserved: it is is used to reconnect the logic.
+// the replicated object is preserved: it is used to reconnect the logic.
// This method is more robust then using the bricks name in case of complex
// group replication. The replication of logic bricks is done in
// SCA_IObject::ReParentLogic(), make sure it preserves the order of the bricks.
@@ -961,8 +961,8 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj)
{
m_logicmgr->RemoveSensor(*its);
}
-
- SCA_ControllerList& controllers = newobj->GetControllers();
+
+ SCA_ControllerList& controllers = newobj->GetControllers();
for (SCA_ControllerList::iterator itc = controllers.begin();
!(itc==controllers.end());itc++)
{
@@ -1066,12 +1066,12 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
bool bHasShapeKey = blendmesh->key != NULL && blendmesh->key->type==KEY_RELATIVE;
bool bHasDvert = blendmesh->dvert != NULL;
bool bHasArmature =
+ BL_ModifierDeformer::HasArmatureDeformer(blendobj) &&
parentobj && // current parent is armature
parentobj->GetGameObjectType() == SCA_IObject::OBJ_ARMATURE &&
oldblendobj && // needed for mesh deform
blendobj->parent && // original object had armature (not sure this test is needed)
- blendobj->parent->type == OB_ARMATURE &&
- blendobj->partype==PARSKEL &&
+ blendobj->parent->type == OB_ARMATURE &&
blendmesh->dvert!=NULL; // mesh has vertex group
bool bHasSoftBody = (!parentobj && (blendobj->gameflag & OB_SOFT_BODY));
@@ -1753,7 +1753,7 @@ bool KX_Scene::MergeScene(KX_Scene *other)
}
- GetBucketManager()->MergeBucketManager(other->GetBucketManager());
+ GetBucketManager()->MergeBucketManager(other->GetBucketManager(), this);
/* move materials across, assume they both use the same scene-converters */
GetSceneConverter()->MergeScene(this, other);
@@ -1998,6 +1998,8 @@ PySequenceMethods KX_Scene::Sequence = {
NULL, /* sq_ass_item */
NULL, /* sq_ass_slice */
(objobjproc)Seq_Contains, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
PyObject* KX_Scene::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h
index 407f3f1cf1a..cd8277ec39f 100644
--- a/source/gameengine/Ketsji/KX_Scene.h
+++ b/source/gameengine/Ketsji/KX_Scene.h
@@ -45,6 +45,7 @@
#include "RAS_FramingManager.h"
#include "RAS_Rect.h"
+
#include "PyObjectPlus.h"
#include "RAS_2DFilterManager.h"
@@ -83,6 +84,10 @@ class btCollisionShape;
class KX_BlenderSceneConverter;
struct KX_ClientObjectInfo;
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
/* for ID freeing */
#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->flag & LIB_DOIT))
@@ -280,7 +285,8 @@ public:
class SCA_IInputDevice* mousedevice,
class NG_NetworkDeviceInterface* ndi,
const STR_String& scenename,
- struct Scene* scene);
+ struct Scene* scene,
+ class RAS_ICanvas* canvas);
virtual
~KX_Scene();
@@ -608,8 +614,6 @@ public:
//void PrintStats(int verbose_level) {
// m_bucketmanager->PrintStats(verbose_level)
//}
-
-
};
typedef std::vector<KX_Scene*> KX_SceneList;
diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp
index 692645f8abd..8f6000ebc3d 100644
--- a/source/gameengine/Ketsji/KX_SceneActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp
@@ -36,10 +36,6 @@
#include "KX_Camera.h"
#include "KX_KetsjiEngine.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp
index 08f235801a0..9ebb36578c4 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp
@@ -31,14 +31,11 @@
*/
#include "KX_SoundActuator.h"
+#include "AUD_C-API.h"
#include "KX_GameObject.h"
#include "KX_PyMath.h" // needed for PyObjectFrom()
#include <iostream>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
@@ -79,23 +76,20 @@ void KX_SoundActuator::play()
// this is the sound that will be played and not deleted afterwards
AUD_Sound* sound = m_sound;
- // this sounds are for temporary stacked sounds, will be deleted if not NULL
+ // this sound is for temporary stacked sounds, will be deleted if not NULL
AUD_Sound* sound2 = NULL;
- AUD_Sound* sound3 = NULL;
+
+ bool loop = false;
switch (m_type)
{
case KX_SOUNDACT_LOOPBIDIRECTIONAL:
case KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP:
- // create a ping pong sound on sound2 stacked on the orignal sound
- sound2 = AUD_pingpongSound(sound);
- // create a loop sound on sound3 stacked on the pingpong sound and let that one play (save it to sound)
- sound = sound3 = AUD_loopSound(sound2);
- break;
+ sound = sound2 = AUD_pingpongSound(sound);
+ // fall through
case KX_SOUNDACT_LOOPEND:
case KX_SOUNDACT_LOOPSTOP:
- // create a loop sound on sound2 stacked on the pingpong sound and let that one play (save it to sound)
- sound = sound2 = AUD_loopSound(sound);
+ loop = true;
break;
case KX_SOUNDACT_PLAYSTOP:
case KX_SOUNDACT_PLAYEND:
@@ -106,28 +100,27 @@ void KX_SoundActuator::play()
if(m_is3d)
{
// sound shall be played 3D
- m_handle = AUD_play3D(sound, 0);
-
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_MAX_GAIN, m_3d.max_gain);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_MIN_GAIN, m_3d.min_gain);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_REFERENCE_DISTANCE, m_3d.reference_distance);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_MAX_DISTANCE, m_3d.max_distance);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_ROLLOFF_FACTOR, m_3d.rolloff_factor);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_CONE_INNER_ANGLE, m_3d.cone_inner_angle);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_CONE_OUTER_ANGLE, m_3d.cone_outer_angle);
- AUD_set3DSourceSetting(m_handle, AUD_3DSS_CONE_OUTER_GAIN, m_3d.cone_outer_gain);
+ m_handle = AUD_play(sound, 0);
+
+ AUD_setRelative(m_handle, false);
+ AUD_setVolumeMaximum(m_handle, m_3d.max_gain);
+ AUD_setVolumeMinimum(m_handle, m_3d.min_gain);
+ AUD_setDistanceReference(m_handle, m_3d.reference_distance);
+ AUD_setDistanceMaximum(m_handle, m_3d.max_distance);
+ AUD_setAttenuation(m_handle, m_3d.rolloff_factor);
+ AUD_setConeAngleInner(m_handle, m_3d.cone_inner_angle);
+ AUD_setConeAngleOuter(m_handle, m_3d.cone_outer_angle);
+ AUD_setConeVolumeOuter(m_handle, m_3d.cone_outer_gain);
}
else
m_handle = AUD_play(sound, 0);
+ if(loop)
+ AUD_setLoop(m_handle, -1);
AUD_setSoundPitch(m_handle, m_pitch);
AUD_setSoundVolume(m_handle, m_volume);
m_isplaying = true;
- // now we unload the pingpong and loop sounds, as we don't need them anymore
- // the started sound will continue playing like it was created, don't worry!
- if(sound3)
- AUD_unload(sound3);
if(sound2)
AUD_unload(sound2);
}
@@ -187,7 +180,7 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
case KX_SOUNDACT_LOOPBIDIRECTIONAL:
{
// stop the looping so that the sound stops when it finished
- AUD_setLoop(m_handle, 0, -1);
+ AUD_setLoop(m_handle, 0);
break;
}
default:
@@ -219,39 +212,15 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
{
if(m_is3d)
{
- AUD_3DData data;
- float f;
- ((KX_GameObject*)this->GetParent())->NodeGetWorldPosition().getValue(data.position);
- ((KX_GameObject*)this->GetParent())->GetLinearVelocity().getValue(data.velocity);
- ((KX_GameObject*)this->GetParent())->NodeGetWorldOrientation().getValue3x3(data.orientation);
-
- /*
- * The 3D data from blender has to be transformed for OpenAL:
- * - In blender z is up and y is forwards
- * - In OpenAL y is up and z is backwards
- * We have to do that for all 5 vectors.
- */
- f = data.position[1];
- data.position[1] = data.position[2];
- data.position[2] = -f;
-
- f = data.velocity[1];
- data.velocity[1] = data.velocity[2];
- data.velocity[2] = -f;
-
- f = data.orientation[1];
- data.orientation[1] = data.orientation[2];
- data.orientation[2] = -f;
-
- f = data.orientation[4];
- data.orientation[4] = data.orientation[5];
- data.orientation[5] = -f;
-
- f = data.orientation[7];
- data.orientation[7] = data.orientation[8];
- data.orientation[8] = -f;
-
- AUD_update3DSource(m_handle, &data);
+ KX_GameObject* obj = (KX_GameObject*)this->GetParent();
+ float f[4];
+
+ obj->NodeGetWorldPosition().getValue(f);
+ AUD_setSourceLocation(m_handle, f);
+ obj->GetLinearVelocity().getValue(f);
+ AUD_setSourceVelocity(m_handle, f);
+ obj->NodeGetWorldOrientation().getRotation().getValue(f);
+ AUD_setSourceOrientation(m_handle, f);
}
result = true;
}
@@ -299,24 +268,23 @@ PyMethodDef KX_SoundActuator::Methods[] = {
KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, startSound),
KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, pauseSound),
KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, stopSound),
- {NULL,NULL,NULL,NULL} //Sentinel
+ {NULL, NULL} //Sentinel
};
PyAttributeDef KX_SoundActuator::Attributes[] = {
KX_PYATTRIBUTE_BOOL_RO("is3D", KX_SoundActuator, m_is3d),
- KX_PYATTRIBUTE_RW_FUNCTION("maxGain3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("minGain3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("referenceDistance3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("maxDistance3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("rolloffFactor3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("coneInnerAngle3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("coneOuterAngle3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
- KX_PYATTRIBUTE_RW_FUNCTION("coneOuterGain3D", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
-
+ KX_PYATTRIBUTE_RW_FUNCTION("volume_maximum", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("volume_minimum", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("distance_reference", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("distance_maximum", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("attenuation", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("cone_angle_inner", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("cone_angle_outer", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+ KX_PYATTRIBUTE_RW_FUNCTION("cone_volume_outer", KX_SoundActuator, pyattr_get_3d_property, pyattr_set_3d_property),
+
KX_PYATTRIBUTE_RW_FUNCTION("time", KX_SoundActuator, pyattr_get_audposition, pyattr_set_audposition),
KX_PYATTRIBUTE_RW_FUNCTION("volume", KX_SoundActuator, pyattr_get_gain, pyattr_set_gain),
KX_PYATTRIBUTE_RW_FUNCTION("pitch", KX_SoundActuator, pyattr_get_pitch, pyattr_set_pitch),
- KX_PYATTRIBUTE_RW_FUNCTION("rollOffFactor", KX_SoundActuator, pyattr_get_rollOffFactor, pyattr_set_rollOffFactor),
KX_PYATTRIBUTE_ENUM_RW("mode",KX_SoundActuator::KX_SOUNDACT_NODEF+1,KX_SoundActuator::KX_SOUNDACT_MAX-1,false,KX_SoundActuator,m_type),
{ NULL } //Sentinel
};
@@ -362,28 +330,28 @@ PyObject* KX_SoundActuator::pyattr_get_3d_property(void *self, const struct KX_P
const char* prop = attrdef->m_name;
float result_value = 0.0;
- if(!strcmp(prop, "maxGain3D")) {
+ if(!strcmp(prop, "volume_maximum")) {
result_value = actuator->m_3d.max_gain;
- } else if (!strcmp(prop, "minGain3D")) {
+ } else if (!strcmp(prop, "volume_minimum")) {
result_value = actuator->m_3d.min_gain;
- } else if (!strcmp(prop, "referenceDistance3D")) {
+ } else if (!strcmp(prop, "distance_reference")) {
result_value = actuator->m_3d.reference_distance;
- } else if (!strcmp(prop, "maxDistance3D")) {
+ } else if (!strcmp(prop, "distance_maximum")) {
result_value = actuator->m_3d.max_distance;
- } else if (!strcmp(prop, "rolloffFactor3D")) {
+ } else if (!strcmp(prop, "attenuation")) {
result_value = actuator->m_3d.rolloff_factor;
- } else if (!strcmp(prop, "coneInnerAngle3D")) {
+ } else if (!strcmp(prop, "cone_angle_inner")) {
result_value = actuator->m_3d.cone_inner_angle;
- } else if (!strcmp(prop, "coneOuterAngle3D")) {
+ } else if (!strcmp(prop, "cone_angle_outer")) {
result_value = actuator->m_3d.cone_outer_angle;
- } else if (!strcmp(prop, "coneOuterGain3D")) {
+ } else if (!strcmp(prop, "cone_volume_outer")) {
result_value = actuator->m_3d.cone_outer_gain;
} else {
@@ -427,66 +395,63 @@ PyObject* KX_SoundActuator::pyattr_get_pitch(void *self, const struct KX_PYATTRI
return result;
}
-PyObject* KX_SoundActuator::pyattr_get_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
-{
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- float rollofffactor = actuator->m_3d.rolloff_factor;
- PyObject* result = PyFloat_FromDouble(rollofffactor);
-
- return result;
-}
-
int KX_SoundActuator::pyattr_set_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
{
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
const char* prop = attrdef->m_name;
float prop_value = 0.0;
- AUD_3DSourceSetting setting = AUD_3DSS_NONE;
if (!PyArg_Parse(value, "f", &prop_value))
return PY_SET_ATTR_FAIL;
- // update the internal value
- if(!strcmp(prop, "maxGain3D")) {
+ // if sound is working and 3D, set the new setting
+ if(!actuator->m_is3d)
+ return PY_SET_ATTR_FAIL;
+
+ if(!strcmp(prop, "volume_maximum")) {
actuator->m_3d.max_gain = prop_value;
- setting = AUD_3DSS_MAX_GAIN;
+ if(actuator->m_handle)
+ AUD_setVolumeMaximum(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "minGain3D")) {
+ } else if (!strcmp(prop, "volume_minimum")) {
actuator->m_3d.min_gain = prop_value;
- setting = AUD_3DSS_MIN_GAIN;
+ if(actuator->m_handle)
+ AUD_setVolumeMinimum(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "referenceDistance3D")) {
+ } else if (!strcmp(prop, "distance_reference")) {
actuator->m_3d.reference_distance = prop_value;
- setting = AUD_3DSS_REFERENCE_DISTANCE;
+ if(actuator->m_handle)
+ AUD_setDistanceReference(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "maxDistance3D")) {
+ } else if (!strcmp(prop, "distance_maximum")) {
actuator->m_3d.max_distance = prop_value;
- setting = AUD_3DSS_MAX_DISTANCE;
+ if(actuator->m_handle)
+ AUD_setDistanceMaximum(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "rolloffFactor3D")) {
+ } else if (!strcmp(prop, "attenuation")) {
actuator->m_3d.rolloff_factor = prop_value;
- setting = AUD_3DSS_ROLLOFF_FACTOR;
+ if(actuator->m_handle)
+ AUD_setAttenuation(actuator->m_handle, prop_value);
- } else if (!!strcmp(prop, "coneInnerAngle3D")) {
+ } else if (!!strcmp(prop, "cone_angle_inner")) {
actuator->m_3d.cone_inner_angle = prop_value;
- setting = AUD_3DSS_CONE_INNER_ANGLE;
+ if(actuator->m_handle)
+ AUD_setConeAngleInner(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "coneOuterAngle3D")) {
+ } else if (!strcmp(prop, "cone_angle_outer")) {
actuator->m_3d.cone_outer_angle = prop_value;
- setting = AUD_3DSS_CONE_OUTER_ANGLE;
+ if(actuator->m_handle)
+ AUD_setConeAngleOuter(actuator->m_handle, prop_value);
- } else if (!strcmp(prop, "coneOuterGain3D")) {
+ } else if (!strcmp(prop, "cone_volume_outer")) {
actuator->m_3d.cone_outer_gain = prop_value;
- setting = AUD_3DSS_CONE_OUTER_GAIN;
+ if(actuator->m_handle)
+ AUD_setConeVolumeOuter(actuator->m_handle, prop_value);
} else {
return PY_SET_ATTR_FAIL;
- }
+ }
- // if sound is working and 3D, set the new setting
- if(actuator->m_handle && actuator->m_is3d && setting != AUD_3DSS_NONE)
- AUD_set3DSourceSetting(actuator->m_handle, setting, prop_value);
-
return PY_SET_ATTR_SUCCESS;
}
@@ -531,18 +496,4 @@ int KX_SoundActuator::pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_D
return PY_SET_ATTR_SUCCESS;
}
-int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
-{
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- float rollofffactor = 1.0;
- if (!PyArg_Parse(value, "f", &rollofffactor))
- return PY_SET_ATTR_FAIL;
-
- actuator->m_3d.rolloff_factor = rollofffactor;
- if(actuator->m_handle)
- AUD_set3DSourceSetting(actuator->m_handle, AUD_3DSS_ROLLOFF_FACTOR, rollofffactor);
-
- return PY_SET_ATTR_SUCCESS;
-}
-
#endif // DISABLE_PYTHON
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h
index 1eaea276191..c175a184a15 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.h
+++ b/source/gameengine/Ketsji/KX_SoundActuator.h
@@ -58,7 +58,7 @@ class KX_SoundActuator : public SCA_IActuator
float m_pitch;
bool m_is3d;
KX_3DSoundSettings m_3d;
- AUD_Handle* m_handle;
+ AUD_Channel* m_handle;
void play();
@@ -107,14 +107,12 @@ public:
static int pyattr_set_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static int pyattr_set_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static int pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
- static int pyattr_set_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static int pyattr_set_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static PyObject* pyattr_get_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
- static PyObject* pyattr_get_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
#endif // DISABLE_PYTHON
diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp
index f8fb643dd6a..33f21f49810 100644
--- a/source/gameengine/Ketsji/KX_StateActuator.cpp
+++ b/source/gameengine/Ketsji/KX_StateActuator.cpp
@@ -31,10 +31,6 @@
#include "KX_StateActuator.h"
#include "KX_GameObject.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_StateActuator::KX_StateActuator(
SCA_IObject* gameobj,
int operation,
diff --git a/source/gameengine/Ketsji/KX_TimeCategoryLogger.cpp b/source/gameengine/Ketsji/KX_TimeCategoryLogger.cpp
index 4ba3b44d504..4f10c72b50b 100644
--- a/source/gameengine/Ketsji/KX_TimeCategoryLogger.cpp
+++ b/source/gameengine/Ketsji/KX_TimeCategoryLogger.cpp
@@ -29,10 +29,6 @@
#include "KX_TimeCategoryLogger.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_TimeCategoryLogger::KX_TimeCategoryLogger(unsigned int maxNumMeasurements)
: m_maxNumMeasurements(maxNumMeasurements)
{
diff --git a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h
index 7eda71c0798..b020683bfc6 100644
--- a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h
+++ b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h
@@ -128,7 +128,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeCategoryLogger"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeCategoryLogger"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_TimeLogger.cpp b/source/gameengine/Ketsji/KX_TimeLogger.cpp
index 479d97f16a8..5ec09df2791 100644
--- a/source/gameengine/Ketsji/KX_TimeLogger.cpp
+++ b/source/gameengine/Ketsji/KX_TimeLogger.cpp
@@ -29,10 +29,6 @@
#include "KX_TimeLogger.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_TimeLogger::KX_TimeLogger(unsigned int maxNumMeasurements) :
m_maxNumMeasurements(maxNumMeasurements),
m_logStart(0),
diff --git a/source/gameengine/Ketsji/KX_TimeLogger.h b/source/gameengine/Ketsji/KX_TimeLogger.h
index b17000c98d0..058b1c2b6c7 100644
--- a/source/gameengine/Ketsji/KX_TimeLogger.h
+++ b/source/gameengine/Ketsji/KX_TimeLogger.h
@@ -106,7 +106,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeLogger"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeLogger"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp
index 2b5a7c0f127..eb55d0272f6 100644
--- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp
+++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp
@@ -33,10 +33,6 @@
#include "PHY_IPhysicsEnvironment.h"
#include "PHY_IPhysicsController.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_TouchEventManager::KX_TouchEventManager(class SCA_LogicManager* logicmgr,
PHY_IPhysicsEnvironment* physEnv)
diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.h b/source/gameengine/Ketsji/KX_TouchEventManager.h
index 57d2894498a..388195367b9 100644
--- a/source/gameengine/Ketsji/KX_TouchEventManager.h
+++ b/source/gameengine/Ketsji/KX_TouchEventManager.h
@@ -79,7 +79,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TouchEventManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TouchEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp
index 20c021480f9..9b44f487682 100644
--- a/source/gameengine/Ketsji/KX_TouchSensor.cpp
+++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp
@@ -40,10 +40,6 @@
#include <iostream>
#include "PHY_IPhysicsEnvironment.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
index baaa9a04f94..ae8d2f6459b 100644
--- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp
+++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
@@ -44,10 +44,6 @@
#include "PyObjectPlus.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
index 4adeefe32b4..4ee80c64570 100644
--- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
@@ -9,10 +9,6 @@
#include "KX_GameObject.h"
#include "KX_MotionState.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_VehicleWrapper::KX_VehicleWrapper(
PHY_IVehicle* vehicle,
PHY_IPhysicsEnvironment* physenv) :
diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp
index e53c698c1c8..09630ad2851 100644
--- a/source/gameengine/Ketsji/KX_VertexProxy.cpp
+++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp
@@ -28,10 +28,6 @@
#ifndef DISABLE_PYTHON
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "KX_VertexProxy.h"
#include "KX_MeshProxy.h"
#include "RAS_TexVert.h"
@@ -77,247 +73,359 @@ PyMethodDef KX_VertexProxy::Methods[] = {
};
PyAttributeDef KX_VertexProxy::Attributes[] = {
- //KX_PYATTRIBUTE_TODO("DummyProps"),
-
- KX_PYATTRIBUTE_DUMMY("x"),
- KX_PYATTRIBUTE_DUMMY("y"),
- KX_PYATTRIBUTE_DUMMY("z"),
-
- KX_PYATTRIBUTE_DUMMY("r"),
- KX_PYATTRIBUTE_DUMMY("g"),
- KX_PYATTRIBUTE_DUMMY("b"),
- KX_PYATTRIBUTE_DUMMY("a"),
+ KX_PYATTRIBUTE_RW_FUNCTION("x", KX_VertexProxy, pyattr_get_x, pyattr_set_x),
+ KX_PYATTRIBUTE_RW_FUNCTION("y", KX_VertexProxy, pyattr_get_y, pyattr_set_y),
+ KX_PYATTRIBUTE_RW_FUNCTION("z", KX_VertexProxy, pyattr_get_z, pyattr_set_z),
- KX_PYATTRIBUTE_DUMMY("u"),
- KX_PYATTRIBUTE_DUMMY("v"),
+ KX_PYATTRIBUTE_RW_FUNCTION("r", KX_VertexProxy, pyattr_get_r, pyattr_set_r),
+ KX_PYATTRIBUTE_RW_FUNCTION("g", KX_VertexProxy, pyattr_get_g, pyattr_set_g),
+ KX_PYATTRIBUTE_RW_FUNCTION("b", KX_VertexProxy, pyattr_get_b, pyattr_set_b),
+ KX_PYATTRIBUTE_RW_FUNCTION("a", KX_VertexProxy, pyattr_get_a, pyattr_set_a),
- KX_PYATTRIBUTE_DUMMY("u2"),
- KX_PYATTRIBUTE_DUMMY("v2"),
+ KX_PYATTRIBUTE_RW_FUNCTION("u", KX_VertexProxy, pyattr_get_u, pyattr_set_u),
+ KX_PYATTRIBUTE_RW_FUNCTION("v", KX_VertexProxy, pyattr_get_v, pyattr_set_v),
- KX_PYATTRIBUTE_DUMMY("XYZ"),
- KX_PYATTRIBUTE_DUMMY("UV"),
+ KX_PYATTRIBUTE_RW_FUNCTION("u2", KX_VertexProxy, pyattr_get_u2, pyattr_set_u2),
+ KX_PYATTRIBUTE_RW_FUNCTION("v2", KX_VertexProxy, pyattr_get_v2, pyattr_set_v2),
- KX_PYATTRIBUTE_DUMMY("color"),
- KX_PYATTRIBUTE_DUMMY("colour"),
+ KX_PYATTRIBUTE_RW_FUNCTION("XYZ", KX_VertexProxy, pyattr_get_XYZ, pyattr_set_XYZ),
+ KX_PYATTRIBUTE_RW_FUNCTION("UV", KX_VertexProxy, pyattr_get_UV, pyattr_set_UV),
- KX_PYATTRIBUTE_DUMMY("normal"),
+ KX_PYATTRIBUTE_RW_FUNCTION("color", KX_VertexProxy, pyattr_get_color, pyattr_set_color),
+ KX_PYATTRIBUTE_RW_FUNCTION("normal", KX_VertexProxy, pyattr_get_normal, pyattr_set_normal),
{ NULL } //Sentinel
};
-#if 0
-PyObject*
-KX_VertexProxy::py_getattro(PyObject *attr)
-{
- char *attr_str= _PyUnicode_AsString(attr);
- if (attr_str[1]=='\0') { // Group single letters
- // pos
- if (attr_str[0]=='x')
- return PyFloat_FromDouble(m_vertex->getXYZ()[0]);
- if (attr_str[0]=='y')
- return PyFloat_FromDouble(m_vertex->getXYZ()[1]);
- if (attr_str[0]=='z')
- return PyFloat_FromDouble(m_vertex->getXYZ()[2]);
-
- // Col
- if (attr_str[0]=='r')
- return PyFloat_FromDouble(m_vertex->getRGBA()[0]/255.0);
- if (attr_str[0]=='g')
- return PyFloat_FromDouble(m_vertex->getRGBA()[1]/255.0);
- if (attr_str[0]=='b')
- return PyFloat_FromDouble(m_vertex->getRGBA()[2]/255.0);
- if (attr_str[0]=='a')
- return PyFloat_FromDouble(m_vertex->getRGBA()[3]/255.0);
-
- // UV
- if (attr_str[0]=='u')
- return PyFloat_FromDouble(m_vertex->getUV1()[0]);
- if (attr_str[0]=='v')
- return PyFloat_FromDouble(m_vertex->getUV1()[1]);
- }
-
-
- if (!strcmp(attr_str, "XYZ"))
- return PyObjectFrom(MT_Vector3(m_vertex->getXYZ()));
-
- if (!strcmp(attr_str, "UV"))
- return PyObjectFrom(MT_Point2(m_vertex->getUV1()));
-
- if (!strcmp(attr_str, "color") || !strcmp(attr_str, "colour"))
- {
- const unsigned char *colp = m_vertex->getRGBA();
- MT_Vector4 color(colp[0], colp[1], colp[2], colp[3]);
- color /= 255.0;
- return PyObjectFrom(color);
- }
+PyObject* KX_VertexProxy::pyattr_get_x(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getXYZ()[0]);
+}
- if (!strcmp(attr_str, "normal"))
- {
- return PyObjectFrom(MT_Vector3(m_vertex->getNormal()));
- }
+PyObject* KX_VertexProxy::pyattr_get_y(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getXYZ()[1]);
+}
- py_getattro_up(CValue);
+PyObject* KX_VertexProxy::pyattr_get_z(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getXYZ()[2]);
}
-#endif
+PyObject* KX_VertexProxy::pyattr_get_r(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getRGBA()[0]/255.0);
+}
-#if 0
-int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue)
+PyObject* KX_VertexProxy::pyattr_get_g(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- char *attr_str= _PyUnicode_AsString(attr);
- if (PySequence_Check(pyvalue))
- {
- if (!strcmp(attr_str, "XYZ"))
- {
- MT_Point3 vec;
- if (PyVecTo(pyvalue, vec))
- {
- m_vertex->SetXYZ(vec);
- m_mesh->SetMeshModified(true);
- return PY_SET_ATTR_SUCCESS;
- }
- return PY_SET_ATTR_FAIL;
- }
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getRGBA()[1]/255.0);
+}
- if (!strcmp(attr_str, "UV"))
- {
- MT_Point2 vec;
- if (PyVecTo(pyvalue, vec))
- {
- m_vertex->SetUV(vec);
- m_mesh->SetMeshModified(true);
- return PY_SET_ATTR_SUCCESS;
- }
- return PY_SET_ATTR_FAIL;
- }
+PyObject* KX_VertexProxy::pyattr_get_b(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getRGBA()[2]/255.0);
+}
- if (!strcmp(attr_str, "color") || !strcmp(attr_str, "colour"))
- {
- MT_Vector4 vec;
- if (PyVecTo(pyvalue, vec))
- {
- m_vertex->SetRGBA(vec);
- m_mesh->SetMeshModified(true);
- return PY_SET_ATTR_SUCCESS;
- }
- return PY_SET_ATTR_FAIL;
- }
+PyObject* KX_VertexProxy::pyattr_get_a(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getRGBA()[3]/255.0);
+}
- if (!strcmp(attr_str, "normal"))
- {
- MT_Vector3 vec;
- if (PyVecTo(pyvalue, vec))
- {
- m_vertex->SetNormal(vec);
- m_mesh->SetMeshModified(true);
- return PY_SET_ATTR_SUCCESS;
- }
- return PY_SET_ATTR_FAIL;
- }
- }
-
- if (PyFloat_Check(pyvalue))
- {
- float val = PyFloat_AsDouble(pyvalue);
- // pos
- MT_Point3 pos(m_vertex->getXYZ());
- if (!strcmp(attr_str, "x"))
+PyObject* KX_VertexProxy::pyattr_get_u(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getUV1()[0]);
+}
+
+PyObject* KX_VertexProxy::pyattr_get_v(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getUV1()[1]);
+}
+
+PyObject* KX_VertexProxy::pyattr_get_u2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getUV2()[0]);
+}
+
+PyObject* KX_VertexProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyFloat_FromDouble(self->m_vertex->getUV2()[1]);
+}
+
+PyObject* KX_VertexProxy::pyattr_get_XYZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyObjectFrom(MT_Vector3(self->m_vertex->getXYZ()));
+}
+
+PyObject* KX_VertexProxy::pyattr_get_UV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyObjectFrom(MT_Point2(self->m_vertex->getUV1()));
+}
+
+PyObject* KX_VertexProxy::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ const unsigned char *colp = self->m_vertex->getRGBA();
+ MT_Vector4 color(colp[0], colp[1], colp[2], colp[3]);
+ color /= 255.0;
+ return PyObjectFrom(color);
+}
+
+PyObject* KX_VertexProxy::pyattr_get_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ return PyObjectFrom(MT_Vector3(self->m_vertex->getNormal()));
+}
+
+int KX_VertexProxy::pyattr_set_x(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point3 pos(self->m_vertex->getXYZ());
pos.x() = val;
- m_vertex->SetXYZ(pos);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetXYZ(pos);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- if (!strcmp(attr_str, "y"))
+int KX_VertexProxy::pyattr_set_y(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point3 pos(self->m_vertex->getXYZ());
pos.y() = val;
- m_vertex->SetXYZ(pos);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetXYZ(pos);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- if (!strcmp(attr_str, "z"))
+int KX_VertexProxy::pyattr_set_z(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point3 pos(self->m_vertex->getXYZ());
pos.z() = val;
- m_vertex->SetXYZ(pos);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetXYZ(pos);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- // uv
- MT_Point2 uv = m_vertex->getUV1();
- if (!strcmp(attr_str, "u"))
+int KX_VertexProxy::pyattr_set_u(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point2 uv = self->m_vertex->getUV1();
uv[0] = val;
- m_vertex->SetUV(uv);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetUV(uv);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- if (!strcmp(attr_str, "v"))
+int KX_VertexProxy::pyattr_set_v(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point2 uv = self->m_vertex->getUV1();
uv[1] = val;
- m_vertex->SetUV(uv);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetUV(uv);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- // uv
- MT_Point2 uv2 = m_vertex->getUV2();
- if (!strcmp(attr_str, "u2"))
+int KX_VertexProxy::pyattr_set_u2(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point2 uv = self->m_vertex->getUV2();
uv[0] = val;
- m_vertex->SetUV2(uv);
- m_mesh->SetMeshModified(true);
- return 0;
+ self->m_vertex->SetUV2(uv);
+ self->m_mesh->SetMeshModified(true);
+ return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- if (!strcmp(attr_str, "v2"))
+int KX_VertexProxy::pyattr_set_v2(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ MT_Point2 uv = self->m_vertex->getUV2();
uv[1] = val;
- m_vertex->SetUV2(uv);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetUV2(uv);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
+ return PY_SET_ATTR_FAIL;
+}
- // col
- unsigned int icol = *((const unsigned int *)m_vertex->getRGBA());
- unsigned char *cp = (unsigned char*) &icol;
- val *= 255.0;
- if (!strcmp(attr_str, "r"))
+int KX_VertexProxy::pyattr_set_r(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ unsigned int icol = *((const unsigned int *)self->m_vertex->getRGBA());
+ unsigned char *cp = (unsigned char*) &icol;
+ val *= 255.0;
cp[0] = (unsigned char) val;
- m_vertex->SetRGBA(icol);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetRGBA(icol);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
- if (!strcmp(attr_str, "g"))
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_g(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ unsigned int icol = *((const unsigned int *)self->m_vertex->getRGBA());
+ unsigned char *cp = (unsigned char*) &icol;
+ val *= 255.0;
cp[1] = (unsigned char) val;
- m_vertex->SetRGBA(icol);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetRGBA(icol);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
- if (!strcmp(attr_str, "b"))
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_b(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ unsigned int icol = *((const unsigned int *)self->m_vertex->getRGBA());
+ unsigned char *cp = (unsigned char*) &icol;
+ val *= 255.0;
cp[2] = (unsigned char) val;
- m_vertex->SetRGBA(icol);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetRGBA(icol);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
- if (!strcmp(attr_str, "a"))
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_a(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PyFloat_Check(value))
{
+ float val = PyFloat_AsDouble(value);
+ unsigned int icol = *((const unsigned int *)self->m_vertex->getRGBA());
+ unsigned char *cp = (unsigned char*) &icol;
+ val *= 255.0;
cp[3] = (unsigned char) val;
- m_vertex->SetRGBA(icol);
- m_mesh->SetMeshModified(true);
+ self->m_vertex->SetRGBA(icol);
+ self->m_mesh->SetMeshModified(true);
return PY_SET_ATTR_SUCCESS;
}
- }
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_XYZ(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PySequence_Check(value))
+ {
+ MT_Point3 vec;
+ if (PyVecTo(value, vec))
+ {
+ self->m_vertex->SetXYZ(vec);
+ self->m_mesh->SetMeshModified(true);
+ return PY_SET_ATTR_SUCCESS;
+ }
+ }
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_UV(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PySequence_Check(value))
+ {
+ MT_Point2 vec;
+ if (PyVecTo(value, vec))
+ {
+ self->m_vertex->SetUV(vec);
+ self->m_mesh->SetMeshModified(true);
+ return PY_SET_ATTR_SUCCESS;
+ }
+ }
+ return PY_SET_ATTR_FAIL;
+}
- return CValue::py_setattro(attr, pyvalue);
+int KX_VertexProxy::pyattr_set_color(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PySequence_Check(value))
+ {
+ MT_Vector4 vec;
+ if (PyVecTo(value, vec))
+ {
+ self->m_vertex->SetRGBA(vec);
+ self->m_mesh->SetMeshModified(true);
+ return PY_SET_ATTR_SUCCESS;
+ }
+ }
+ return PY_SET_ATTR_FAIL;
+}
+
+int KX_VertexProxy::pyattr_set_normal(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
+{
+ KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
+ if (PySequence_Check(value))
+ {
+ MT_Vector3 vec;
+ if (PyVecTo(value, vec))
+ {
+ self->m_vertex->SetNormal(vec);
+ self->m_mesh->SetMeshModified(true);
+ return PY_SET_ATTR_SUCCESS;
+ }
+ }
+ return PY_SET_ATTR_FAIL;
}
-#endif
KX_VertexProxy::KX_VertexProxy(KX_MeshProxy*mesh, RAS_TexVert* vertex)
: m_vertex(vertex),
diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h
index 08fe0e7e2f8..b39d3ecb7d4 100644
--- a/source/gameengine/Ketsji/KX_VertexProxy.h
+++ b/source/gameengine/Ketsji/KX_VertexProxy.h
@@ -56,6 +56,37 @@ public:
// stuff for python integration
+ static PyObject* pyattr_get_x(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_y(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_z(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_r(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_g(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_b(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_a(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_u(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_u2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_XYZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_UV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static int pyattr_set_x(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_y(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_z(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_u(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_v(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_u2(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_v2(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_r(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_g(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_b(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_a(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_XYZ(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_UV(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_color(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+ static int pyattr_set_normal(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+
KX_PYMETHOD_NOARGS(KX_VertexProxy,GetXYZ);
KX_PYMETHOD_O(KX_VertexProxy,SetXYZ);
KX_PYMETHOD_NOARGS(KX_VertexProxy,GetUV);
diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp
index e5f520acfc5..e2f2badf051 100644
--- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp
+++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp
@@ -31,10 +31,6 @@
#include "KX_VisibilityActuator.h"
#include "KX_GameObject.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_VisibilityActuator::KX_VisibilityActuator(
SCA_IObject* gameobj,
bool visible,
diff --git a/source/gameengine/Ketsji/KX_WorldInfo.cpp b/source/gameengine/Ketsji/KX_WorldInfo.cpp
index e7b3761e268..bf059ca543c 100644
--- a/source/gameengine/Ketsji/KX_WorldInfo.cpp
+++ b/source/gameengine/Ketsji/KX_WorldInfo.cpp
@@ -28,10 +28,6 @@
#include "KX_WorldInfo.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
KX_WorldInfo::~KX_WorldInfo()
{
}
diff --git a/source/gameengine/Ketsji/KX_WorldInfo.h b/source/gameengine/Ketsji/KX_WorldInfo.h
index 21f8f521ef5..3b3d52f91f7 100644
--- a/source/gameengine/Ketsji/KX_WorldInfo.h
+++ b/source/gameengine/Ketsji/KX_WorldInfo.h
@@ -67,7 +67,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldInfo"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldInfo"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/KX_WorldIpoController.cpp b/source/gameengine/Ketsji/KX_WorldIpoController.cpp
index f40c4b0253a..476b23a5cbf 100644
--- a/source/gameengine/Ketsji/KX_WorldIpoController.cpp
+++ b/source/gameengine/Ketsji/KX_WorldIpoController.cpp
@@ -30,10 +30,6 @@
#include "KX_ScalarInterpolator.h"
#include "KX_WorldInfo.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#if defined(_WIN64)
typedef unsigned __int64 uint_ptr;
#else
@@ -48,7 +44,8 @@ bool KX_WorldIpoController::Update(double currentTime)
for (i = m_interpolators.begin(); !(i == m_interpolators.end()); ++i) {
(*i)->Execute(m_ipotime);//currentTime);
}
-
+
+ /* TODO, this will crash! */
KX_WorldInfo *world = NULL;
if (m_modify_mist_start) {
diff --git a/source/gameengine/Ketsji/KX_WorldIpoController.h b/source/gameengine/Ketsji/KX_WorldIpoController.h
index c89f893458f..f6c36198ae7 100644
--- a/source/gameengine/Ketsji/KX_WorldIpoController.h
+++ b/source/gameengine/Ketsji/KX_WorldIpoController.h
@@ -94,7 +94,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldIpoController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldIpoController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Ketsji/Makefile b/source/gameengine/Ketsji/Makefile
index 4ecd23fc1a2..79c8626d295 100644
--- a/source/gameengine/Ketsji/Makefile
+++ b/source/gameengine/Ketsji/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
@@ -65,6 +65,10 @@ CPPFLAGS += -I../../blender/imbuf
CPPFLAGS += -I../../blender/gpu
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+ifeq ($(WITH_FFMPEG), true)
+ CPPFLAGS += -DWITH_FFMPEG
+endif
+
###########################
SOURCEDIR = source/gameengine/Ketsji
diff --git a/source/gameengine/Makefile b/source/gameengine/Makefile
index bcb4b9098e7..0fdac2acce2 100644
--- a/source/gameengine/Makefile
+++ b/source/gameengine/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Network/CMakeLists.txt b/source/gameengine/Network/CMakeLists.txt
index 2478715e0ab..795e63b47c3 100644
--- a/source/gameengine/Network/CMakeLists.txt
+++ b/source/gameengine/Network/CMakeLists.txt
@@ -34,4 +34,3 @@ SET(INC
)
BLENDERLIB(bf_ngnetwork "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['game2', 'player'], priority=[15, 160] )
diff --git a/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt b/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt
index 6b43a1561a1..e7c34f5a2a0 100644
--- a/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt
+++ b/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt
@@ -34,4 +34,3 @@ SET(INC
)
BLENDERLIB(bf_loopbacknetwork "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['game2', 'player'], priority=[25, 165] )
diff --git a/source/gameengine/Network/LoopBackNetwork/Makefile b/source/gameengine/Network/LoopBackNetwork/Makefile
index 690fd644094..236c28b0f23 100644
--- a/source/gameengine/Network/LoopBackNetwork/Makefile
+++ b/source/gameengine/Network/LoopBackNetwork/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.cpp b/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.cpp
index cec5bd80d04..5ac49883e91 100644
--- a/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.cpp
+++ b/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.cpp
@@ -31,10 +31,6 @@
#include "NG_LoopBackNetworkDeviceInterface.h"
#include "NG_NetworkMessage.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
// temporary debugging printf's
#ifdef NAN_NET_DEBUG
#include <stdio.h>
@@ -67,11 +63,6 @@ void NG_LoopBackNetworkDeviceInterface::NextFrame()
m_currentQueue=1-m_currentQueue;
}
-STR_String NG_LoopBackNetworkDeviceInterface::GetNetworkVersion()
-{
- return LOOPBACK_NETWORK_VERSION;
-}
-
void NG_LoopBackNetworkDeviceInterface::SendNetworkMessage(NG_NetworkMessage* nwmsg)
{
#ifdef NAN_NET_DEBUG
diff --git a/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.h b/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.h
index fdc066b424b..bb15c3239ee 100644
--- a/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.h
+++ b/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.h
@@ -34,11 +34,7 @@
#include "NG_NetworkDeviceInterface.h"
class NG_LoopBackNetworkDeviceInterface : public NG_NetworkDeviceInterface
-{
- enum {
- LOOPBACK_NETWORK_VERSION=28022001
- };
-
+{
std::deque<NG_NetworkMessage*> m_messages[2];
int m_currentQueue;
@@ -58,8 +54,6 @@ public:
virtual void SendNetworkMessage(class NG_NetworkMessage* msg);
virtual vector<NG_NetworkMessage*> RetrieveNetworkMessages();
-
- STR_String GetNetworkVersion();
};
#endif //NG_LOOPBACKNETWORKDEVICEINTERFACE_H
diff --git a/source/gameengine/Network/Makefile b/source/gameengine/Network/Makefile
index c6b22276113..99a047c8b95 100644
--- a/source/gameengine/Network/Makefile
+++ b/source/gameengine/Network/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Network/NG_NetworkDeviceInterface.h b/source/gameengine/Network/NG_NetworkDeviceInterface.h
index 446aa7dab6c..5925870272d 100644
--- a/source/gameengine/Network/NG_NetworkDeviceInterface.h
+++ b/source/gameengine/Network/NG_NetworkDeviceInterface.h
@@ -70,17 +70,11 @@ public:
*/
virtual std::vector<NG_NetworkMessage*> RetrieveNetworkMessages()=0;
-
- /**
- * number of messages in device hash for this frame
- */
-
- virtual STR_String GetNetworkVersion(void)=0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkDeviceInterface"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkDeviceInterface"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Network/NG_NetworkMessage.cpp b/source/gameengine/Network/NG_NetworkMessage.cpp
index ae02b694985..cb9b25c756a 100644
--- a/source/gameengine/Network/NG_NetworkMessage.cpp
+++ b/source/gameengine/Network/NG_NetworkMessage.cpp
@@ -30,10 +30,6 @@
#include "NG_NetworkMessage.h"
#include <assert.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
int NG_NetworkMessage::s_nextID = 3; // just some number to start with
NG_NetworkMessage::NG_NetworkMessage(
diff --git a/source/gameengine/Network/NG_NetworkMessage.h b/source/gameengine/Network/NG_NetworkMessage.h
index fd6dbd027e9..0d43e3c2b51 100644
--- a/source/gameengine/Network/NG_NetworkMessage.h
+++ b/source/gameengine/Network/NG_NetworkMessage.h
@@ -130,7 +130,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkMessage"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkMessage"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Network/NG_NetworkObject.cpp b/source/gameengine/Network/NG_NetworkObject.cpp
index 3f702c49d3e..36aef6e44c8 100644
--- a/source/gameengine/Network/NG_NetworkObject.cpp
+++ b/source/gameengine/Network/NG_NetworkObject.cpp
@@ -29,10 +29,6 @@
*/
#include "NG_NetworkObject.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
NG_NetworkObject::NG_NetworkObject()
{
}
diff --git a/source/gameengine/Network/NG_NetworkObject.h b/source/gameengine/Network/NG_NetworkObject.h
index ae185f85098..7bdd25305a0 100644
--- a/source/gameengine/Network/NG_NetworkObject.h
+++ b/source/gameengine/Network/NG_NetworkObject.h
@@ -47,7 +47,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkObject"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkObject"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Network/NG_NetworkScene.cpp b/source/gameengine/Network/NG_NetworkScene.cpp
index 777a391368b..976ce0d367e 100644
--- a/source/gameengine/Network/NG_NetworkScene.cpp
+++ b/source/gameengine/Network/NG_NetworkScene.cpp
@@ -36,10 +36,6 @@
#include "NG_NetworkMessage.h"
#include "NG_NetworkObject.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
NG_NetworkScene::NG_NetworkScene(NG_NetworkDeviceInterface* nic)
{
m_networkdevice = nic;
@@ -191,7 +187,7 @@ vector<NG_NetworkMessage*> NG_NetworkScene::FindMessages(
if (!notfound)
notfound = (subject.IsEmpty() ? notfound : m_messagesBySubject[subject] == NULL);
if (notfound) {
- // it's definately NOT in the scene, so stop looking
+ // it's definitely NOT in the scene, so stop looking
} else { // narrow phase
// possibly it's there, but maybe not (false hit)
if (to.IsEmpty()) {
diff --git a/source/gameengine/Network/NG_NetworkScene.h b/source/gameengine/Network/NG_NetworkScene.h
index 7da949dfe0c..60bb0b09097 100644
--- a/source/gameengine/Network/NG_NetworkScene.h
+++ b/source/gameengine/Network/NG_NetworkScene.h
@@ -108,7 +108,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkScene"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkScene"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Network/TerraplayNetwork/Makefile b/source/gameengine/Network/TerraplayNetwork/Makefile
index d987263d433..d5a4c86740b 100644
--- a/source/gameengine/Network/TerraplayNetwork/Makefile
+++ b/source/gameengine/Network/TerraplayNetwork/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Network/TerraplayNetwork/NG_TerraplayNetworkDeviceInterface.cpp b/source/gameengine/Network/TerraplayNetwork/NG_TerraplayNetworkDeviceInterface.cpp
index dcafea56a87..301a056f25c 100644
--- a/source/gameengine/Network/TerraplayNetwork/NG_TerraplayNetworkDeviceInterface.cpp
+++ b/source/gameengine/Network/TerraplayNetwork/NG_TerraplayNetworkDeviceInterface.cpp
@@ -31,10 +31,6 @@
#include "NG_TerraplayNetworkDeviceInterface.h"
#include "NG_NetworkMessage.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
//---- relocate these
void NG_TerraplayNetworkDeviceInterface::interface_error(char *str, GASResult error) {
GASRString err_str = GAS->ErrorTranslate(error);
diff --git a/source/gameengine/Network/TerraplayNetwork/NG_TerraplayNetworkDeviceInterface.h b/source/gameengine/Network/TerraplayNetwork/NG_TerraplayNetworkDeviceInterface.h
index 1d9242850cc..cc5f50e9e5e 100644
--- a/source/gameengine/Network/TerraplayNetwork/NG_TerraplayNetworkDeviceInterface.h
+++ b/source/gameengine/Network/TerraplayNetwork/NG_TerraplayNetworkDeviceInterface.h
@@ -56,8 +56,6 @@ public:
void SendNetworkMessage(NG_NetworkMessage* nwmsg);
vector<NG_NetworkMessage*> RetrieveNetworkMessages(void);
-
- STR_String GetNetworkVersion(void);
int mytest(void);
};
diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt
index 11a535b35c8..95888967b78 100644
--- a/source/gameengine/Physics/Bullet/CMakeLists.txt
+++ b/source/gameengine/Physics/Bullet/CMakeLists.txt
@@ -47,4 +47,3 @@ SET(INC
)
BLENDERLIB(bf_bullet "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['game','player'], priority=[15,90] )
diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.h b/source/gameengine/Physics/Bullet/CcdGraphicController.h
index 07cf6d940cb..97893420d79 100644
--- a/source/gameengine/Physics/Bullet/CcdGraphicController.h
+++ b/source/gameengine/Physics/Bullet/CcdGraphicController.h
@@ -80,7 +80,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdGraphicController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdGraphicController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index fe429200dd4..fd1a62d8997 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -507,7 +507,7 @@ bool CcdPhysicsController::DeleteControllerShape( )
bool CcdPhysicsController::ReplaceControllerShape(btCollisionShape *newShape)
{
- /* Note, deleting the previous collision shape must be done alredy */
+ /* Note, deleting the previous collision shape must be done already */
/* if (m_collisionShape) DeleteControllerShape(); */
m_object->setCollisionShape(newShape);
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
index 607602a4d0d..3bbe17459c9 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
@@ -199,7 +199,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdShapeConstructionInfo"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdShapeConstructionInfo"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -576,7 +576,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -610,7 +610,7 @@ class DefaultMotionState : public PHY_IMotionState
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:DefaultMotionState"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:DefaultMotionState"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
index 21f74e95ed4..c6e759743a9 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
@@ -277,7 +277,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsEnvironment"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsEnvironment"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Physics/Bullet/Makefile b/source/gameengine/Physics/Bullet/Makefile
index 433d1df3d2f..0514565534d 100644
--- a/source/gameengine/Physics/Bullet/Makefile
+++ b/source/gameengine/Physics/Bullet/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Physics/Dummy/CMakeLists.txt b/source/gameengine/Physics/Dummy/CMakeLists.txt
index cb7a467dde9..18330392cd7 100644
--- a/source/gameengine/Physics/Dummy/CMakeLists.txt
+++ b/source/gameengine/Physics/Dummy/CMakeLists.txt
@@ -32,4 +32,3 @@ SET(INC
)
BLENDERLIB(bf_dummy "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['game','player'], priority=[10,100] )
diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp
index e6422f1bcc1..524cffc2732 100644
--- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp
@@ -29,10 +29,6 @@
#include "DummyPhysicsEnvironment.h"
#include "PHY_IMotionState.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
DummyPhysicsEnvironment::DummyPhysicsEnvironment()
{
// create physicsengine data
diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
index 9cf125f3e3f..0ad6649f2e5 100644
--- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
@@ -96,7 +96,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:DummyPhysicsEnvironment"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:DummyPhysicsEnvironment"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Physics/Dummy/Makefile b/source/gameengine/Physics/Dummy/Makefile
index 0e36266ae09..9a600a0365f 100644
--- a/source/gameengine/Physics/Dummy/Makefile
+++ b/source/gameengine/Physics/Dummy/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Physics/Makefile b/source/gameengine/Physics/Makefile
index da0d4cafd2e..f5f914c2ac2 100644
--- a/source/gameengine/Physics/Makefile
+++ b/source/gameengine/Physics/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Physics/common/CMakeLists.txt b/source/gameengine/Physics/common/CMakeLists.txt
index 3618725c2bf..0f8f59f3b78 100644
--- a/source/gameengine/Physics/common/CMakeLists.txt
+++ b/source/gameengine/Physics/common/CMakeLists.txt
@@ -33,4 +33,3 @@ SET(INC
)
BLENDERLIB(bf_common "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_common', Split(sources), Split(incs), [], libtype=['game', 'game2','player'], priority=[20, 35, 95] )
diff --git a/source/gameengine/Physics/common/Makefile b/source/gameengine/Physics/common/Makefile
index f87da383520..369699e1b90 100644
--- a/source/gameengine/Physics/common/Makefile
+++ b/source/gameengine/Physics/common/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/Physics/common/PHY_IController.cpp b/source/gameengine/Physics/common/PHY_IController.cpp
index 5f7f5a1b8a9..577e25b4336 100644
--- a/source/gameengine/Physics/common/PHY_IController.cpp
+++ b/source/gameengine/Physics/common/PHY_IController.cpp
@@ -28,10 +28,6 @@
*/
#include "PHY_IController.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
PHY_IController::~PHY_IController()
{
diff --git a/source/gameengine/Physics/common/PHY_IController.h b/source/gameengine/Physics/common/PHY_IController.h
index 8fd9a37dea0..de2e53c3613 100644
--- a/source/gameengine/Physics/common/PHY_IController.h
+++ b/source/gameengine/Physics/common/PHY_IController.h
@@ -54,7 +54,7 @@ class PHY_IController
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Physics/common/PHY_IGraphicController.cpp b/source/gameengine/Physics/common/PHY_IGraphicController.cpp
index 118aa5c01a1..dc4b31d9a76 100644
--- a/source/gameengine/Physics/common/PHY_IGraphicController.cpp
+++ b/source/gameengine/Physics/common/PHY_IGraphicController.cpp
@@ -28,10 +28,6 @@
*/
#include "PHY_IGraphicController.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
PHY_IGraphicController::~PHY_IGraphicController()
{
diff --git a/source/gameengine/Physics/common/PHY_IGraphicController.h b/source/gameengine/Physics/common/PHY_IGraphicController.h
index adca10cc1b4..aeccdb573b4 100644
--- a/source/gameengine/Physics/common/PHY_IGraphicController.h
+++ b/source/gameengine/Physics/common/PHY_IGraphicController.h
@@ -51,7 +51,7 @@ class PHY_IGraphicController : public PHY_IController
virtual PHY_IGraphicController* GetReplica(class PHY_IMotionState* motionstate) {return 0;}
#ifdef WITH_CXX_GUARDEDALLOC
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Physics/common/PHY_IMotionState.cpp b/source/gameengine/Physics/common/PHY_IMotionState.cpp
index 9d4d1e6c003..78505231895 100644
--- a/source/gameengine/Physics/common/PHY_IMotionState.cpp
+++ b/source/gameengine/Physics/common/PHY_IMotionState.cpp
@@ -28,10 +28,6 @@
*/
#include "PHY_IMotionState.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
PHY_IMotionState::~PHY_IMotionState()
{
diff --git a/source/gameengine/Physics/common/PHY_IMotionState.h b/source/gameengine/Physics/common/PHY_IMotionState.h
index 41dc45e6e32..a644bb319ae 100644
--- a/source/gameengine/Physics/common/PHY_IMotionState.h
+++ b/source/gameengine/Physics/common/PHY_IMotionState.h
@@ -59,7 +59,7 @@ class PHY_IMotionState
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IMotionState"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IMotionState"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsController.cpp b/source/gameengine/Physics/common/PHY_IPhysicsController.cpp
index 0c96363d0e4..00c0bbe6477 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsController.cpp
+++ b/source/gameengine/Physics/common/PHY_IPhysicsController.cpp
@@ -28,10 +28,6 @@
*/
#include "PHY_IPhysicsController.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
PHY_IPhysicsController::~PHY_IPhysicsController()
{
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsController.h b/source/gameengine/Physics/common/PHY_IPhysicsController.h
index 07ae3a01c91..82baa8c47e1 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsController.h
+++ b/source/gameengine/Physics/common/PHY_IPhysicsController.h
@@ -101,7 +101,7 @@ class PHY_IPhysicsController : public PHY_IController
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsController"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.cpp b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.cpp
index 9088a22cd5f..f56dc5c0aa7 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.cpp
@@ -29,10 +29,6 @@
#include "PHY_IPhysicsEnvironment.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
/**
* Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc.)
* A derived class may be able to 'construct' entities by loading and/or converting
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
index b557d4edc07..abce2769f2a 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
+++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
@@ -88,7 +88,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IRayCastFilterCallback"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IRayCastFilterCallback"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -179,7 +179,7 @@ class PHY_IPhysicsEnvironment
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsEnvironment"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsEnvironment"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Physics/common/PHY_IVehicle.h b/source/gameengine/Physics/common/PHY_IVehicle.h
index 261bae480f5..7c00b5d0bef 100644
--- a/source/gameengine/Physics/common/PHY_IVehicle.h
+++ b/source/gameengine/Physics/common/PHY_IVehicle.h
@@ -58,7 +58,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IVehicle"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IVehicle"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/PyDoc/API_intro.py b/source/gameengine/PyDoc/API_intro.py
index abc8c83855b..097abbfbf1a 100644
--- a/source/gameengine/PyDoc/API_intro.py
+++ b/source/gameengine/PyDoc/API_intro.py
@@ -26,7 +26,7 @@ The Blender Game Engine Python API Reference
These modules have no GameEngine specific functionality but are useful in many cases.
- - L{Mathutils}
+ - L{mathutils}
- L{Geometry}
- L{BGL}
diff --git a/source/gameengine/PyDoc/GameKeys.py b/source/gameengine/PyDoc/GameKeys.py
deleted file mode 100644
index e798f6c901b..00000000000
--- a/source/gameengine/PyDoc/GameKeys.py
+++ /dev/null
@@ -1,174 +0,0 @@
-# $Id$
-"""
-Documentation for the GameKeys module.
-======================================
-
-This module holds key constants for the SCA_KeyboardSensor.
-
-
-Example::
- # Set a connected keyboard sensor to accept F1
- import GameLogic
- import GameKeys
-
- co = GameLogic.getCurrentController()
- # 'Keyboard' is a keyboard sensor
- sensor = co.getSensor('Keyboard')
- sensor.key = GameKeys.F1KEY
-
-Example::
- # Do the all keys thing
- import GameLogic
- import GameKeys
-
- co = GameLogic.getCurrentController()
- # 'Keyboard' is a keyboard sensor
- sensor = co.getSensor('Keyboard')
- keylist = sensor.events
- for key in keylist:
- # key[0] == GameKeys.keycode, key[1] = status
- if key[1] == GameLogic.KX_INPUT_JUST_ACTIVATED:
- if key[0] == GameKeys.WKEY:
- # Activate Forward!
- if key[0] == GameKeys.SKEY:
- # Activate Backward!
- if key[0] == GameKeys.AKEY:
- # Activate Left!
- if key[0] == GameKeys.DKEY:
- # Activate Right!
-
-@group Alphabet keys: AKEY, BKEY, CKEY, DKEY, EKEY, FKEY, GKEY, HKEY, IKEY, JKEY, KKEY, LKEY, MKEY, NKEY, OKEY, PKEY, QKEY, RKEY, SKEY, TKEY, UKEY, VKEY, WKEY, XKEY, YKEY, ZKEY
-@var AKEY:
-@var BKEY:
-@var CKEY:
-@var DKEY:
-@var EKEY:
-@var FKEY:
-@var GKEY:
-@var HKEY:
-@var IKEY:
-@var JKEY:
-@var KKEY:
-@var LKEY:
-@var MKEY:
-@var NKEY:
-@var OKEY:
-@var PKEY:
-@var QKEY:
-@var RKEY:
-@var SKEY:
-@var TKEY:
-@var UKEY:
-@var VKEY:
-@var WKEY:
-@var XKEY:
-@var YKEY:
-@var ZKEY:
-
-@group Number keys: ZEROKEY, ONEKEY, TWOKEY, THREEKEY, FOURKEY, FIVEKEY, SIXKEY, SEVENKEY, EIGHTKEY, NINEKEY
-@var ZEROKEY:
-@var ONEKEY:
-@var TWOKEY:
-@var THREEKEY:
-@var FOURKEY:
-@var FIVEKEY:
-@var SIXKEY:
-@var SEVENKEY:
-@var EIGHTKEY:
-@var NINEKEY:
-
-@group Modifiers: CAPSLOCKKEY, LEFTCTRLKEY, LEFTALTKEY, RIGHTALTKEY, RIGHTCTRLKEY, RIGHTSHIFTKEY, LEFTSHIFTKEY
-@var CAPSLOCKKEY:
-@var LEFTCTRLKEY:
-@var LEFTALTKEY:
-@var RIGHTALTKEY:
-@var RIGHTCTRLKEY:
-@var RIGHTSHIFTKEY:
-@var LEFTSHIFTKEY:
-
-@group Arrow Keys: LEFTARROWKEY, DOWNARROWKEY, RIGHTARROWKEY, UPARROWKEY
-@var LEFTARROWKEY:
-@var DOWNARROWKEY:
-@var RIGHTARROWKEY:
-@var UPARROWKEY:
-
-@group Numberpad Keys: PAD0, PAD1, PAD2, PAD3, PAD4, PAD5, PAD6, PAD7, PAD8, PAD9, PADPERIOD, PADSLASHKEY, PADASTERKEY, PADMINUS, PADENTER, PADPLUSKEY
-@var PAD0:
-@var PAD1:
-@var PAD2:
-@var PAD3:
-@var PAD4:
-@var PAD5:
-@var PAD6:
-@var PAD7:
-@var PAD8:
-@var PAD9:
-@var PADPERIOD:
-@var PADSLASHKEY:
-@var PADASTERKEY:
-@var PADMINUS:
-@var PADENTER:
-@var PADPLUSKEY:
-
-@group Function Keys: F1KEY, F2KEY, F3KEY, F4KEY, F5KEY, F6KEY, F7KEY, F8KEY, F9KEY, F10KEY, F11KEY, F12KEY
-@var F1KEY:
-@var F2KEY:
-@var F3KEY:
-@var F4KEY:
-@var F5KEY:
-@var F6KEY:
-@var F7KEY:
-@var F8KEY:
-@var F9KEY:
-@var F10KEY:
-@var F11KEY:
-@var F12KEY:
-
-@group Other Keys: ACCENTGRAVEKEY, BACKSLASHKEY, BACKSPACEKEY, COMMAKEY, DELKEY, ENDKEY, EQUALKEY, ESCKEY, HOMEKEY, INSERTKEY, LEFTBRACKETKEY, LINEFEEDKEY, MINUSKEY, PAGEDOWNKEY, PAGEUPKEY, PAUSEKEY, PERIODKEY, QUOTEKEY, RIGHTBRACKETKEY, RETKEY, SEMICOLONKEY, SLASHKEY, SPACEKEY, TABKEY
-@var ACCENTGRAVEKEY:
-@var BACKSLASHKEY:
-@var BACKSPACEKEY:
-@var COMMAKEY:
-@var DELKEY:
-@var ENDKEY:
-@var EQUALKEY:
-@var ESCKEY:
-@var HOMEKEY:
-@var INSERTKEY:
-@var LEFTBRACKETKEY:
-@var LINEFEEDKEY:
-@var MINUSKEY:
-@var PAGEDOWNKEY:
-@var PAGEUPKEY:
-@var PAUSEKEY:
-@var PERIODKEY:
-@var QUOTEKEY:
-@var RIGHTBRACKETKEY:
-@var RETKEY:
-@var SEMICOLONKEY:
-@var SLASHKEY:
-@var SPACEKEY:
-@var TABKEY:
-
-"""
-
-def EventToString(event):
- """
- Return the string name of a key event. Will raise a ValueError error if its invalid.
-
- @type event: int
- @param event: key event from GameKeys or the keyboard sensor.
- @rtype: string
- """
-
-def EventToCharacter(event, shift):
- """
- Return the string name of a key event. Returns an empty string if the event cant be represented as a character.
-
- @type event: int
- @param event: key event from GameKeys or the keyboard sensor.
- @type shift: bool
- @param shift: set to true if shift is held.
- @rtype: string
- """
-
diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py
deleted file mode 100644
index 56a9ea0d4f4..00000000000
--- a/source/gameengine/PyDoc/GameLogic.py
+++ /dev/null
@@ -1,515 +0,0 @@
-# $Id$
-"""
-Documentation for the GameLogic Module.
-=======================================
-
- Module to access logic functions, imported automatically into the python controllers namespace.
-
- Examples::
- # To get the controller thats running this python script:
- cont = GameLogic.getCurrentController() # GameLogic is automatically imported
-
- # To get the game object this controller is on:
- obj = cont.owner
- L{KX_GameObject} and L{KX_Camera} or L{KX_LightObject} methods are
- available depending on the type of object::
- # To get a sensor linked to this controller.
- # "sensorname" is the name of the sensor as defined in the Blender interface.
- # +---------------------+ +--------+
- # | Sensor "sensorname" +--+ Python +
- # +---------------------+ +--------+
- sens = cont.sensors["sensorname"]
-
- # To get a sequence of all sensors:
- sensors = co.sensors
-
- See the sensor's reference for available methods:
- - L{DelaySensor<GameTypes.SCA_DelaySensor>}
- - L{JoystickSensor<GameTypes.SCA_JoystickSensor>}
- - L{KeyboardSensor<GameTypes.SCA_KeyboardSensor>}
- - L{MouseFocusSensor<GameTypes.KX_MouseFocusSensor>}
- - L{MouseSensor<GameTypes.SCA_MouseSensor>}
- - L{NearSensor<GameTypes.KX_NearSensor>}
- - L{NetworkMessageSensor<GameTypes.KX_NetworkMessageSensor>}
- - L{PropertySensor<GameTypes.SCA_PropertySensor>}
- - L{RadarSensor<GameTypes.KX_RadarSensor>}
- - L{RandomSensor<GameTypes.SCA_RandomSensor>}
- - L{RaySensor<GameTypes.KX_RaySensor>}
- - L{TouchSensor<GameTypes.KX_TouchSensor>}
-
- You can also access actuators linked to the controller::
- # To get an actuator attached to the controller:
- # +--------+ +-------------------------+
- # + Python +--+ Actuator "actuatorname" |
- # +--------+ +-------------------------+
- actuator = co.actuators["actuatorname"]
-
- # Activate an actuator
- controller.activate(actuator)
-
- See the actuator's reference for available methods:
- - L{2DFilterActuator<GameTypes.SCA_2DFilterActuator>}
- - L{ActionActuator<GameTypes.BL_ActionActuator>}
- - L{AddObjectActuator<GameTypes.KX_SCA_AddObjectActuator>}
- - L{CameraActuator<GameTypes.KX_CameraActuator>}
- - L{ConstraintActuator<GameTypes.KX_ConstraintActuator>}
- - L{DynamicActuator<GameTypes.KX_SCA_DynamicActuator>}
- - L{EndObjectActuator<GameTypes.KX_SCA_EndObjectActuator>}
- - L{GameActuator<GameTypes.KX_GameActuator>}
- - L{IpoActuator<GameTypes.KX_IpoActuator>}
- - L{NetworkMessageActuator<GameTypes.KX_NetworkMessageActuator>}
- - L{ObjectActuator<GameTypes.KX_ObjectActuator>}
- - L{ParentActuator<GameTypes.KX_ParentActuator>}
- - L{PropertyActuator<GameTypes.SCA_PropertyActuator>}
- - L{RandomActuator<GameTypes.SCA_RandomActuator>}
- - L{ReplaceMeshActuator<GameTypes.KX_SCA_ReplaceMeshActuator>}
- - L{SceneActuator<GameTypes.KX_SceneActuator>}
- - L{ShapeActionActuator<GameTypes.BL_ShapeActionActuator>}
- - L{SoundActuator<GameTypes.KX_SoundActuator>}
- - L{StateActuator<GameTypes.KX_StateActuator>}
- - L{TrackToActuator<GameTypes.KX_TrackToActuator>}
- - L{VisibilityActuator<GameTypes.KX_VisibilityActuator>}
-
- Most logic brick's methods are accessors for the properties available in the logic buttons.
- Consult the logic bricks documentation for more information on how each logic brick works.
-
- There are also methods to access the current L{KX_Scene}::
- # Get the current scene
- scene = GameLogic.getCurrentScene()
-
- # Get the current camera
- cam = scene.active_camera
-
- Matricies as used by the game engine are B{row major}::
- matrix[row][col] = float
- L{KX_Camera} has some examples using matricies.
-
-
-@group Constants: KX_TRUE, KX_FALSE
-@var KX_TRUE: True value used by some modules.
-@var KX_FALSE: False value used by some modules.
-
-@group Property Sensor: KX_PROPSENSOR_*
-@var KX_PROPSENSOR_EQUAL: Activate when the property is equal to the sensor value.
-@var KX_PROPSENSOR_NOTEQUAL: Activate when the property is not equal to the sensor value.
-@var KX_PROPSENSOR_INTERVAL: Activate when the property is between the specified limits.
-@var KX_PROPSENSOR_CHANGED: Activate when the property changes
-@var KX_PROPSENSOR_EXPRESSION: Activate when the expression matches
-
-@group Constraint Actuator: KX_CONSTRAINTACT_*
-@var KX_CONSTRAINTACT_LOCX: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_LOCY: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_LOCZ: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_ROTX: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_ROTY: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_ROTZ: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_DIRNX: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_DIRNY: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_DIRPX: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_DIRPY: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_ORIX: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_ORIY: See L{KX_ConstraintActuator}
-@var KX_CONSTRAINTACT_ORIZ: See L{KX_ConstraintActuator}
-
-@group IPO Actuator: KX_IPOACT_*
-@var KX_IPOACT_PLAY: See L{KX_IpoActuator}
-@var KX_IPOACT_PINGPONG: See L{KX_IpoActuator}
-@var KX_IPOACT_FLIPPER: See L{KX_IpoActuator}
-@var KX_IPOACT_LOOPSTOP: See L{KX_IpoActuator}
-@var KX_IPOACT_LOOPEND: See L{KX_IpoActuator}
-@var KX_IPOACT_FROM_PROP: See L{KX_IpoActuator}
-
-@group Random Distributions: KX_RANDOMACT_*
-@var KX_RANDOMACT_BOOL_CONST: See L{SCA_RandomActuator}
-@var KX_RANDOMACT_BOOL_UNIFORM: See L{SCA_RandomActuator}
-@var KX_RANDOMACT_BOOL_BERNOUILLI: See L{SCA_RandomActuator}
-@var KX_RANDOMACT_INT_CONST: See L{SCA_RandomActuator}
-@var KX_RANDOMACT_INT_UNIFORM: See L{SCA_RandomActuator}
-@var KX_RANDOMACT_INT_POISSON: See L{SCA_RandomActuator}
-@var KX_RANDOMACT_FLOAT_CONST: See L{SCA_RandomActuator}
-@var KX_RANDOMACT_FLOAT_UNIFORM: See L{SCA_RandomActuator}
-@var KX_RANDOMACT_FLOAT_NORMAL: See L{SCA_RandomActuator}
-@var KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL: See L{SCA_RandomActuator}
-
-@group Action Actuator: KX_ACTIONACT_*
-@var KX_ACTIONACT_PLAY: See L{BL_ActionActuator}
-@var KX_ACTIONACT_FLIPPER: See L{BL_ActionActuator}
-@var KX_ACTIONACT_LOOPSTOP: See L{BL_ActionActuator}
-@var KX_ACTIONACT_LOOPEND: See L{BL_ActionActuator}
-@var KX_ACTIONACT_PROPERTY: See L{BL_ActionActuator}
-
-@group Sound Actuator: KX_SOUNDACT_*
-@var KX_SOUNDACT_PLAYSTOP: See L{KX_SoundActuator}
-@var KX_SOUNDACT_PLAYEND: See L{KX_SoundActuator}
-@var KX_SOUNDACT_LOOPSTOP: See L{KX_SoundActuator}
-@var KX_SOUNDACT_LOOPEND: See L{KX_SoundActuator}
-@var KX_SOUNDACT_LOOPBIDIRECTIONAL: See L{KX_SoundActuator}
-@var KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP: See L{KX_SoundActuator}
-
-@group Radar Sensor: KX_RADAR_*
-@var KX_RADAR_AXIS_POS_X: See L{KX_RadarSensor}
-@var KX_RADAR_AXIS_POS_Y: See L{KX_RadarSensor}
-@var KX_RADAR_AXIS_POS_Z: See L{KX_RadarSensor}
-@var KX_RADAR_AXIS_NEG_X: See L{KX_RadarSensor}
-@var KX_RADAR_AXIS_NEG_Y: See L{KX_RadarSensor}
-@var KX_RADAR_AXIS_NEG_Z: See L{KX_RadarSensor}
-
-@group Ray Sensor: KX_RAY_*
-@var KX_RAY_AXIS_POS_X: See L{KX_RaySensor}
-@var KX_RAY_AXIS_POS_Y: See L{KX_RaySensor}
-@var KX_RAY_AXIS_POS_Z: See L{KX_RaySensor}
-@var KX_RAY_AXIS_NEG_X: See L{KX_RaySensor}
-@var KX_RAY_AXIS_NEG_Y: See L{KX_RaySensor}
-@var KX_RAY_AXIS_NEG_Z: See L{KX_RaySensor}
-
-@group Dynamic Actuator: KX_DYN_*
-@var KX_DYN_RESTORE_DYNAMICS: See L{KX_SCA_DynamicActuator}
-@var KX_DYN_DISABLE_DYNAMICS: See L{KX_SCA_DynamicActuator}
-@var KX_DYN_ENABLE_RIGID_BODY: See L{KX_SCA_DynamicActuator}
-@var KX_DYN_DISABLE_RIGID_BODY: See L{KX_SCA_DynamicActuator}
-@var KX_DYN_SET_MASS: See L{KX_SCA_DynamicActuator}
-
-@group Game Actuator: KX_GAME_*
-@var KX_GAME_LOAD: See L{KX_GameActuator}
-@var KX_GAME_START: See L{KX_GameActuator}
-@var KX_GAME_RESTART: See L{KX_GameActuator}
-@var KX_GAME_QUIT: See L{KX_GameActuator}
-@var KX_GAME_SAVECFG: See L{KX_GameActuator}
-@var KX_GAME_LOADCFG: See L{KX_GameActuator}
-
-@group Scene Actuator: KX_SCENE_*
-@var KX_SCENE_RESTART: See L{KX_SceneActuator}
-@var KX_SCENE_SET_SCENE: See L{KX_SceneActuator}
-@var KX_SCENE_SET_CAMERA: See L{KX_SceneActuator}
-@var KX_SCENE_ADD_FRONT_SCENE: See L{KX_SceneActuator}
-@var KX_SCENE_ADD_BACK_SCENE: See L{KX_SceneActuator}
-@var KX_SCENE_REMOVE_SCENE: See L{KX_SceneActuator}
-@var KX_SCENE_SUSPEND: See L{KX_SceneActuator}
-@var KX_SCENE_RESUME: See L{KX_SceneActuator}
-
-@group Input Status: KX_INPUT_*
-@var KX_INPUT_NONE: See L{SCA_MouseSensor}
-@var KX_INPUT_JUST_ACTIVATED: See L{SCA_MouseSensor}
-@var KX_INPUT_ACTIVE: See L{SCA_MouseSensor}
-@var KX_INPUT_JUST_RELEASED: See L{SCA_MouseSensor}
-
-
-@group Mouse Buttons: KX_MOUSE_BUT_*
-@var KX_MOUSE_BUT_LEFT: See L{SCA_MouseSensor}
-@var KX_MOUSE_BUT_MIDDLE: See L{SCA_MouseSensor}
-@var KX_MOUSE_BUT_RIGHT: See L{SCA_MouseSensor}
-
-@group States: KX_STATE*
-@var KX_STATE1:
-@var KX_STATE10:
-@var KX_STATE11:
-@var KX_STATE12:
-@var KX_STATE13:
-@var KX_STATE14:
-@var KX_STATE15:
-@var KX_STATE16:
-@var KX_STATE17:
-@var KX_STATE18:
-@var KX_STATE19:
-@var KX_STATE2:
-@var KX_STATE20:
-@var KX_STATE21:
-@var KX_STATE22:
-@var KX_STATE23:
-@var KX_STATE24:
-@var KX_STATE25:
-@var KX_STATE26:
-@var KX_STATE27:
-@var KX_STATE28:
-@var KX_STATE29:
-@var KX_STATE3:
-@var KX_STATE30:
-@var KX_STATE4:
-@var KX_STATE5:
-@var KX_STATE6:
-@var KX_STATE7:
-@var KX_STATE8:
-@var KX_STATE9:
-@var KX_STATE_OP_CLR:
-@var KX_STATE_OP_CPY:
-@var KX_STATE_OP_NEG:
-@var KX_STATE_OP_SET:
-
-@group 2D Filter: RAS_2DFILTER_*
-@var RAS_2DFILTER_BLUR:
-@var RAS_2DFILTER_CUSTOMFILTER:
-@var RAS_2DFILTER_DILATION:
-@var RAS_2DFILTER_DISABLED:
-@var RAS_2DFILTER_ENABLED:
-@var RAS_2DFILTER_EROSION:
-@var RAS_2DFILTER_GRAYSCALE:
-@var RAS_2DFILTER_INVERT:
-@var RAS_2DFILTER_LAPLACIAN:
-@var RAS_2DFILTER_MOTIONBLUR:
-@var RAS_2DFILTER_NOFILTER:
-@var RAS_2DFILTER_PREWITT:
-@var RAS_2DFILTER_SEPIA:
-@var RAS_2DFILTER_SHARPEN:
-@var RAS_2DFILTER_SOBEL:
-
-@group Constraint Actuator: KX_ACT_CONSTRAINT_*
-@var KX_ACT_CONSTRAINT_DISTANCE:
-@var KX_ACT_CONSTRAINT_DOROTFH:
-@var KX_ACT_CONSTRAINT_FHNX:
-@var KX_ACT_CONSTRAINT_FHNY:
-@var KX_ACT_CONSTRAINT_FHNZ:
-@var KX_ACT_CONSTRAINT_FHPX:
-@var KX_ACT_CONSTRAINT_FHPY:
-@var KX_ACT_CONSTRAINT_FHPZ:
-@var KX_ACT_CONSTRAINT_LOCAL:
-@var KX_ACT_CONSTRAINT_MATERIAL:
-@var KX_ACT_CONSTRAINT_NORMAL:
-@var KX_ACT_CONSTRAINT_PERMANENT:
-
-@group Parent Actuator: KX_PARENT_*
-@var KX_PARENT_REMOVE:
-@var KX_PARENT_SET:
-
-@group Shader: MODELMATRIX*, MODELVIEWMATRIX*, VIEWMATRIX*, CAM_POS, CONSTANT_TIMER, SHD_TANGENT
-@var VIEWMATRIX:
-@var VIEWMATRIX_INVERSE:
-@var VIEWMATRIX_INVERSETRANSPOSE:
-@var VIEWMATRIX_TRANSPOSE:
-@var MODELMATRIX:
-@var MODELMATRIX_INVERSE:
-@var MODELMATRIX_INVERSETRANSPOSE:
-@var MODELMATRIX_TRANSPOSE:
-@var MODELVIEWMATRIX:
-@var MODELVIEWMATRIX_INVERSE:
-@var MODELVIEWMATRIX_INVERSETRANSPOSE:
-@var MODELVIEWMATRIX_TRANSPOSE:
-@var CAM_POS: Current camera position
-@var CONSTANT_TIMER: User a timer for the uniform value.
-@var SHD_TANGENT: Not yet documented.
-
-@group Blender Material: BL_*
-@var BL_DST_ALPHA:
-@var BL_DST_COLOR:
-@var BL_ONE:
-@var BL_ONE_MINUS_DST_ALPHA:
-@var BL_ONE_MINUS_DST_COLOR:
-@var BL_ONE_MINUS_SRC_ALPHA:
-@var BL_ONE_MINUS_SRC_COLOR:
-@var BL_SRC_ALPHA:
-@var BL_SRC_ALPHA_SATURATE:
-@var BL_SRC_COLOR:
-@var BL_ZERO:
-
-@group Deprecated: addActiveActuator
-
-@var globalDict: A dictionary that is saved between loading blend files so you can use
- it to store inventory and other variables you want to store between
- scenes and blend files. It can also be written to a file and loaded
- later on with the game load/save actuators.
- note: only python built in types such as int/string/bool/float/tuples/lists
- can be saved, GameObjects, Actuators etc will not work as expectred.
-"""
-
-import GameTypes
-
-# TODO
-# error
-
-def getCurrentController():
- """
- Gets the Python controller associated with this Python script.
-
- @rtype: L{SCA_PythonController}
- """
-def getCurrentScene():
- """
- Gets the current Scene.
-
- @rtype: L{KX_Scene}
- """
-def getSceneList():
- """
- Gets a list of the current scenes loaded in the game engine.
-
- @note: Scenes in your blend file that have not been converted wont be in this list. This list will only contain scenes such as overlays scenes.
-
- @rtype: list of L{KX_Scene}
- """
-def addActiveActuator(actuator, activate):
- """
- Activates the given actuator.
-
- @deprecated: Use L{GameTypes.SCA_PythonController.activate} and L{GameTypes.SCA_PythonController.deactivate} instead.
- @type actuator: L{SCA_IActuator} or the actuator name as a string.
- @type activate: boolean
- @param activate: whether to activate or deactivate the given actuator.
- """
-def loadGlobalDict():
- """
- Loads GameLogic.globalDict from a file.
- """
-def saveGlobalDict():
- """
- Saves GameLogic.globalDict to a file.
- """
-def addScene(name, overlay=1):
- """
- Loads a scene into the game engine.
-
- @param name: The name of the scene
- @type name: string
- @param body: Overlay or underlay (optional)
- @type body: int
- """
-def sendMessage(subject, body="", to="", message_from=""):
- """
- Sends a message to sensors in any active scene.
-
- @param subject: The subject of the message
- @type subject: string
- @param body: The body of the message (optional)
- @type body: string
- @param to: The name of the object to send the message to (optional)
- @type to: string
- @param message_from: The name of the object that the message is coming from (optional)
- @type message_from: string
- """
-def setGravity(gravity):
- """
- Sets the world gravity.
-
- @type gravity: list [fx, fy, fz]
- """
-def getSpectrum():
- """
- Returns a 512 point list from the sound card.
- This only works if the fmod sound driver is being used.
-
- @rtype: list [float], len(getSpectrum()) == 512
- """
-def stopDSP():
- """
- Stops the sound driver using DSP effects.
-
- Only the fmod sound driver supports this.
- DSP can be computationally expensive.
- """
-def getMaxLogicFrame():
- """
- Gets the maximum number of logic frame per render frame.
-
- @return: The maximum number of logic frame per render frame
- @rtype: interger
- """
-def setMaxLogicFrame(maxlogic):
- """
- Sets the maximum number of logic frame that are executed per render frame.
- This does not affect the physic system that still runs at full frame rate.
-
- @param maxlogic: The new maximum number of logic frame per render frame. Valid values: 1..5
- @type maxlogic: integer
- """
-def getMaxPhysicsFrame():
- """
- Gets the maximum number of physics frame per render frame.
-
- @return: The maximum number of physics frame per render frame
- @rtype: interger
- """
-def setMaxPhysicsFrame(maxphysics):
- """
- Sets the maximum number of physics timestep that are executed per render frame.
- Higher value allows physics to keep up with realtime even if graphics slows down the game.
- Physics timestep is fixed and equal to 1/tickrate (see setLogicTicRate)
- maxphysics/ticrate is the maximum delay of the renderer that physics can compensate.
-
- @param maxphysics: The new maximum number of physics timestep per render frame. Valid values: 1..5.
- @type maxphysics: integer
- """
-def getLogicTicRate():
- """
- Gets the logic update frequency.
-
- @return: The logic frequency in Hz
- @rtype: float
- """
-def setLogicTicRate(ticrate):
- """
- Sets the logic update frequency.
-
- The logic update frequency is the number of times logic bricks are executed every second.
- The default is 60 Hz.
-
- @param ticrate: The new logic update frequency (in Hz).
- @type ticrate: float
- """
-def getPhysicsTicRate():
- """
- NOT IMPLEMENTED
- Gets the physics update frequency
-
- @return: The physics update frequency in Hz
- @rtype: float
- """
-def setPhysicsTicRate(ticrate):
- """
- NOT IMPLEMENTED
- Sets the physics update frequency
-
- The physics update frequency is the number of times the physics system is executed every second.
- The default is 60 Hz.
-
- @param ticrate: The new update frequency (in Hz).
- @type ticrate: float
- """
-def saveGlobalDict():
- """
- Saves GameLogic.globalDict to a file.
- """
-def loadGlobalDict():
- """
- Loads GameLogic.globalDict from a file.
- """
-
-#{ Utility functions
-def getAverageFrameRate():
- """
- Gets the estimated average framerate
-
- @return: The estimed average framerate in frames per second
- @rtype: float
- """
-def expandPath(path):
- """
- Converts a blender internal path into a proper file system path.
-
- Use / as directory separator in path
- You can use '//' at the start of the string to define a relative path;
- Blender replaces that string by the directory of the startup .blend or runtime file
- to make a full path name (doesn't change during the game, even if you load other .blend).
- The function also converts the directory separator to the local file system format.
-
- @param path: The path string to be converted/expanded.
- @type path: string
- @return: The converted string
- @rtype: string
- """
-
-def getBlendFileList(path = "//"):
- """
- Returns a list of blend files in the same directory as the open blend file, or from using the option argument.
-
- @param path: Optional directory argument, will be expanded (like expandPath) into the full path.
- @type path: string
- @return: A list of filenames, with no directory prefix
- @rtype: list
- """
-def PrintGLInfo():
- """
- Prints GL Extension Info into the console
- """
-def getRandomFloat():
- """
- Returns a random floating point value in the range [0...1)
- """
-#}
diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py
deleted file mode 100644
index 7045e6cb88e..00000000000
--- a/source/gameengine/PyDoc/GameTypes.py
+++ /dev/null
@@ -1,6147 +0,0 @@
-"""
-Documentation for the GameTypes Module.
-=======================================
-
-@group Base: PyObjectPlus, CValue, CPropValue, SCA_ILogicBrick, SCA_IObject, SCA_ISensor, SCA_IController, SCA_IActuator
-
-@group Object: KX_GameObject, KX_LightObject, KX_Camera, BL_ArmatureObject
-
-@group Animation: BL_ArmatureConstraint
-
-@group Mesh: KX_MeshProxy, KX_PolyProxy, KX_VertexProxy
-
-@group Shading: KX_PolygonMaterial, KX_BlenderMaterial, BL_Shader
-
-@group Sensors: SCA_ActuatorSensor, SCA_AlwaysSensor, SCA_DelaySensor, SCA_JoystickSensor, SCA_KeyboardSensor, KX_MouseFocusSensor, SCA_MouseSensor, KX_NearSensor, KX_NetworkMessageSensor, SCA_PropertySensor, KX_RadarSensor, SCA_RandomSensor, KX_RaySensor, KX_TouchSensor, KX_ArmatureSensor
-
-@group Actuators: SCA_2DFilterActuator, BL_ActionActuator, BL_ArmatureActuator, KX_SCA_AddObjectActuator, KX_CameraActuator, KX_ConstraintActuator, KX_SCA_DynamicActuator, KX_SCA_EndObjectActuator, KX_GameActuator, KX_IpoActuator, KX_NetworkMessageActuator, KX_ObjectActuator, KX_ParentActuator, SCA_PropertyActuator, SCA_RandomActuator, KX_SCA_ReplaceMeshActuator, KX_SceneActuator, BL_ShapeActionActuator, KX_SoundActuator, KX_StateActuator, KX_TrackToActuator, KX_VisibilityActuator
-
-@group Controllers: SCA_ANDController, SCA_NANDController, SCA_NORController, SCA_ORController, SCA_PythonController, SCA_XNORController, SCA_XORController
-"""
-import GameLogic
-
-class PyObjectPlus:
- """
- PyObjectPlus base class of most other types in the Game Engine.
-
- @ivar invalid: Test if the object has been freed by the game engine and is no longer valid.
-
- Normally this is not a problem but when storing game engine data in the GameLogic module,
- KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data.
- Calling an attribute or method on an invalid object will raise a SystemError.
-
- The invalid attribute allows testing for this case without exception handling.
- @type invalid: bool
- """
-
- def isA(game_type):
- """
- Check if this is a type or a subtype game_type.
-
- @param game_type: the name of the type or the type its self from the L{GameTypes} module.
- @type game_type: string or type
- @return: True if this object is a type or a subtype of game_type.
- @rtype: bool
- """
-
-class CValue(PyObjectPlus):
- """
- This class is a basis for other classes.
- @ivar name: The name of this CValue derived object (read-only).
- @type name: string
- @group Deprecated: getName
- """
- def getName():
- """
- Returns the name of the CValue.
-
- @deprecated: Use the L{name} attribute instead.
- @note: in most cases the CValue's subclasses will override this function.
- @rtype: string
- """
-
-class CPropValue(CValue):
- """
- This class has no python functions
- """
- pass
-
-class SCA_ILogicBrick(CValue):
- """
- Base class for all logic bricks.
-
- @ivar executePriority: This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first).
- @type executePriority: int
- @ivar owner: The game object this logic brick is attached to (read-only).
- @type owner: L{KX_GameObject} or None in exceptional cases.
- @ivar name: The name of this logic brick (read-only).
- @type name: string
- """
-
-#{ Deprecated
- def getOwner():
- """
- Gets the game object associated with this logic brick.
-
- @deprecated: Use the L{owner} attribute instead.
- @rtype: L{KX_GameObject}
- """
-
- def setExecutePriority(priority):
- """
- Sets the priority of this logic brick.
-
- This determines the order controllers are evaluated, and actuators are activated.
- Bricks with lower priority will be executed first.
-
- @deprecated: Use the L{executePriority} attribute instead.
- @type priority: integer
- @param priority: the priority of this logic brick.
- """
- def getExecutePriority():
- """
- Gets the execution priority of this logic brick.
-
- @deprecated: Use the L{executePriority} attribute instead.
- @rtype: integer
- @return: this logic bricks current priority.
- """
-#}
-
-class SCA_IObject(CValue):
- """
- This class has no python functions
- """
- pass
-
-class SCA_ISensor(SCA_ILogicBrick):
- """
- Base class for all sensor logic bricks.
-
- @ivar usePosPulseMode: Flag to turn positive pulse mode on and off.
- @type usePosPulseMode: boolean
- @ivar useNegPulseMode: Flag to turn negative pulse mode on and off.
- @type useNegPulseMode: boolean
- @ivar frequency: The frequency for pulse mode sensors.
- @type frequency: int
- @ivar level: Option whether to detect level or edge transition when entering a state.
- It makes a difference only in case of logic state transition (state actuator).
- A level detector will immediately generate a pulse, negative or positive
- depending on the sensor condition, as soon as the state is activated.
- A edge detector will wait for a state change before generating a pulse.
- note: mutually exclusive with L{tap}, enabling will disable L{tap}.
- @type level: boolean
- @ivar tap: When enabled only sensors that are just activated will send a positive event,
- after this they will be detected as negative by the controllers.
- This will make a key thats held act as if its only tapped for an instant.
- note: mutually exclusive with L{level}, enabling will disable L{level}.
- @type tap: boolean
- @ivar invert: Flag to set if this sensor activates on positive or negative events.
- @type invert: boolean
- @ivar triggered: True if this sensor brick is in a positive state. (read-only)
- @type triggered: boolean
- @ivar positive: True if this sensor brick is in a positive state. (read-only)
- @type positive: boolean
- @ivar status: The status of the sensor. (read-only)
- KX_SENSOR_INACTIVE, KX_SENSOR_JUST_ACTIVATED,
- KX_SENSOR_ACTIVE, KX_SENSOR_JUST_DEACTIVATED
- Note: this convenient attribute combines the values of triggered and positive attributes
- @type status: int from 0-3.
- """
-
- def reset():
- """
- Reset sensor internal state, effect depends on the type of sensor and settings.
-
- The sensor is put in its initial state as if it was just activated.
- """
-#{ Deprecated
- def isPositive():
- """
- True if this sensor brick is in a positive state.
-
- @deprecated: use L{positive}
- """
-
- def isTriggered():
- """
- True if this sensor brick has triggered the current controller.
-
- @deprecated: use L{triggered}
- """
-
- def getUsePosPulseMode():
- """
- True if the sensor is in positive pulse mode.
-
- @deprecated: use L{usePosPulseMode}
- """
- def setUsePosPulseMode(pulse):
- """
- Sets positive pulse mode.
-
- @type pulse: boolean
- @param pulse: If True, will activate positive pulse mode for this sensor.
- @deprecated: use L{usePosPulseMode}
- """
- def getFrequency():
- """
- The frequency for pulse mode sensors.
-
- @rtype: integer
- @return: the pulse frequency in 1/50 sec.
- @deprecated: use L{frequency}
- """
- def setFrequency(freq):
- """
- Sets the frequency for pulse mode sensors.
-
- @type freq: integer
- @return: the pulse frequency in 1/50 sec.
- @deprecated: use L{frequency}
- """
- def getUseNegPulseMode():
- """
- True if the sensor is in negative pulse mode.
-
- @deprecated: use L{useNegPulseMode}
- """
- def setUseNegPulseMode(pulse):
- """
- Sets negative pulse mode.
-
- @type pulse: boolean
- @param pulse: If True, will activate negative pulse mode for this sensor.
- @deprecated: use L{useNegPulseMode}
- """
- def getInvert():
- """
- True if this sensor activates on negative events.
-
- @deprecated: use L{invert}
- """
- def setInvert(invert):
- """
- Sets if this sensor activates on positive or negative events.
-
- @type invert: boolean
- @param invert: true if activates on negative events; false if activates on positive events.
- @deprecated: use L{invert}
- """
- def getLevel():
- """
- Returns whether this sensor is a level detector or a edge detector.
- It makes a difference only in case of logic state transition (state actuator).
- A level detector will immediately generate a pulse, negative or positive
- depending on the sensor condition, as soon as the state is activated.
- A edge detector will wait for a state change before generating a pulse.
-
- @rtype: boolean
- @return: true if sensor is level sensitive, false if it is edge sensitive
- @deprecated: use L{level}
- """
- def setLevel(level):
- """
- Set whether to detect level or edge transition when entering a state.
-
- @param level: Detect level instead of edge? (KX_TRUE, KX_FALSE)
- @type level: boolean
- @deprecated: use L{level}
- """
-#}
-
-class SCA_IController(SCA_ILogicBrick):
- """
- Base class for all controller logic bricks.
-
- @ivar state: the controllers state bitmask.
- This can be used with the GameObject's state to test if the controller is active.
- @type state: int bitmask
- @ivar sensors: a list of sensors linked to this controller
- - note: the sensors are not necessarily owned by the same object.
- - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
- @type sensors: sequence supporting index/string lookups and iteration.
- @ivar actuators: a list of actuators linked to this controller.
- - note: the sensors are not necessarily owned by the same object.
- - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
- @type actuators: sequence supporting index/string lookups and iteration.
- @ivar useHighPriority: When set the controller executes always before all other controllers that dont have this set.
- note: Order of execution between high priority controllers is not guaranteed.
- @type useHighPriority: bool
- """
-#{ Deprecated
- def getState():
- """
- Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active.
- This for instance will always be true however you could compare with a previous state to see when the state was activated.
- GameLogic.getCurrentController().state & GameLogic.getCurrentController().owner.state
- @deprecated: Use the L{state} property
- @rtype: int
- """
- def getSensors():
- """
- Gets a list of all sensors attached to this controller.
- @deprecated: use the L{sensors} property
- @rtype: list [L{SCA_ISensor}]
- """
- def getSensor(name):
- """
- Gets the named linked sensor.
- @deprecated: use the L{sensors}[name] property
- @type name: string
- @rtype: L{SCA_ISensor}
- """
- def getActuators():
- """
- Gets a list of all actuators linked to this controller.
- @deprecated: Use the L{actuators} property
- @rtype: list [L{SCA_IActuator}]
- """
- def getActuator(name):
- """
- Gets the named linked actuator.
- @deprecated: use the L{actuators}[name] property
- @type name: string
- @rtype: L{SCA_IActuator}
- """
-#}
-
-class SCA_IActuator(SCA_ILogicBrick):
- """
- Base class for all actuator logic bricks.
- """
-
-class BL_ActionActuator(SCA_IActuator):
- """
- Action Actuators apply an action to an actor.
-
- @ivar action: The name of the action to set as the current action.
- @type action: string
- @ivar channelNames: A list of channel names that may be used with L{setChannel} and L{getChannel}
- @type channelNames: list of strings
- @ivar frameStart: Specifies the starting frame of the animation.
- @type frameStart: float
- @ivar frameEnd: Specifies the ending frame of the animation.
- @type frameEnd: float
- @ivar blendIn: Specifies the number of frames of animation to generate when making transitions between actions.
- @type blendIn: float
- @ivar priority: Sets the priority of this actuator. Actuators will lower
- priority numbers will override actuators with higher
- numbers.
- @type priority: integer
- @ivar frame: Sets the current frame for the animation.
- @type frame: float
- @ivar propName: Sets the property to be used in FromProp playback mode.
- @type propName: string
- @ivar blendTime: Sets the internal frame timer. This property must be in
- the range from 0.0 to blendIn.
- @type blendTime: float
- @ivar mode: The operation mode of the actuator. KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND
- @type mode: integer
- @ivar useContinue: The actions continue option, True or False.
- When True, the action will always play from where last left off,
- otherwise negative events to this actuator will reset it to its start frame.
- @type useContinue: boolean
- @ivar framePropName: The name of the property that is set to the current frame number.
- @type framePropName: string
- """
- def setChannel(channel, matrix):
- """
- Alternative to the 2 arguments, 4 arguments (channel, matrix, loc, size, quat) are also supported.
-
- @note: These values are relative to the bones rest position, currently the api has no way to get this info (which is annoying), but can be worked around by using bones with a rest pose that has no translation.
- @param channel: A string specifying the name of the bone channel, error raised if not in L{channelNames}.
- @type channel: string
- @param matrix: A 4x4 matrix specifying the overriding transformation
- as an offset from the bone's rest position.
- @type matrix: list [[float]]
- """
-
- def getChannel(channel):
- """
- @param channel: A string specifying the name of the bone channel. error raised if not in L{channelNames}.
- @type channel: string
- @rtype: tuple
- @return: (loc, size, quat)
- """
-
-#{ Deprecated
- def setAction(action, reset = True):
- """
- Sets the current action.
- @deprecated: use the L{action} property
- @param action: The name of the action to set as the current action.
- @type action: string
- @param reset: Optional parameter indicating whether to reset the
- blend timer or not. A value of 1 indicates that the
- timer should be reset. A value of 0 will leave it
- unchanged. If reset is not specified, the timer will
- be reset.
- """
-
- def setStart(start):
- """
- Specifies the starting frame of the animation.
- @deprecated: Use the L{frameStart} property
- @param start: the starting frame of the animation
- @type start: float
- """
-
- def setEnd(end):
- """
- Specifies the ending frame of the animation.
- @deprecated: use the L{frameEnd} property
- @param end: the ending frame of the animation
- @type end: float
- """
- def setBlendin(blendin):
- """
- Specifies the number of frames of animation to generate
- when making transitions between actions.
- @deprecated: use the L{blendIn} property
- @param blendin: the number of frames in transition.
- @type blendin: float
- """
-
- def setPriority(priority):
- """
- Sets the priority of this actuator.
-
- @deprecated: Use use the L{priority} property
- @param priority: Specifies the new priority. Actuators will lower
- priority numbers will override actuators with higher
- numbers.
- @type priority: integer
- """
- def setFrame(frame):
- """
- Sets the current frame for the animation.
-
- @deprecated: use the L{frame} property
- @param frame: Specifies the new current frame for the animation
- @type frame: float
- """
-
- def setProperty(prop):
- """
- Sets the property to be used in FromProp playback mode.
-
- @deprecated: use the L{property} property
- @param prop: the name of the property to use.
- @type prop: string.
- """
-
- def setBlendtime(blendtime):
- """
- Sets the internal frame timer.
-
- Allows the script to directly modify the internal timer
- used when generating transitions between actions.
-
- @deprecated: use the L{blendTime} property
- @param blendtime: The new time. This parameter must be in the range from 0.0 to 1.0.
- @type blendtime: float
- """
-
- def setType(mode):
- """
- Sets the operation mode of the actuator
-
- @deprecated: use the L{type} property
- @param mode: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND
- @type mode: integer
- """
-
- def setContinue(cont):
- """
- Set the actions continue option True or False. see getContinue.
-
- @deprecated: use the L{useContinue} property
- @param cont: The continue option.
- @type cont: bool
- """
-
- def getType():
- """
- Returns the operation mode of the actuator
-
- @deprecated: use the L{type} property
- @rtype: integer
- @return: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND
- """
-
- def getContinue():
- """
- When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame.
-
- @deprecated: use the L{useContinue} property
- @rtype: bool
- """
-
- def getAction():
- """
- getAction() returns the name of the action associated with this actuator.
-
- @deprecated: use the L{action} property
- @rtype: string
- """
-
- def getStart():
- """
- Returns the starting frame of the action.
-
- @deprecated: use the L{frameStart} property
- @rtype: float
- """
- def getEnd():
- """
- Returns the last frame of the action.
-
- @deprecated: use the L{frameEnd} property
- @rtype: float
- """
- def getBlendin():
- """
- Returns the number of interpolation animation frames to be generated when this actuator is triggered.
-
- @deprecated: use the L{blendIn} property
- @rtype: float
- """
- def getPriority():
- """
- Returns the priority for this actuator. Actuators with lower Priority numbers will
- override actuators with higher numbers.
-
- @deprecated: use the L{priority} property
- @rtype: integer
- """
- def getFrame():
- """
- Returns the current frame number.
-
- @deprecated: use the L{frame} property
- @rtype: float
- """
- def getProperty():
- """
- Returns the name of the property to be used in FromProp mode.
-
- @deprecated: use the L{property} property
- @rtype: string
- """
- def setFrameProperty(prop):
- """
- @deprecated: use the L{framePropName} property
- @param prop: A string specifying the property of the object that will be updated with the action frame number.
- @type prop: string
- """
- def getFrameProperty():
- """
- Returns the name of the property that is set to the current frame number.
-
- @deprecated: use the L{framePropName} property
- @rtype: string
- """
-#}
-
-class BL_Shader(PyObjectPlus):
- """
- BL_Shader GLSL shaders.
-
- TODO - Description
- """
-
- def setUniformfv(name, fList):
- """
- Set a uniform with a list of float values
-
- @param name: the uniform name
- @type name: string
-
- @param fList: a list (2, 3 or 4 elements) of float values
- @type fList: list[float]
- """
-
- def delSource():
- """
- Clear the shader. Use this method before the source is changed with L{setSource}.
- """
- def getFragmentProg():
- """
- Returns the fragment program.
-
- @rtype: string
- @return: The fragment program.
- """
- def getVertexProg():
- """
- Get the vertex program.
-
- @rtype: string
- @return: The vertex program.
- """
- def isValid():
- """
- Check if the shader is valid.
-
- @rtype: bool
- @return: True if the shader is valid
- """
- def setAttrib(enum):
- """
- Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.)
-
- @param enum: attribute location value
- @type enum: integer
- """
- def setNumberOfPasses( max_pass ):
- """
- Set the maximum number of passes. Not used a.t.m.
-
- @param max_pass: the maximum number of passes
- @type max_pass: integer
- """
- def setSampler(name, index):
- """
- Set uniform texture sample index.
-
- @param name: Uniform name
- @type name: string
-
- @param index: Texture sample index.
- @type index: integer
- """
- def setSource(vertexProgram, fragmentProgram):
- """
- Set the vertex and fragment programs
-
- @param vertexProgram: Vertex program
- @type vertexProgram: string
-
- @param fragmentProgram: Fragment program
- @type fragmentProgram: string
- """
- def setUniform1f(name, fx):
- """
- Set a uniform with 1 float value.
-
- @param name: the uniform name
- @type name: string
-
- @param fx: Uniform value
- @type fx: float
- """
- def setUniform1i(name, ix):
- """
- Set a uniform with an integer value.
-
- @param name: the uniform name
- @type name: string
-
- @param ix: the uniform value
- @type ix: integer
- """
- def setUniform2f(name, fx, fy):
- """
- Set a uniform with 2 float values
-
- @param name: the uniform name
- @type name: string
-
- @param fx: first float value
- @type fx: float
-
- @param fy: second float value
- @type fy: float
- """
- def setUniform2i(name, ix, iy):
- """
- Set a uniform with 2 integer values
-
- @param name: the uniform name
- @type name: string
-
- @param ix: first integer value
- @type ix: integer
-
- @param iy: second integer value
- @type iy: integer
- """
- def setUniform3f(name, fx,fy,fz):
- """
- Set a uniform with 3 float values.
-
- @param name: the uniform name
- @type name: string
-
- @param fx: first float value
- @type fx: float
-
- @param fy: second float value
- @type fy: float
-
- @param fz: third float value
- @type fz: float
- """
- def setUniform3i(name, ix,iy,iz):
- """
- Set a uniform with 3 integer values
-
- @param name: the uniform name
- @type name: string
-
- @param ix: first integer value
- @type ix: integer
-
- @param iy: second integer value
- @type iy: integer
-
- @param iz: third integer value
- @type iz: integer
- """
- def setUniform4f(name, fx,fy,fz,fw):
- """
- Set a uniform with 4 float values.
-
- @param name: the uniform name
- @type name: string
-
- @param fx: first float value
- @type fx: float
-
- @param fy: second float value
- @type fy: float
-
- @param fz: third float value
- @type fz: float
-
- @param fw: fourth float value
- @type fw: float
- """
- def setUniform4i(name, ix,iy,iz, iw):
- """
- Set a uniform with 4 integer values
-
- @param name: the uniform name
- @type name: string
-
- @param ix: first integer value
- @type ix: integer
-
- @param iy: second integer value
- @type iy: integer
-
- @param iz: third integer value
- @type iz: integer
-
- @param iw: fourth integer value
- @type iw: integer
- """
- def setUniformDef(name, type):
- """
- Define a new uniform
-
- @param name: the uniform name
- @type name: string
-
- @param type: uniform type
- @type type: UNI_NONE, UNI_INT, UNI_FLOAT, UNI_INT2, UNI_FLOAT2, UNI_INT3, UNI_FLOAT3, UNI_INT4, UNI_FLOAT4, UNI_MAT3, UNI_MAT4, UNI_MAX
- """
- def setUniformMatrix3(name, mat, transpose):
- """
- Set a uniform with a 3x3 matrix value
-
- @param name: the uniform name
- @type name: string
-
- @param mat: A 3x3 matrix [[f,f,f], [f,f,f], [f,f,f]]
- @type mat: 3x3 matrix
-
- @param transpose: set to True to transpose the matrix
- @type transpose: bool
- """
- def setUniformMatrix4(name, mat, transpose):
- """
- Set a uniform with a 4x4 matrix value
-
- @param name: the uniform name
- @type name: string
-
- @param mat: A 4x4 matrix [[f,f,f,f], [f,f,f,f], [f,f,f,f], [f,f,f,f]]
- @type mat: 4x4 matrix
-
- @param transpose: set to True to transpose the matrix
- @type transpose: bool
- """
- def setUniformiv(name, iList):
- """
- Set a uniform with a list of integer values
-
- @param name: the uniform name
- @type name: string
-
- @param iList: a list (2, 3 or 4 elements) of integer values
- @type iList: list[integer]
- """
- def validate():
- """
- Validate the shader object.
-
- """
-
-class BL_ShapeActionActuator(SCA_IActuator):
- """
- ShapeAction Actuators apply an shape action to an mesh object.\
-
- @ivar action: The name of the action to set as the current shape action.
- @type action: string
- @ivar frameStart: Specifies the starting frame of the shape animation.
- @type frameStart: float
- @ivar frameEnd: Specifies the ending frame of the shape animation.
- @type frameEnd: float
- @ivar blendIn: Specifies the number of frames of animation to generate when making transitions between actions.
- @type blendIn: float
- @ivar priority: Sets the priority of this actuator. Actuators will lower
- priority numbers will override actuators with higher
- numbers.
- @type priority: integer
- @ivar frame: Sets the current frame for the animation.
- @type frame: float
- @ivar propName: Sets the property to be used in FromProp playback mode.
- @type propName: string
- @ivar blendTime: Sets the internal frame timer. This property must be in
- the range from 0.0 to blendin.
- @type blendTime: float
- @ivar mode: The operation mode of the actuator.
- KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER,
- KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND
- @type mode: integer
- @ivar framePropName: The name of the property that is set to the current frame number.
- @type framePropName: string
-
- """
-#{ Deprecated
- def setAction(action, reset = True):
- """
- Sets the current action.
-
- @deprecated: use the L{action} property
- @param action: The name of the action to set as the current action.
- @type action: string
- @param reset: Optional parameter indicating whether to reset the
- blend timer or not. A value of 1 indicates that the
- timer should be reset. A value of 0 will leave it
- unchanged. If reset is not specified, the timer will
- be reset.
- """
-
- def setStart(start):
- """
- Specifies the starting frame of the animation.
-
- @deprecated: use the L{frameStart} property
- @param start: the starting frame of the animation
- @type start: float
- """
-
- def setEnd(end):
- """
- Specifies the ending frame of the animation.
-
- @deprecated: use the L{frameEnd} property
- @param end: the ending frame of the animation
- @type end: float
- """
- def setBlendin(blendin):
- """
- Specifies the number of frames of animation to generate
- when making transitions between actions.
-
- @deprecated: use the L{blendIn} property
- @param blendin: the number of frames in transition.
- @type blendin: float
- """
-
- def setPriority(priority):
- """
- Sets the priority of this actuator.
-
- @deprecated: use the L{priority} property
- @param priority: Specifies the new priority. Actuators will lower
- priority numbers will override actuators with higher
- numbers.
- @type priority: integer
- """
- def setFrame(frame):
- """
- Sets the current frame for the animation.
-
- @deprecated: use the L{frame} property
- @param frame: Specifies the new current frame for the animation
- @type frame: float
- """
-
- def setProperty(prop):
- """
- Sets the property to be used in FromProp playback mode.
-
- @deprecated: use the L{property} property
- @param prop: the name of the property to use.
- @type prop: string.
- """
-
- def setBlendtime(blendtime):
- """
- Sets the internal frame timer.
-
- Allows the script to directly modify the internal timer
- used when generating transitions between actions.
-
- @deprecated: use the L{blendTime} property
- @param blendtime: The new time. This parameter must be in the range from 0.0 to 1.0.
- @type blendtime: float
- """
-
- def setType(mode):
- """
- Sets the operation mode of the actuator
-
- @deprecated: use the L{type} property
- @param mode: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND
- @type mode: integer
- """
-
- def getType():
- """
- Returns the operation mode of the actuator
-
- @deprecated: use the L{type} property
- @rtype: integer
- @return: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND
- """
-
- def getAction():
- """
- getAction() returns the name of the action associated with this actuator.
-
- @deprecated: use the L{action} property
- @rtype: string
- """
-
- def getStart():
- """
- Returns the starting frame of the action.
-
- @deprecated: use the L{frameStart} property
- @rtype: float
- """
- def getEnd():
- """
- Returns the last frame of the action.
-
- @deprecated: use the L{frameEnd} property
- @rtype: float
- """
- def getBlendin():
- """
- Returns the number of interpolation animation frames to be generated when this actuator is triggered.
-
- @deprecated: use the L{blendIn} property
- @rtype: float
- """
- def getPriority():
- """
- Returns the priority for this actuator. Actuators with lower Priority numbers will
- override actuators with higher numbers.
-
- @deprecated: use the L{priority} property
- @rtype: integer
- """
- def getFrame():
- """
- Returns the current frame number.
-
- @deprecated: use the L{frame} property
- @rtype: float
- """
- def getProperty():
- """
- Returns the name of the property to be used in FromProp mode.
-
- @deprecated: use the L{property} property
- @rtype: string
- """
- def setFrameProperty(prop):
- """
- @deprecated: use the L{framePropName} property
- @param prop: A string specifying the property of the object that will be updated with the action frame number.
- @type prop: string
- """
- def getFrameProperty():
- """
- Returns the name of the property that is set to the current frame number.
-
- @deprecated: use the L{framePropName} property
- @rtype: string
- """
-#}
-
-class CListValue(CPropValue):
- """
- CListValue
-
- This is a list like object used in the game engine internally that behaves similar to a python list in most ways.
-
- As well as the normal index lookup.
- C{val= clist[i]}
-
- CListValue supports string lookups.
- C{val= scene.objects["Cube"]}
-
- Other operations such as C{len(clist), list(clist), clist[0:10]} are also supported.
- """
- def append(val):
- """
- Add an item to the list (like pythons append)
-
- Warning: Appending values to the list can cause crashes when the list is used internally by the game engine.
- """
-
- def count(val):
- """
- Count the number of instances of a value in the list.
-
- @rtype: integer
- @return: number of instances
- """
- def index(val):
- """
- Return the index of a value in the list.
-
- @rtype: integer
- @return: The index of the value in the list.
- """
- def reverse():
- """
- Reverse the order of the list.
- """
- def get(key, default=None):
- """
- Return the value matching key, or the default value if its not found.
- @return: The key value or a default.
- """
- def from_id(id):
- """
- This is a funtion especially for the game engine to return a value with a spesific id.
-
- Since object names are not always unique, the id of an object can be used to get an object from the CValueList.
-
- Example.
-
- C{myObID = id(gameObject)}
-
- C{...}
-
- C{ob= scene.objects.from_id(myObID)}
-
- Where myObID is an int or long from the id function.
-
- This has the advantage that you can store the id in places you could not store a gameObject.
-
- Warning: the id is derived from a memory location and will be different each time the game engine starts.
- """
-
-class KX_BlenderMaterial(PyObjectPlus): # , RAS_IPolyMaterial)
- """
- KX_BlenderMaterial
-
- """
-
- def getShader():
- """
- Returns the material's shader.
-
- @rtype: L{BL_Shader}
- @return: the material's shader
- """
-
- def setBlending(src, dest):
- """
- Set the pixel color arithmetic functions.
-
- @param src: Specifies how the red, green, blue,
- and alpha source blending factors are computed.
- @type src: GL_ZERO,
- GL_ONE,
- GL_SRC_COLOR,
- GL_ONE_MINUS_SRC_COLOR,
- GL_DST_COLOR,
- GL_ONE_MINUS_DST_COLOR,
- GL_SRC_ALPHA,
- GL_ONE_MINUS_SRC_ALPHA,
- GL_DST_ALPHA,
- GL_ONE_MINUS_DST_ALPHA,
- GL_SRC_ALPHA_SATURATE
-
-
- @param dest: Specifies how the red, green, blue,
- and alpha destination blending factors are computed.
- @type dest: GL_ZERO,
- GL_ONE,
- GL_SRC_COLOR,
- GL_ONE_MINUS_SRC_COLOR,
- GL_DST_COLOR,
- GL_ONE_MINUS_DST_COLOR,
- GL_SRC_ALPHA,
- GL_ONE_MINUS_SRC_ALPHA,
- GL_DST_ALPHA,
- GL_ONE_MINUS_DST_ALPHA,
- GL_SRC_ALPHA_SATURATE
-
- """
- def getMaterialIndex():
- """
- Returns the material's index.
-
- @rtype: integer
- @return: the material's index
- """
-
-class KX_CameraActuator(SCA_IActuator):
- """
- Applies changes to a camera.
-
- @ivar min: minimum distance to the target object maintained by the actuator
- @type min: float
- @ivar max: maximum distance to stay from the target object
- @type max: float
- @ivar height: height to stay above the target object
- @type height: float
- @ivar useXY: axis this actuator is tracking, true=X, false=Y
- @type useXY: boolean
- @ivar object: the object this actuator tracks.
- @type object: L{KX_GameObject} or None
- @author: snail
- """
-#{ Deprecated
- def getObject(name_only = 1):
- """
- Returns the name of the object this actuator tracks.
-
- @deprecated: Use the L{object} attribute instead.
- @type name_only: bool
- @param name_only: optional argument, when 0 return a KX_GameObject
- @rtype: string, L{KX_GameObject} or None if no object is set
- """
-
- def setObject(target):
- """
- Sets the object this actuator tracks.
-
- @deprecated: Use the L{object} attribute instead.
- @param target: the object to track.
- @type target: L{KX_GameObject}, string or None
- """
-
- def getMin():
- """
- Returns the minimum distance to target maintained by the actuator.
-
- @deprecated: Use the L{min} attribute instead.
- @rtype: float
- """
-
- def setMin(distance):
- """
- Sets the minimum distance to the target object maintained by the
- actuator.
-
- @deprecated: Use the L{min} attribute instead.
- @param distance: The minimum distance to maintain.
- @type distance: float
- """
-
- def getMax():
- """
- Gets the maximum distance to stay from the target object.
-
- @deprecated: Use the L{max} attribute instead.
- @rtype: float
- """
-
- def setMax(distance):
- """
- Sets the maximum distance to stay from the target object.
-
- @deprecated: Use the L{max} attribute instead.
- @param distance: The maximum distance to maintain.
- @type distance: float
- """
-
- def getHeight():
- """
- Returns the height to stay above the target object.
-
- @deprecated: Use the L{height} attribute instead.
- @rtype: float
- """
-
- def setHeight(height):
- """
- Sets the height to stay above the target object.
-
- @deprecated: Use the L{height} attribute instead.
- @type height: float
- @param height: The height to stay above the target object.
- """
-
- def setXY(xaxis):
- """
- Sets the axis to get behind.
-
- @deprecated: Use the L{useXY} attribute instead.
- @param xaxis: False to track Y axis, True to track X axis.
- @type xaxis: boolean
- """
-
- def getXY():
- """
- Returns the axis this actuator is tracking.
-
- @deprecated: Use the L{useXY} attribute instead.
- @return: True if tracking X axis, False if tracking Y axis.
- @rtype: boolean
- """
-#}
-
-class KX_ConstraintActuator(SCA_IActuator):
- """
- A constraint actuator limits the position, rotation, distance or orientation of an object.
-
- Properties:
-
- @ivar damp: time constant of the constraint expressed in frame (not use by Force field constraint)
- @type damp: integer
-
- @ivar rotDamp: time constant for the rotation expressed in frame (only for the distance constraint)
- 0 = use damp for rotation as well
- @type rotDamp: integer
-
- @ivar direction: the reference direction in world coordinate for the orientation constraint
- @type direction: 3-tuple of float: [x,y,z]
-
- @ivar option: Binary combination of the following values:
- Applicable to Distance constraint:
- - KX_ACT_CONSTRAINT_NORMAL ( 64) : Activate alignment to surface
- - KX_ACT_CONSTRAINT_DISTANCE ( 512) : Activate distance control
- - KX_ACT_CONSTRAINT_LOCAL (1024) : direction of the ray is along the local axis
- Applicable to Force field constraint:
- - KX_ACT_CONSTRAINT_DOROTFH (2048) : Force field act on rotation as well
- Applicable to both:
- - KX_ACT_CONSTRAINT_MATERIAL ( 128) : Detect material rather than property
- - KX_ACT_CONSTRAINT_PERMANENT ( 256) : No deactivation if ray does not hit target
- @type option: integer
-
- @ivar time: activation time of the actuator. The actuator disables itself after this many frame.
- If set to 0, the actuator is not limited in time.
- @type time: integer
-
- @ivar propName: the name of the property or material for the ray detection of the distance constraint.
- @type propName: string
-
- @ivar min: The lower bound of the constraint
- For the rotation and orientation constraint, it represents radiant
- @type min: float
-
- @ivar distance: the target distance of the distance constraint
- @type distance: float
-
- @ivar max: the upper bound of the constraint.
- For rotation and orientation constraints, it represents radiant.
- @type max: float
-
- @ivar rayLength: the length of the ray of the distance constraint.
- @type rayLength: float
-
- @ivar limit: type of constraint, use one of the following constant:
- KX_ACT_CONSTRAINT_LOCX ( 1) : limit X coord
- KX_ACT_CONSTRAINT_LOCY ( 2) : limit Y coord
- KX_ACT_CONSTRAINT_LOCZ ( 3) : limit Z coord
- KX_ACT_CONSTRAINT_ROTX ( 4) : limit X rotation
- KX_ACT_CONSTRAINT_ROTY ( 5) : limit Y rotation
- KX_ACT_CONSTRAINT_ROTZ ( 6) : limit Z rotation
- KX_ACT_CONSTRAINT_DIRPX ( 7) : set distance along positive X axis
- KX_ACT_CONSTRAINT_DIRPY ( 8) : set distance along positive Y axis
- KX_ACT_CONSTRAINT_DIRPZ ( 9) : set distance along positive Z axis
- KX_ACT_CONSTRAINT_DIRNX (10) : set distance along negative X axis
- KX_ACT_CONSTRAINT_DIRNY (11) : set distance along negative Y axis
- KX_ACT_CONSTRAINT_DIRNZ (12) : set distance along negative Z axis
- KX_ACT_CONSTRAINT_ORIX (13) : set orientation of X axis
- KX_ACT_CONSTRAINT_ORIY (14) : set orientation of Y axis
- KX_ACT_CONSTRAINT_ORIZ (15) : set orientation of Z axis
- KX_ACT_CONSTRAINT_FHPX (16) : set force field along positive X axis
- KX_ACT_CONSTRAINT_FHPY (17) : set force field along positive Y axis
- KX_ACT_CONSTRAINT_FHPZ (18) : set force field along positive Z axis
- KX_ACT_CONSTRAINT_FHNX (19) : set force field along negative X axis
- KX_ACT_CONSTRAINT_FHNY (20) : set force field along negative Y axis
- KX_ACT_CONSTRAINT_FHNZ (21) : set force field along negative Z axis
- @type limit: integer
- """
-#{ Deprecated
- def setDamp(time):
- """
- Sets the time this constraint is delayed.
-
- @param time: The number of frames to delay.
- Negative values are ignored.
- @type time: integer
- """
- def getDamp():
- """
- Returns the damping time of the constraint.
-
- @rtype: integer
- """
- def setMin(lower):
- """
- Sets the lower bound of the constraint.
-
- For rotational and orientation constraints, lower is specified in degrees.
-
- @type lower: float
- """
- def getMin():
- """
- Gets the lower bound of the constraint.
-
- For rotational and orientation constraints, the lower bound is returned in radians.
-
- @rtype: float
- """
- def setMax(upper):
- """
- Sets the upper bound of the constraint.
-
- For rotational and orientation constraints, upper is specified in degrees.
-
- @type upper: float
- """
- def getMax():
- """
- Gets the upper bound of the constraint.
-
- For rotational and orientation constraints, the upper bound is returned in radians.
-
- @rtype: float
- """
- def setLimit(limit):
- """
- Sets the type of constraint.
-
- See module L{GameLogic} for valid constraint types.
-
- @param limit:
- Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ
- Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY or KX_CONSTRAINTACT_ROTZ
- Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ
- Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ
- """
- def getLimit():
- """
- Gets the type of constraint.
-
- See module L{GameLogic} for valid constraints.
-
- @return:
- Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ,
- Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY, KX_CONSTRAINTACT_ROTZ,
- Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ,
- Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ
- """
- def setRotDamp(duration):
- """
- Sets the time constant of the orientation constraint.
-
- @param duration: If the duration is negative, it is set to 0.
- @type duration: integer
- """
- def getRotDamp():
- """
- Returns the damping time for application of the constraint.
-
- @rtype: integer
- """
- def setDirection(vector):
- """
- Sets the reference direction in world coordinate for the orientation constraint
-
- @type vector: 3-tuple
- """
- def getDirection():
- """
- Returns the reference direction of the orientation constraint in world coordinate.
-
- @rtype: 3-tuple
- """
- def setOption(option):
- """
- Sets several options of the distance constraint.
-
- @type option: integer
- @param option: Binary combination of the following values:
- 64 : Activate alignment to surface
- 128 : Detect material rather than property
- 256 : No deactivation if ray does not hit target
- 512 : Activate distance control
- """
- def getOption():
- """
- Returns the option parameter.
-
- @rtype: integer
- """
- def setTime(duration):
- """
- Sets the activation time of the actuator.
-
- @type duration: integer
- @param duration: The actuator disables itself after this many frame.
- If set to 0 or negative, the actuator is not limited in time.
- """
- def getTime():
- """
- Returns the time parameter.
-
- @rtype: integer
- """
- def setProperty(property):
- """
- Sets the name of the property or material for the ray detection of the distance constraint.
-
- @type property: string
- @param property: If empty, the ray will detect any collisioning object.
- """
- def getProperty():
- """
- Returns the property parameter.
-
- @rtype: string
- """
- def setDistance(distance):
- """
- Sets the target distance in distance constraint.
-
- @type distance: float
- """
- def getDistance():
- """
- Returns the distance parameter.
-
- @rtype: float
- """
- def setRayLength(length):
- """
- Sets the maximum ray length of the distance constraint.
-
- @type length: float
- """
- def getRayLength():
- """
- Returns the length of the ray
-
- @rtype: float
- """
-#}
-
-class KX_ConstraintWrapper(PyObjectPlus):
- """
- KX_ConstraintWrapper
-
- """
- def getConstraintId(val):
- """
- Returns the contraint's ID
-
- @rtype: integer
- @return: the constraint's ID
- """
-
-class KX_GameActuator(SCA_IActuator):
- """
- The game actuator loads a new .blend file, restarts the current .blend file or quits the game.
-
- Properties:
-
- @ivar fileName: the new .blend file to load
- @type fileName: string.
- @ivar mode: The mode of this actuator
- @type mode: Constant in...
- - L{GameLogic.KX_GAME_LOAD}
- - L{GameLogic.KX_GAME_START}
- - L{GameLogic.KX_GAME_RESTART}
- - L{GameLogic.KX_GAME_QUIT}
- - L{GameLogic.KX_GAME_SAVECFG}
- - L{GameLogic.KX_GAME_LOADCFG}
- """
-#{ Deprecated
- def getFile():
- """
- Returns the filename of the new .blend file to load.
-
- @deprecated: use the L{fileName} property
- @rtype: string
- """
- def setFile(filename):
- """
- Sets the new .blend file to load.
-
- @deprecated: use the L{fileName} property
- @param filename: The file name this actuator will load.
- @type filename: string
- """
-#}
-
-class KX_GameObject(SCA_IObject):
- """
- All game objects are derived from this class.
-
- Properties assigned to game objects are accessible as attributes of this class.
- - note: Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, if an object may have been removed since last accessing it use the L{invalid} attribute to check.
-
- @ivar name: The object's name. (read-only)
- @type name: string.
- @ivar mass: The object's mass
- - note: The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0
- @type mass: float
- @ivar linVelocityMin: Enforces the object keeps moving at a minimum velocity.
- - note: Applies to dynamic and rigid body objects only.
- - note: A value of 0.0 disables this option.
- - note: While objects are stationary the minimum velocity will not be applied.
- @type linVelocityMin: float
- @ivar linVelocityMax: Clamp the maximum linear velocity to prevent objects moving beyond a set speed.
- - note: Applies to dynamic and rigid body objects only.
- - note: A value of 0.0 disables this option (rather then setting it stationary).
- @type linVelocityMax: float
- @ivar localInertia: the object's inertia vector in local coordinates. Read only.
- @type localInertia: list [ix, iy, iz]
- @ivar parent: The object's parent object. (read-only)
- @type parent: L{KX_GameObject} or None
- @ivar visible: visibility flag.
- - note: Game logic will still run for invisible objects.
- @type visible: boolean
- @ivar color: The object color of the object
- @type color: list [r, g, b, a]
- @ivar occlusion: occlusion capability flag.
- @type occlusion: boolean
- @ivar position: The object's position.
-
- deprecated: use L{localPosition} and L{worldPosition}
- @type position: list [x, y, z] On write: local position, on read: world position
- @ivar orientation: The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector.
-
- deprecated: use L{localOrientation} and L{worldOrientation}
- @type orientation: 3x3 Matrix [[float]] On write: local orientation, on read: world orientation
- @ivar scaling: The object's scaling factor. list [sx, sy, sz]
-
- deprecated: use L{localScale} and L{worldScale}
- @type scaling: list [sx, sy, sz] On write: local scaling, on read: world scaling
- @ivar localOrientation: The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector.
- @type localOrientation: 3x3 Matrix [[float]]
- @ivar worldOrientation: The object's world orientation.
- @type worldOrientation: 3x3 Matrix [[float]]
- @ivar localScale: The object's local scaling factor.
- @type localScale: list [sx, sy, sz]
- @ivar worldScale: The object's world scaling factor. Read-only
- @type worldScale: list [sx, sy, sz]
- @ivar localPosition: The object's local position.
- @type localPosition: list [x, y, z]
- @ivar worldPosition: The object's world position.
- @type worldPosition: list [x, y, z]
- @ivar timeOffset: adjust the slowparent delay at runtime.
- @type timeOffset: float
- @ivar state: the game object's state bitmask, using the first 30 bits, one bit must always be set.
- @type state: int
- @ivar meshes: a list meshes for this object.
- - note: Most objects use only 1 mesh.
- - note: Changes to this list will not update the KX_GameObject.
- @type meshes: list of L{KX_MeshProxy}
- @ivar sensors: a sequence of L{SCA_ISensor} objects with string/index lookups and iterator support.
- - note: This attribute is experemental and may be removed (but probably wont be).
- - note: Changes to this list will not update the KX_GameObject.
- @type sensors: list
- @ivar controllers: a sequence of L{SCA_IController} objects with string/index lookups and iterator support.
- - note: This attribute is experemental and may be removed (but probably wont be).
- - note: Changes to this list will not update the KX_GameObject.
- @type controllers: list of L{SCA_ISensor}.
- @ivar actuators: a list of L{SCA_IActuator} with string/index lookups and iterator support.
- - note: This attribute is experemental and may be removed (but probably wont be).
- - note: Changes to this list will not update the KX_GameObject.
- @type actuators: list
- @ivar attrDict: get the objects internal python attribute dictionary for direct (faster) access.
- @type attrDict: dict
- @ivar children: direct children of this object, (read-only).
- @type children: L{CListValue} of L{KX_GameObject}'s
- @ivar childrenRecursive: all children of this object including childrens children, (read-only).
- @type childrenRecursive: L{CListValue} of L{KX_GameObject}'s
- @group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh, getChildren, getChildrenRecursive
- @group Property Access: get, attrDict, getPropertyNames
- """
- def endObject():
- """
- Delete this object, can be used in place of the EndObject Actuator.
- The actual removal of the object from the scene is delayed.
- """
- def replaceMesh(mesh, useDisplayMesh=True, usePhysicsMesh=False):
- """
- Replace the mesh of this object with a new mesh. This works the same was as the actuator.
- @type mesh: L{KX_MeshProxy} or mesh name
- @type useDisplayMesh: bool
- @param useDisplayMesh: when enabled the display mesh will be replaced (optional argument).
- @type usePhysicsMesh: bool
- @param usePhysicsMesh: when enabled the physics mesh will be replaced (optional argument).
- """
- def getVisible():
- """
- Gets the game object's visible flag.
-
- @deprecated: use L{visible}
- @rtype: boolean
- """
- def setVisible(visible, recursive):
- """
- Sets the game object's visible flag.
-
- @type visible: boolean
- @type recursive: boolean
- @param recursive: optional argument to set all childrens visibility flag too.
- """
- def setOcclusion(occlusion, recursive):
- """
- Sets the game object's occlusion capability.
-
- @type occlusion: boolean
- @type recursive: boolean
- @param recursive: optional argument to set all childrens occlusion flag too.
- """
- def getState():
- """
- Gets the game object's state bitmask.
-
- @deprecated: use L{state}
- @rtype: int
- @return: the objects state.
- """
- def setState(state):
- """
- Sets the game object's state flag.
- The bitmasks for states from 1 to 30 can be set with (1<<0, 1<<1, 1<<2 ... 1<<29)
- @deprecated: use L{state}
- @type state: integer
- """
- def setPosition(pos):
- """
- Sets the game object's position.
- Global coordinates for root object, local for child objects.
-
- @deprecated: use L{localPosition}
- @type pos: [x, y, z]
- @param pos: the new position, in local coordinates.
- """
- def setWorldPosition(pos):
- """
- Sets the game object's position in world coordinates regardless if the object is root or child.
-
- @deprecated: use L{worldPosition}
- @type pos: [x, y, z]
- @param pos: the new position, in world coordinates.
- """
- def getPosition():
- """
- Gets the game object's position.
-
- @deprecated: use L{worldPosition}
- @rtype: list [x, y, z]
- @return: the object's position in world coordinates.
- """
- def setOrientation(orn):
- """
- Sets the game object's orientation.
-
- @deprecated: use L{localOrientation}
- @type orn: 3x3 rotation matrix, or Quaternion.
- @param orn: a rotation matrix specifying the new rotation.
- @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed.
- """
- def alignAxisToVect(vect, axis, factor):
- """
- Aligns any of the game object's axis along the given vector.
-
- @type vect: 3d vector.
- @param vect: a vector to align the axis.
- @type axis: integer.
- @param axis:The axis you want to align
- - 0: X axis
- - 1: Y axis
- - 2: Z axis (default)
- @type factor: float
- @param factor: Only rotate a feaction of the distance to the target vector (0.0 - 1.0)
- """
- def getAxisVect(vect):
- """
- Returns the axis vector rotates by the objects worldspace orientation.
- This is the equivalent of multiplying the vector by the orientation matrix.
-
- @type vect: 3d vector.
- @param vect: a vector to align the axis.
- @rtype: 3d vector.
- @return: The vector in relation to the objects rotation.
-
- """
- def getOrientation():
- """
- Gets the game object's orientation.
-
- @deprecated: use L{worldOrientation}
- @rtype: 3x3 rotation matrix
- @return: The game object's rotation matrix
- @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed.
- """
- def applyMovement(movement, local = 0):
- """
- Sets the game object's movement.
-
- @type movement: 3d vector.
- @param movement: movement vector.
- @type local: boolean
- @param local: - False: you get the "global" movement ie: relative to world orientation (default).
- - True: you get the "local" movement ie: relative to object orientation.
- """
- def applyRotation(rotation, local = 0):
- """
- Sets the game object's rotation.
-
- @type rotation: 3d vector.
- @param rotation: rotation vector.
- @type local: boolean
- @param local: - False: you get the "global" rotation ie: relative to world orientation (default).
- - True: you get the "local" rotation ie: relative to object orientation.
- """
- def applyForce(force, local = 0):
- """
- Sets the game object's force.
-
- This requires a dynamic object.
-
- @type force: 3d vector.
- @param force: force vector.
- @type local: boolean
- @param local: - False: you get the "global" force ie: relative to world orientation (default).
- - True: you get the "local" force ie: relative to object orientation.
- """
- def applyTorque(torque, local = 0):
- """
- Sets the game object's torque.
-
- This requires a dynamic object.
-
- @type torque: 3d vector.
- @param torque: torque vector.
- @type local: boolean
- @param local: - False: you get the "global" torque ie: relative to world orientation (default).
- - True: you get the "local" torque ie: relative to object orientation.
- """
- def getLinearVelocity(local = 0):
- """
- Gets the game object's linear velocity.
-
- This method returns the game object's velocity through it's centre of mass,
- ie no angular velocity component.
-
- @type local: boolean
- @param local: - False: you get the "global" velocity ie: relative to world orientation (default).
- - True: you get the "local" velocity ie: relative to object orientation.
- @rtype: list [vx, vy, vz]
- @return: the object's linear velocity.
- """
- def setLinearVelocity(velocity, local = 0):
- """
- Sets the game object's linear velocity.
-
- This method sets game object's velocity through it's centre of mass,
- ie no angular velocity component.
-
- This requires a dynamic object.
-
- @type velocity: 3d vector.
- @param velocity: linear velocity vector.
- @type local: boolean
- @param local: - False: you get the "global" velocity ie: relative to world orientation (default).
- - True: you get the "local" velocity ie: relative to object orientation.
- """
- def getAngularVelocity(local = 0):
- """
- Gets the game object's angular velocity.
-
- @type local: boolean
- @param local: - False: you get the "global" velocity ie: relative to world orientation (default).
- - True: you get the "local" velocity ie: relative to object orientation.
- @rtype: list [vx, vy, vz]
- @return: the object's angular velocity.
- """
- def setAngularVelocity(velocity, local = 0):
- """
- Sets the game object's angular velocity.
-
- This requires a dynamic object.
-
- @type velocity: 3d vector.
- @param velocity: angular velocity vector.
- @type local: boolean
- @param local: - False: you get the "global" velocity ie: relative to world orientation (default).
- - True: you get the "local" velocity ie: relative to object orientation.
- """
- def getVelocity(point):
- """
- Gets the game object's velocity at the specified point.
-
- Gets the game object's velocity at the specified point, including angular
- components.
-
- @type point: list [x, y, z]
- @param point: the point to return the velocity for, in local coordinates. (optional: default = [0, 0, 0])
- @rtype: list [vx, vy, vz]
- @return: the velocity at the specified point.
- """
- def getMass():
- """
- Gets the game object's mass.
-
- @deprecated: use L{mass}
- @rtype: float
- @return: the object's mass.
- """
- def getReactionForce():
- """
- Gets the game object's reaction force.
-
- The reaction force is the force applied to this object over the last simulation timestep.
- This also includes impulses, eg from collisions.
-
- (B{This is not implimented for bullet physics at the moment})
-
- @rtype: list [fx, fy, fz]
- @return: the reaction force of this object.
- """
- def applyImpulse(point, impulse):
- """
- Applies an impulse to the game object.
-
- This will apply the specified impulse to the game object at the specified point.
- If point != getPosition(), applyImpulse will also change the object's angular momentum.
- Otherwise, only linear momentum will change.
-
- @type point: list [x, y, z]
- @param point: the point to apply the impulse to (in world coordinates)
- """
- def suspendDynamics():
- """
- Suspends physics for this object.
- """
- def restoreDynamics():
- """
- Resumes physics for this object.
- @Note: The objects linear velocity will be applied from when the dynamics were suspended.
- """
- def enableRigidBody():
- """
- Enables rigid body physics for this object.
-
- Rigid body physics allows the object to roll on collisions.
- @Note: This is not working with bullet physics yet.
- """
- def disableRigidBody():
- """
- Disables rigid body physics for this object.
- @Note: This is not working with bullet physics yet. The angular is removed but rigid body physics can still rotate it later.
- """
- def getParent():
- """
- Gets this object's parent.
-
- @deprecated: use L{parent}
- @rtype: L{KX_GameObject}
- @return: this object's parent object, or None if this object has no parent.
- """
- def setParent(parent,compound,ghost):
- """
- Sets this object's parent.
- Control the shape status with the optional compound and ghost parameters:
- compound=1: the object shape should be added to the parent compound shape (default)
- compound=0: the object should keep its individual shape.
- In that case you can control if it should be ghost or not:
- ghost=1 if the object should be made ghost while parented (default)
- ghost=0 if the object should be solid while parented
- Note: if the object type is sensor, it stays ghost regardless of ghost parameter
-
- @type parent: L{KX_GameObject}
- @param parent: new parent object.
- @type compound: int
- @param compound: whether the shape should be added to the parent compound shape
- @type ghost: int
- @param ghost: whether the object should be ghost while parented
- """
- def removeParent():
- """
- Removes this objects parent.
- """
- def getChildren():
- """
- Return a list of immediate children of this object.
- @rtype: L{CListValue} of L{KX_GameObject}
- @return: a list of all this objects children.
- """
- def getChildrenRecursive():
- """
- Return a list of children of this object, including all their childrens children.
- @rtype: L{CListValue} of L{KX_GameObject}
- @return: a list of all this objects children recursivly.
- """
- def getMesh(mesh):
- """
- Gets the mesh object for this object.
-
- @type mesh: integer
- @param mesh: the mesh object to return (optional: default mesh = 0)
- @rtype: L{KX_MeshProxy}
- @return: the first mesh object associated with this game object, or None if this object has no meshs.
- """
- def getPhysicsId():
- """
- Returns the user data object associated with this game object's physics controller.
- """
- def getPropertyNames():
- """
- Gets a list of all property names.
- @rtype: list
- @return: All property names for this object.
- """
- def getDistanceTo(other):
- """
- Returns the distance to another object or point.
-
- @param other: a point or another L{KX_GameObject} to measure the distance to.
- @type other: L{KX_GameObject} or list [x, y, z]
- @rtype: float
- """
- def getVectTo(other):
- """
- Returns the vector and the distance to another object or point.
- The vector is normalized unless the distance is 0, in which a NULL vector is returned.
-
- @param other: a point or another L{KX_GameObject} to get the vector and distance to.
- @type other: L{KX_GameObject} or list [x, y, z]
- @rtype: 3-tuple (float, 3-tuple (x,y,z), 3-tuple (x,y,z))
- @return: (distance, globalVector(3), localVector(3))
- """
- def rayCastTo(other,dist,prop):
- """
- Look towards another point/object and find first object hit within dist that matches prop.
-
- The ray is always casted from the center of the object, ignoring the object itself.
- The ray is casted towards the center of another object or an explicit [x,y,z] point.
- Use rayCast() if you need to retrieve the hit point
-
- @param other: [x,y,z] or object towards which the ray is casted
- @type other: L{KX_GameObject} or 3-tuple
- @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other
- @type dist: float
- @param prop: property name that object must have; can be omitted => detect any object
- @type prop: string
- @rtype: L{KX_GameObject}
- @return: the first object hit or None if no object or object does not match prop
- """
- def rayCast(objto,objfrom,dist,prop,face,xray,poly):
- """
- Look from a point/object to another point/object and find first object hit within dist that matches prop.
- if poly is 0, returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit.
- if poly is 1, returns a 4-tuple with in addition a L{KX_PolyProxy} as 4th element.
- if poly is 2, returns a 5-tuple with in addition a 2D vector with the UV mapping of the hit point as 5th element.
-
- Ex::
- # shoot along the axis gun-gunAim (gunAim should be collision-free)
- ob,point,normal = gun.rayCast(gunAim,None,50)
- if ob:
- # hit something
-
- Notes:
- The ray ignores the object on which the method is called.
- It is casted from/to object center or explicit [x,y,z] points.
-
- The face paremeter determines the orientation of the normal::
- 0 => hit normal is always oriented towards the ray origin (as if you casted the ray from outside)
- 1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect)
-
- The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray.
- The prop and xray parameters interact as follow::
- prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray.
- prop off, xray on : idem.
- prop on, xray off: return closest hit if it matches prop, no hit otherwise.
- prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray.
- The L{KX_PolyProxy} 4th element of the return tuple when poly=1 allows to retrieve information on the polygon hit by the ray.
- If there is no hit or the hit object is not a static mesh, None is returned as 4th element.
-
- The ray ignores collision-free objects and faces that dont have the collision flag enabled, you can however use ghost objects.
-
- @param objto: [x,y,z] or object to which the ray is casted
- @type objto: L{KX_GameObject} or 3-tuple
- @param objfrom: [x,y,z] or object from which the ray is casted; None or omitted => use self object center
- @type objfrom: L{KX_GameObject} or 3-tuple or None
- @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to to
- @type dist: float
- @param prop: property name that object must have; can be omitted or "" => detect any object
- @type prop: string
- @param face: normal option: 1=>return face normal; 0 or omitted => normal is oriented towards origin
- @type face: int
- @param xray: X-ray option: 1=>skip objects that don't match prop; 0 or omitted => stop on first object
- @type xray: int
- @param poly: polygon option: 0,1 or 2 to return a 3-, 4- or 5-tuple with information on the face hit
- 0 or omitted=> return value is a 3-tuple (object, hitpoint, hitnormal) or (None,None,None) if no hit
- 1=>return value is a 4-tuple and the 4th element is a L{KX_PolyProxy} or None if no hit or the object doesn't use a mesh collision shape.
- 2=>return value is a 5-tuple and the 5th element is a 2-tuple (u,v) with the UV mapping of the hit point or None if no hit, or the object doesn't use a mesh collision shape, or doesn't have a UV mapping.
- @type poly: int
- @rtype: 3-tuple (L{KX_GameObject}, 3-tuple (x,y,z), 3-tuple (nx,ny,nz))
- or 4-tuple (L{KX_GameObject}, 3-tuple (x,y,z), 3-tuple (nx,ny,nz), L{KX_PolyProxy})
- or 5-tuple (L{KX_GameObject}, 3-tuple (x,y,z), 3-tuple (nx,ny,nz), L{KX_PolyProxy}, 2-tuple (u,v))
- @return: (object,hitpoint,hitnormal) or (object,hitpoint,hitnormal,polygon) or (object,hitpoint,hitnormal,polygon,hituv)
- object, hitpoint and hitnormal are None if no hit.
- polygon is valid only if the object is valid and is a static object, a dynamic object using mesh collision shape or a soft body object, otherwise it is None
- hituv is valid only if polygon is valid and the object has a UV mapping, otherwise it is None
- """
- def setCollisionMargin(margin):
- """
- Set the objects collision margin.
-
- note: If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError.
-
- @type margin: float
- @param margin: the collision margin distance in blender units.
- """
- def sendMessage(subject, body="", to=""):
- """
- Sends a message.
-
- @param subject: The subject of the message
- @type subject: string
- @param body: The body of the message (optional)
- @type body: string
- @param to: The name of the object to send the message to (optional)
- @type to: string
- """
- def reinstancePhysicsMesh(gameObject, meshObject):
- """
- Updates the physics system with the changed mesh.
-
- If no arguments are given the physics mesh will be re-created from the first mesh assigned to the game object.
-
- @param gameObject: optional argument, set the physics shape from this gameObjets mesh.
- @type gameObject: string, L{KX_GameObject} or None
- @param meshObject: optional argument, set the physics shape from this mesh.
- @type meshObject: string, L{KX_MeshProxy} or None
-
- @note: if this object has instances the other instances will be updated too.
- @note: the gameObject argument has an advantage that it can convert from a mesh with modifiers applied (such as subsurf).
- @warning: only triangle mesh type objects are supported currently (not convex hull)
- @warning: if the object is a part of a combound object it will fail (parent or child)
- @warning: rebuilding the physics mesh can be slow, running many times per second will give a performance hit.
- @rtype: boolean
- @return: True if reinstance succeeded, False if it failed.
- """
-
- def get(key, default=None):
- """
- Return the value matching key, or the default value if its not found.
- @return: The key value or a default.
- """
-
-
-class KX_IpoActuator(SCA_IActuator):
- """
- IPO actuator activates an animation.
-
- @ivar frameStart: Start frame.
- @type frameStart: float
- @ivar frameEnd: End frame.
- @type frameEnd: float
- @ivar propName: Use this property to define the Ipo position
- @type propName: string
- @ivar framePropName: Assign this property this action current frame number
- @type framePropName: string
- @ivar mode: Play mode for the ipo. (In GameLogic.KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND, KX_IPOACT_FROM_PROP)
- @type mode: int
- @ivar useIpoAsForce: Apply Ipo as a global or local force depending on the local option (dynamic objects only)
- @type useIpoAsForce: bool
- @ivar useIpoAdd: Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag
- @type useIpoAdd: bool
- @ivar useIpoLocal: Let the ipo acts in local coordinates, used in Force and Add mode.
- @type useIpoLocal: bool
- @ivar useChildren: Update IPO on all children Objects as well
- @type useChildren: bool
- """
-#{ Deprecated
- def set(mode, startframe, endframe, force):
- """
- Sets the properties of the actuator.
-
- @deprecated: use other attributes.
- @param mode: "Play", "PingPong", "Flipper", "LoopStop", "LoopEnd" or "FromProp"
- @type mode: string
- @param startframe: first frame to use
- @type startframe: integer
- @param endframe: last frame to use
- @type endframe: integer
- @param force: special mode
- @type force: integer (0=normal, 1=interpret location as force, 2=additive)
- """
- def setProperty(property):
- """
- Sets the name of the property to be used in FromProp mode.
-
- @deprecated: use L{propName}
- @type property: string
- """
- def setStart(startframe):
- """
- Sets the frame from which the IPO starts playing.
-
- @deprecated: use L{frameStart}
- @type startframe: integer
- """
- def getStart():
- """
- Returns the frame from which the IPO starts playing.
-
- @deprecated: use L{frameStart}
- @rtype: integer
- """
- def setEnd(endframe):
- """
- Sets the frame at which the IPO stops playing.
-
- @deprecated: use L{frameEnd}
- @type endframe: integer
- """
- def getEnd():
- """
- Returns the frame at which the IPO stops playing.
-
- @deprecated: use L{frameEnd}
- @rtype: integer
- """
- def setIpoAsForce(force):
- """
- Set whether to interpret the ipo as a force rather than a displacement.
-
- @deprecated: use L{useIpoAsForce}
- @type force: boolean
- @param force: KX_TRUE or KX_FALSE
- """
- def getIpoAsForce():
- """
- Returns whether to interpret the ipo as a force rather than a displacement.
-
- @deprecated: use L{useIpoAsForce}
- @rtype: boolean
- """
- def setIpoAdd(add):
- """
- Set whether to interpret the ipo as additive rather than absolute.
-
- @deprecated: use L{useIpoAdd}
- @type add: boolean
- @param add: KX_TRUE or KX_FALSE
- """
- def getIpoAdd():
- """
- Returns whether to interpret the ipo as additive rather than absolute.
-
- @deprecated: use L{useIpoAdd}
- @rtype: boolean
- """
- def setType(mode):
- """
- Sets the operation mode of the actuator.
-
- @deprecated: use L{type}
- @param mode: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND
- @type mode: string
- """
- def getType():
- """
- Returns the operation mode of the actuator.
-
- @deprecated: use L{type}
- @rtype: integer
- @return: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND
- """
- def setForceIpoActsLocal(local):
- """
- Set whether to apply the force in the object's local
- coordinates rather than the world global coordinates.
-
- @deprecated: use L{useIpoLocal}
- @param local: Apply the ipo-as-force in the object's local
- coordinates? (KX_TRUE, KX_FALSE)
- @type local: boolean
- """
- def getForceIpoActsLocal():
- """
- Return whether to apply the force in the object's local
- coordinates rather than the world global coordinates.
-
- @deprecated: use L{useIpoLocal}
- """
-#}
-
-class KX_LightObject(KX_GameObject):
- """
- A Light object.
-
- Example:
-
- # Turn on a red alert light.
- import GameLogic
-
- co = GameLogic.getCurrentController()
- light = co.owner
-
- light.energy = 1.0
- light.colour = [1.0, 0.0, 0.0]
-
- @group Constants: NORMAL, SPOT, SUN
- @ivar SPOT: A spot light source. See attribute 'type'
- @ivar SUN: A point light source with no attenuation. See attribute 'type'
- @ivar NORMAL: A point light source. See attribute 'type'
-
- @ivar type: The type of light - must be SPOT, SUN or NORMAL
- @ivar layer: The layer mask that this light affects object on.
- @type layer: bitfield
- @ivar energy: The brightness of this light.
- @type energy: float
- @ivar distance: The maximum distance this light can illuminate. (SPOT and NORMAL lights only)
- @type distance: float
- @ivar colour: The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0]
- @type colour: list [r, g, b]
- @ivar color: Synonym for colour.
- @ivar lin_attenuation: The linear component of this light's attenuation. (SPOT and NORMAL lights only)
- @type lin_attenuation: float
- @ivar quad_attenuation: The quadratic component of this light's attenuation (SPOT and NORMAL lights only)
- @type quad_attenuation: float
- @ivar spotsize: The cone angle of the spot light, in degrees. (float) (SPOT lights only)
- 0.0 <= spotsize <= 180.0. Spotsize = 360.0 is also accepted.
- @ivar spotblend: Specifies the intensity distribution of the spot light. (float) (SPOT lights only)
- Higher values result in a more focused light source.
- 0.0 <= spotblend <= 1.0.
-
- """
-
-class KX_MeshProxy(SCA_IObject):
- """
- A mesh object.
-
- You can only change the vertex properties of a mesh object, not the mesh topology.
-
- To use mesh objects effectively, you should know a bit about how the game engine handles them.
- 1. Mesh Objects are converted from Blender at scene load.
- 2. The Converter groups polygons by Material. This means they can be sent to the
- renderer efficiently. A material holds:
- 1. The texture.
- 2. The Blender material.
- 3. The Tile properties
- 4. The face properties - (From the "Texture Face" panel)
- 5. Transparency & z sorting
- 6. Light layer
- 7. Polygon shape (triangle/quad)
- 8. Game Object
- 3. Verticies will be split by face if necessary. Verticies can only be shared between
- faces if:
- 1. They are at the same position
- 2. UV coordinates are the same
- 3. Their normals are the same (both polygons are "Set Smooth")
- 4. They are the same colour
- For example: a cube has 24 verticies: 6 faces with 4 verticies per face.
-
- The correct method of iterating over every L{KX_VertexProxy} in a game object::
- import GameLogic
-
- co = GameLogic.getCurrentController()
- obj = co.owner
-
- m_i = 0
- mesh = obj.getMesh(m_i) # There can be more than one mesh...
- while mesh != None:
- for mat in range(mesh.getNumMaterials()):
- for v_index in range(mesh.getVertexArrayLength(mat)):
- vertex = mesh.getVertex(mat, v_index)
- # Do something with vertex here...
- # ... eg: colour the vertex red.
- vertex.colour = [1.0, 0.0, 0.0, 1.0]
- m_i += 1
- mesh = obj.getMesh(m_i)
-
- @ivar materials:
- @type materials: list of L{KX_BlenderMaterial} or L{KX_PolygonMaterial} types
-
- @ivar numPolygons:
- @type numPolygons: integer
-
- @ivar numMaterials:
- @type numMaterials: integer
- """
-
- def getNumMaterials():
- """
- Gets the number of materials associated with this object.
-
- @rtype: integer
- """
-
- def getMaterialName(matid):
- """
- Gets the name of the specified material.
-
- @type matid: integer
- @param matid: the specified material.
- @rtype: string
- @return: the attached material name.
- """
- def getTextureName(matid):
- """
- Gets the name of the specified material's texture.
-
- @type matid: integer
- @param matid: the specified material
- @rtype: string
- @return: the attached material's texture name.
- """
- def getVertexArrayLength(matid):
- """
- Gets the length of the vertex array associated with the specified material.
-
- There is one vertex array for each material.
-
- @type matid: integer
- @param matid: the specified material
- @rtype: integer
- @return: the number of verticies in the vertex array.
- """
- def getVertex(matid, index):
- """
- Gets the specified vertex from the mesh object.
-
- @type matid: integer
- @param matid: the specified material
- @type index: integer
- @param index: the index into the vertex array.
- @rtype: L{KX_VertexProxy}
- @return: a vertex object.
- """
- def getNumPolygons():
- """
- Returns the number of polygon in the mesh.
-
- @rtype: integer
- """
- def getPolygon(index):
- """
- Gets the specified polygon from the mesh.
-
- @type index: integer
- @param index: polygon number
- @rtype: L{KX_PolyProxy}
- @return: a polygon object.
- """
-
-class SCA_MouseSensor(SCA_ISensor):
- """
- Mouse Sensor logic brick.
-
- Properties:
-
- @ivar position: current [x,y] coordinates of the mouse, in frame coordinates (pixels)
- @type position: [integer,interger]
- @ivar mode: sensor mode: 1=KX_MOUSESENSORMODE_LEFTBUTTON 2=KX_MOUSESENSORMODE_MIDDLEBUTTON
- 3=KX_MOUSESENSORMODE_RIGHTBUTTON 4=KX_MOUSESENSORMODE_WHEELUP
- 5=KX_MOUSESENSORMODE_WHEELDOWN 9=KX_MOUSESENSORMODE_MOVEMENT
- @type mode: integer
- """
-
- def getXPosition():
- """
- Gets the x coordinate of the mouse.
-
- @deprecated: use the L{position} property
- @rtype: integer
- @return: the current x coordinate of the mouse, in frame coordinates (pixels)
- """
- def getYPosition():
- """
- Gets the y coordinate of the mouse.
-
- @deprecated: use the L{position} property
- @rtype: integer
- @return: the current y coordinate of the mouse, in frame coordinates (pixels).
- """
- def getButtonStatus(button):
- """
- Get the mouse button status.
-
- @type button: int
- @param button: value in GameLogic members KX_MOUSE_BUT_LEFT, KX_MOUSE_BUT_MIDDLE, KX_MOUSE_BUT_RIGHT
-
- @rtype: integer
- @return: value in GameLogic members KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED
- """
-
-class KX_MouseFocusSensor(SCA_MouseSensor):
- """
- The mouse focus sensor detects when the mouse is over the current game object.
-
- The mouse focus sensor works by transforming the mouse coordinates from 2d device
- space to 3d space then raycasting away from the camera.
-
- @ivar raySource: The worldspace source of the ray (the view position)
- @type raySource: list (vector of 3 floats)
- @ivar rayTarget: The worldspace target of the ray.
- @type rayTarget: list (vector of 3 floats)
- @ivar rayDirection: The L{rayTarget} - L{raySource} normalized.
- @type rayDirection: list (normalized vector of 3 floats)
- @ivar hitObject: the last object the mouse was over.
- @type hitObject: L{KX_GameObject} or None
- @ivar hitPosition: The worldspace position of the ray intersecton.
- @type hitPosition: list (vector of 3 floats)
- @ivar hitNormal: the worldspace normal from the face at point of intersection.
- @type hitNormal: list (normalized vector of 3 floats)
- @ivar hitUV: the UV coordinates at the point of intersection.
- If the object has no UV mapping, it returns [0,0].
- The UV coordinates are not normalized, they can be < 0 or > 1 depending on the UV mapping.
- @type hitUV: list (vector of 2 floats)
- @ivar usePulseFocus: When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set)
- @type usePulseFocus: bool
- """
-#{ Deprecated
- def getHitNormal():
- """
- Returns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray.
-
- @deprecated: use the L{hitNormal} property
- @rtype: list [x, y, z]
- @return: the ray collision normal.
- """
- def getHitObject():
- """
- Returns the object that was hit by this ray or None.
-
- @deprecated: use the L{hitObject} property
- @rtype: L{KX_GameObject} or None
- @return: the collision object.
- """
- def getHitPosition():
- """
- Returns the position (in worldcoordinates) at the point of collision where the object was hit by this ray.
-
- @deprecated: use the L{hitPosition} property
- @rtype: list [x, y, z]
- @return: the ray collision position.
- """
- def getRayDirection():
- """
- Returns the normalized direction (in worldcoordinates) of the ray cast by the mouse.
-
- @deprecated: use the L{rayDirection} property
- @rtype: list [x, y, z]
- @return: the ray direction.
- """
- def getRaySource():
- """
- Returns the position (in worldcoordinates) the ray was cast from by the mouse.
-
- @deprecated: use the L{raySource} property
- @rtype: list [x, y, z]
- @return: the ray source.
- """
- def getRayTarget():
- """
- Returns the target of the ray (in worldcoordinates) that seeks the focus object.
-
- @deprecated: use the L{rayTarget} property
- @rtype: list [x, y, z]
- @return: the ray target.
- """
-#}
-
-class KX_TouchSensor(SCA_ISensor):
- """
- Touch sensor detects collisions between objects.
-
- @ivar propName: The property or material to collide with.
- @type propName: string
- @ivar useMaterial: Determines if the sensor is looking for a property or material.
- KX_True = Find material; KX_False = Find property
- @type useMaterial: boolean
- @ivar usePulseCollision: When enabled, changes to the set of colliding objects generate a pulse.
- @type usePulseCollision: bool
- @ivar hitObject: The last collided object. (read-only)
- @type hitObject: L{KX_GameObject} or None
- @ivar hitObjectList: A list of colliding objects. (read-only)
- @type hitObjectList: L{CListValue} of L{KX_GameObject}
- """
-#{ Deprecated
- def setProperty(name):
- """
- Set the property or material to collide with. Use
- setTouchMaterial() to switch between properties and
- materials.
-
- @deprecated: use the L{property} property
- @type name: string
- """
-
- def getProperty():
- """
- Returns the property or material to collide with. Use
- getTouchMaterial() to find out whether this sensor
- looks for properties or materials.
-
- @deprecated: use the L{property} property
- @rtype: string
- """
- def getHitObject():
- """
- Returns the last object hit by this touch sensor.
-
- @deprecated: use the L{hitObject} property
- @rtype: L{KX_GameObject}
- """
- def getHitObjectList():
- """
- Returns a list of all objects hit in the last frame. (B{deprecated})
-
- Only objects that have the requisite material/property are listed.
-
- @deprecated: use the L{hitObjectList} property
- @rtype: L{CListValue} of L{hitObjectList}
- """
- def getTouchMaterial():
- """
- Returns KX_TRUE if this sensor looks for a specific material,
- KX_FALSE if it looks for a specific property. (B{deprecated})
-
- @deprecated: use the L{useMaterial} property
- """
-#}
-
-class KX_NearSensor(KX_TouchSensor):
- """
- A near sensor is a specialised form of touch sensor.
-
- @ivar distance: The near sensor activates when an object is within this distance.
- @type distance: float
- @ivar resetDistance: The near sensor deactivates when the object exceeds this distance.
- @type resetDistance: float
- """
-
-class KX_NetworkMessageActuator(SCA_IActuator):
- """
- Message Actuator
-
- @ivar propName: Messages will only be sent to objects with the given property name.
- @type propName: string
- @ivar subject: The subject field of the message.
- @type subject: string
- @ivar body: The body of the message.
- @type body: string
- @ivar usePropBody: Send a property instead of a regular body message.
- @type usePropBody: boolean
- """
-#{Deprecated
- def setToPropName(name):
- """
- Messages will only be sent to objects with the given property name.
-
- @deprecated: Use the L{propName} attribute instead.
- @type name: string
- """
- def setSubject(subject):
- """
- Sets the subject field of the message.
-
- @deprecated: Use the L{subject} attribute instead.
- @type subject: string
- """
- def setBodyType(bodytype):
- """
- Sets the type of body to send.
-
- @deprecated: Use the L{usePropBody} attribute instead.
- @type bodytype: boolean
- @param bodytype: True to send the value of a property, False to send the body text.
- """
- def setBody(body):
- """
- Sets the message body.
-
- @deprecated: Use the L{body} attribute instead.
- @type body: string
- @param body: if the body type is True, this is the name of the property to send.
- if the body type is False, this is the text to send.
- """
-#}
-
-class KX_NetworkMessageSensor(SCA_ISensor):
- """
- The Message Sensor logic brick.
-
- Currently only loopback (local) networks are supported.
-
- @ivar subject: The subject the sensor is looking for.
- @type subject: string
- @ivar frameMessageCount: The number of messages received since the last frame.
- (Read-only)
- @type frameMessageCount: int
- @ivar subjects: The list of message subjects received. (Read-only)
- @type subjects: list of strings
- @ivar bodies: The list of message bodies received. (Read-only)
- @type bodies: list of strings
- """
-#{ Deprecated
- def setSubjectFilterText(subject):
- """
- Change the message subject text that this sensor is listening to.
-
- @deprecated: Use the L{subject} attribute instead.
- @type subject: string
- @param subject: the new message subject to listen for.
- """
-
- def getFrameMessageCount():
- """
- Get the number of messages received since the last frame.
-
- @deprecated: Use the L{frameMessageCount} attribute instead.
- @rtype: integer
- """
- def getBodies():
- """
- Gets the list of message bodies.
-
- @deprecated: Use the L{bodies} attribute instead.
- @rtype: list
- """
- def getSubject():
- """
- Gets the message subject this sensor is listening for from the Subject: field.
-
- @deprecated: Use the L{subject} attribute instead.
- @rtype: string
- """
- def getSubjects():
- """
- Gets the list of message subjects received.
-
- @deprecated: Use the L{subjects} attribute instead.
- @rtype: list
- """
-#}
-
-class KX_ObjectActuator(SCA_IActuator):
- """
- The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement,
- velocity, or angular velocity to an object.
- Servo control allows to regulate force to achieve a certain speed target.
-
- @ivar force: The force applied by the actuator
- @type force: list [x, y, z]
- @ivar useLocalForce: A flag specifying if the force is local
- @type useLocalForce: bool
- @ivar torque: The torque applied by the actuator
- @type torque: list [x, y, z]
- @ivar useLocalTorque: A flag specifying if the torque is local
- @type useLocalTorque: bool
- @ivar dLoc: The displacement vector applied by the actuator
- @type dLoc: list [x, y, z]
- @ivar useLocalDLoc: A flag specifying if the dLoc is local
- @type useLocalDLoc: bool
- @ivar dRot: The angular displacement vector applied by the actuator
- - note: Since the displacement is applied every frame, you must adjust the displacement
- based on the frame rate, or you game experience will depend on the player's computer
- speed.
- @type dRot: list [x, y, z]
- @ivar useLocalDRot: A flag specifying if the dRot is local
- @type useLocalDRot: bool
- @ivar linV: The linear velocity applied by the actuator
- @type linV: list [x, y, z]
- @ivar useLocalLinV: A flag specifying if the linear velocity is local
- - note: This is the target speed for servo controllers
- @type useLocalLinV: bool
- @ivar angV: The angular velocity applied by the actuator
- @type angV: list [x, y, z]
- @ivar useLocalAngV: A flag specifying if the angular velocity is local
- @type useLocalAngV: bool
-
- @ivar damping: The damping parameter of the servo controller
- @type damping: short
-
- @ivar forceLimitX: The min/max force limit along the X axis and activates or deactivates the limits in the servo controller
- @type forceLimitX: list [min(float), max(float), bool]
- @ivar forceLimitY: The min/max force limit along the Y axis and activates or deactivates the limits in the servo controller
- @type forceLimitY: list [min(float), max(float), bool]
- @ivar forceLimitZ: The min/max force limit along the Z axis and activates or deactivates the limits in the servo controller
- @type forceLimitZ: list [min(float), max(float), bool]
-
- @ivar pid: The PID coefficients of the servo controller
- @type pid: list of floats [proportional, integral, derivate]
- @ivar reference: The object that is used as reference to compute the velocity for the servo controller.
- @type reference: L{KX_GameObject} or None
-
- @group Deprecated: getForce, setForce, getTorque, setTorque, getDLoc, setDLoc, getDRot, setDRot, getLinearVelocity, setLinearVelocity, getAngularVelocity,
- setAngularVelocity, getDamping, setDamping, getForceLimitX, setForceLimitX, getForceLimitY, setForceLimitY, getForceLimitZ, setForceLimitZ,
- getPID, setPID
- """
- def getForce():
- """
- Returns the force applied by the actuator.
-
- @deprecated: Use L{force} and L{useLocalForce} instead.
- @rtype: list [fx, fy, fz, local]
- @return: A four item list, containing the vector force, and a flag specifying whether the force is local.
- """
- def setForce(fx, fy, fz, local):
- """
- Sets the force applied by the actuator.
-
- @deprecated: Use L{force} and L{useLocalForce} instead.
- @type fx: float
- @param fx: the x component of the force.
- @type fy: float
- @param fy: the z component of the force.
- @type fz: float
- @param fz: the z component of the force.
- @type local: boolean
- @param local: - False: the force is applied in world coordinates.
- - True: the force is applied in local coordinates.
- """
- def getTorque():
- """
- Returns the torque applied by the actuator.
-
- @deprecated: Use L{torque} and L{useLocalTorque} instead.
- @rtype: list [S{Tau}x, S{Tau}y, S{Tau}z, local]
- @return: A four item list, containing the vector torque, and a flag specifying whether
- the torque is applied in local coordinates (True) or world coordinates (False)
- """
- def setTorque(tx, ty, tz, local):
- """
- Sets the torque applied by the actuator.
-
- @deprecated: Use L{torque} and L{useLocalTorque} instead.
- @type tx: float
- @param tx: the x component of the torque.
- @type ty: float
- @param ty: the z component of the torque.
- @type tz: float
- @param tz: the z component of the torque.
- @type local: boolean
- @param local: - False: the torque is applied in world coordinates.
- - True: the torque is applied in local coordinates.
- """
- def getDLoc():
- """
- Returns the displacement vector applied by the actuator.
-
- @deprecated: Use L{dLoc} and L{useLocalDLoc} instead.
- @rtype: list [dx, dy, dz, local]
- @return: A four item list, containing the vector displacement, and whether
- the displacement is applied in local coordinates (True) or world
- coordinates (False)
- """
- def setDLoc(dx, dy, dz, local):
- """
- Sets the displacement vector applied by the actuator.
-
- Since the displacement is applied every frame, you must adjust the displacement
- based on the frame rate, or you game experience will depend on the player's computer
- speed.
-
- @deprecated: Use L{dLoc} and L{useLocalDLoc} instead.
- @type dx: float
- @param dx: the x component of the displacement vector.
- @type dy: float
- @param dy: the z component of the displacement vector.
- @type dz: float
- @param dz: the z component of the displacement vector.
- @type local: boolean
- @param local: - False: the displacement vector is applied in world coordinates.
- - True: the displacement vector is applied in local coordinates.
- """
- def getDRot():
- """
- Returns the angular displacement vector applied by the actuator.
-
- @deprecated: Use L{dRot} and L{useLocalDRot} instead.
- @rtype: list [dx, dy, dz, local]
- @return: A four item list, containing the angular displacement vector, and whether
- the displacement is applied in local coordinates (True) or world coordinates (False)
- """
- def setDRot(dx, dy, dz, local):
- """
- Sets the angular displacement vector applied by the actuator.
-
- Since the displacement is applied every frame, you must adjust the displacement
- based on the frame rate, or you game experience will depend on the player's computer
- speed.
-
- @deprecated: Use L{dRot} and L{useLocalDRot} instead.
- @type dx: float
- @param dx: the x component of the angular displacement vector.
- @type dy: float
- @param dy: the z component of the angular displacement vector.
- @type dz: float
- @param dz: the z component of the angular displacement vector.
- @type local: boolean
- @param local: - False: the angular displacement vector is applied in world coordinates.
- - True: the angular displacement vector is applied in local coordinates.
- """
- def getLinearVelocity():
- """
- Returns the linear velocity applied by the actuator.
- For the servo control actuator, this is the target speed.
-
- @deprecated: Use L{linV} and L{useLocalLinV} instead.
- @rtype: list [vx, vy, vz, local]
- @return: A four item list, containing the vector velocity, and whether the velocity is applied in local coordinates (True) or world coordinates (False)
- """
- def setLinearVelocity(vx, vy, vz, local):
- """
- Sets the linear velocity applied by the actuator.
- For the servo control actuator, sets the target speed.
-
- @deprecated: Use L{linV} and L{useLocalLinV} instead.
- @type vx: float
- @param vx: the x component of the velocity vector.
- @type vy: float
- @param vy: the z component of the velocity vector.
- @type vz: float
- @param vz: the z component of the velocity vector.
- @type local: boolean
- @param local: - False: the velocity vector is in world coordinates.
- - True: the velocity vector is in local coordinates.
- """
- def getAngularVelocity():
- """
- Returns the angular velocity applied by the actuator.
-
- @deprecated: Use L{angV} and L{useLocalAngV} instead.
- @rtype: list [S{omega}x, S{omega}y, S{omega}z, local]
- @return: A four item list, containing the vector velocity, and whether
- the velocity is applied in local coordinates (True) or world
- coordinates (False)
- """
- def setAngularVelocity(wx, wy, wz, local):
- """
- Sets the angular velocity applied by the actuator.
-
- @deprecated: Use L{angV} and L{useLocalAngV} instead.
- @type wx: float
- @param wx: the x component of the velocity vector.
- @type wy: float
- @param wy: the z component of the velocity vector.
- @type wz: float
- @param wz: the z component of the velocity vector.
- @type local: boolean
- @param local: - False: the velocity vector is applied in world coordinates.
- - True: the velocity vector is applied in local coordinates.
- """
- def getDamping():
- """
- Returns the damping parameter of the servo controller.
-
- @deprecated: Use L{damping} instead.
- @rtype: integer
- @return: the time constant of the servo controller in frame unit.
- """
- def setDamping(damp):
- """
- Sets the damping parameter of the servo controller.
-
- @deprecated: Use L{damping} instead.
- @type damp: integer
- @param damp: the damping parameter in frame unit.
- """
- def getForceLimitX():
- """
- Returns the min/max force limit along the X axis used by the servo controller.
-
- @deprecated: Use L{forceLimitX} instead.
- @rtype: list [min, max, enabled]
- @return: A three item list, containing the min and max limits of the force as float
- and whether the limits are active(true) or inactive(true)
- """
- def setForceLimitX(min, max, enable):
- """
- Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller.
-
- @deprecated: Use L{forceLimitX} instead.
- @type min: float
- @param min: the minimum value of the force along the X axis.
- @type max: float
- @param max: the maximum value of the force along the X axis.
- @type enable: boolean
- @param enable: - True: the force will be limited to the min/max
- - False: the force will not be limited
- """
- def getForceLimitY():
- """
- Returns the min/max force limit along the Y axis used by the servo controller.
-
- @deprecated: Use L{forceLimitY} instead.
- @rtype: list [min, max, enabled]
- @return: A three item list, containing the min and max limits of the force as float
- and whether the limits are active(true) or inactive(true)
- """
- def setForceLimitY(min, max, enable):
- """
- Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller.
-
- @deprecated: Use L{forceLimitY} instead.
- @type min: float
- @param min: the minimum value of the force along the Y axis.
- @type max: float
- @param max: the maximum value of the force along the Y axis.
- @type enable: boolean
- @param enable: - True: the force will be limited to the min/max
- - False: the force will not be limited
- """
- def getForceLimitZ():
- """
- Returns the min/max force limit along the Z axis used by the servo controller.
-
- @deprecated: Use L{forceLimitZ} instead.
- @rtype: list [min, max, enabled]
- @return: A three item list, containing the min and max limits of the force as float
- and whether the limits are active(true) or inactive(true)
- """
- def setForceLimitZ(min, max, enable):
- """
- Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller.
-
- @deprecated: Use L{forceLimitZ} instead.
- @type min: float
- @param min: the minimum value of the force along the Z axis.
- @type max: float
- @param max: the maximum value of the force along the Z axis.
- @type enable: boolean
- @param enable: - True: the force will be limited to the min/max
- - False: the force will not be limited
- """
- def getPID():
- """
- Returns the PID coefficient of the servo controller.
-
- @deprecated: Use L{pid} instead.
- @rtype: list [P, I, D]
- @return: A three item list, containing the PID coefficient as floats:
- P : proportional coefficient
- I : Integral coefficient
- D : Derivate coefficient
- """
- def setPID(P, I, D):
- """
- Sets the PID coefficients of the servo controller.
-
- @deprecated: Use L{pid} instead.
- @type P: flat
- @param P: proportional coefficient
- @type I: float
- @param I: Integral coefficient
- @type D: float
- @param D: Derivate coefficient
- """
-
-class KX_ParentActuator(SCA_IActuator):
- """
- The parent actuator can set or remove an objects parent object.
- @ivar object: the object this actuator sets the parent too.
- @type object: L{KX_GameObject} or None
- @ivar mode: The mode of this actuator
- @type mode: int from 0 to 1 L{GameLogic.Parent Actuator}
- @ivar compound: Whether the object shape should be added to the parent compound shape when parenting
- Effective only if the parent is already a compound shape
- @type compound: bool
- @ivar ghost: whether the object should be made ghost when parenting
- Effective only if the shape is not added to the parent compound shape
- @type ghost: bool
-
- """
- def setObject(object):
- """
- Sets the object to set as parent.
-
- Object can be either a L{KX_GameObject} or the name of the object.
-
- @deprecated: Use the L{object} property.
- @type object: L{KX_GameObject}, string or None
- """
- def getObject(name_only = 1):
- """
- Returns the name of the object to change to.
-
- @deprecated: Use the L{object} property.
- @type name_only: bool
- @param name_only: optional argument, when 0 return a KX_GameObject
- @rtype: string, L{KX_GameObject} or None if no object is set
- """
-
-class KX_PhysicsObjectWrapper(PyObjectPlus):
- """
- KX_PhysicsObjectWrapper
-
- """
- def setActive(active):
- """
- Set the object to be active.
-
- @param active: set to True to be active
- @type active: bool
- """
-
- def setAngularVelocity(x, y, z, local):
- """
- Set the angular velocity of the object.
-
- @param x: angular velocity for the x-axis
- @type x: float
-
- @param y: angular velocity for the y-axis
- @type y: float
-
- @param z: angular velocity for the z-axis
- @type z: float
-
- @param local: set to True for local axis
- @type local: bool
- """
- def setLinearVelocity(x, y, z, local):
- """
- Set the linear velocity of the object.
-
- @param x: linear velocity for the x-axis
- @type x: float
-
- @param y: linear velocity for the y-axis
- @type y: float
-
- @param z: linear velocity for the z-axis
- @type z: float
-
- @param local: set to True for local axis
- @type local: bool
- """
- def setPosition(x, y, z):
- """
- Set the position of the object
-
- @param x: x coordinate
- @type x: float
-
- @param y: y coordinate
- @type y: float
-
- @param z: z coordinate
- @type z: float
- """
-
-class KX_PolyProxy(SCA_IObject):
- """
- A polygon holds the index of the vertex forming the poylgon.
-
- Note:
- The polygon attributes are read-only, you need to retrieve the vertex proxy if you want
- to change the vertex settings.
-
- @ivar matname: The name of polygon material, empty if no material.
- @type matname: string
- @ivar material: The material of the polygon
- @type material: L{KX_PolygonMaterial} or L{KX_BlenderMaterial}
- @ivar texture: The texture name of the polygon.
- @type texture: string
- @ivar matid: The material index of the polygon, use this to retrieve vertex proxy from mesh proxy
- @type matid: integer
- @ivar v1: vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
- @type v1: integer
- @ivar v2: vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
- @type v2: integer
- @ivar v3: vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
- @type v3: integer
- @ivar v4: vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
- use this to retrieve vertex proxy from mesh proxy
- @type v4: integer
- @ivar visible: visible state of the polygon: 1=visible, 0=invisible
- @type visible: integer
- @ivar collide: collide state of the polygon: 1=receives collision, 0=collision free.
- @type collide: integer
- """
-
- def getMaterialName():
- """
- Returns the polygon material name with MA prefix
-
- @rtype: string
- @return: material name
- """
- def getMaterial():
- """
- Returns the polygon material
-
- @rtype: L{KX_PolygonMaterial} or L{KX_BlenderMaterial}
- """
- def getTextureName():
- """
- Returns the polygon texture name
-
- @rtype: string
- @return: texture name
- """
- def getMaterialIndex():
- """
- Returns the material bucket index of the polygon.
- This index and the ones returned by getVertexIndex() are needed to retrieve the vertex proxy from L{KX_MeshProxy}.
-
- @rtype: integer
- @return: the material index in the mesh
- """
- def getNumVertex():
- """
- Returns the number of vertex of the polygon.
-
- @rtype: integer
- @return: number of vertex, 3 or 4.
- """
- def isVisible():
- """
- Returns whether the polygon is visible or not
-
- @rtype: integer
- @return: 0=invisible, 1=visible
- """
- def isCollider():
- """
- Returns whether the polygon is receives collision or not
-
- @rtype: integer
- @return: 0=collision free, 1=receives collision
- """
- def getVertexIndex(vertex):
- """
- Returns the mesh vertex index of a polygon vertex
- This index and the one returned by getMaterialIndex() are needed to retrieve the vertex proxy from L{KX_MeshProxy}.
-
- @type vertex: integer
- @param vertex: index of the vertex in the polygon: 0->3
- @rtype: integer
- @return: mesh vertex index
- """
- def getMesh():
- """
- Returns a mesh proxy
-
- @rtype: L{KX_MeshProxy}
- @return: mesh proxy
- """
-
-class KX_PolygonMaterial:
- """
- This is the interface to materials in the game engine.
-
- Materials define the render state to be applied to mesh objects.
-
- Warning: Some of the methods/variables are CObjects. If you mix these up,
- you will crash blender.
-
- This example requires:
- - PyOpenGL http://pyopengl.sourceforge.net/
- - GLEWPy http://glewpy.sourceforge.net/
- Example::
-
- import GameLogic
- import OpenGL
- from OpenGL.GL import *
- from OpenGL.GLU import *
- import glew
- from glew import *
-
- glewInit()
-
- vertex_shader = \"\"\"
-
- void main(void)
- {
- gl_Position = ftransform();
- }
- \"\"\"
-
- fragment_shader =\"\"\"
-
- void main(void)
- {
- gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
- }
- \"\"\"
-
- class MyMaterial:
- def __init__(self):
- self.pass_no = 0
- # Create a shader
- self.m_program = glCreateProgramObjectARB()
- # Compile the vertex shader
- self.shader(GL_VERTEX_SHADER_ARB, (vertex_shader))
- # Compile the fragment shader
- self.shader(GL_FRAGMENT_SHADER_ARB, (fragment_shader))
- # Link the shaders together
- self.link()
-
- def PrintInfoLog(self, tag, object):
- \"\"\"
- PrintInfoLog prints the GLSL compiler log
- \"\"\"
- print "Tag: def PrintGLError(self, tag = ""):
-
- def PrintGLError(self, tag = ""):
- \"\"\"
- Prints the current GL error status
- \"\"\"
- if len(tag):
- print tag
- err = glGetError()
- if err != GL_NO_ERROR:
- print "GL Error: %s\\n"%(gluErrorString(err))
-
- def shader(self, type, shaders):
- \"\"\"
- shader compiles a GLSL shader and attaches it to the current
- program.
-
- type should be either GL_VERTEX_SHADER_ARB or GL_FRAGMENT_SHADER_ARB
- shaders should be a sequence of shader source to compile.
- \"\"\"
- # Create a shader object
- shader_object = glCreateShaderObjectARB(type)
-
- # Add the source code
- glShaderSourceARB(shader_object, len(shaders), shaders)
-
- # Compile the shader
- glCompileShaderARB(shader_object)
-
- # Print the compiler log
- self.PrintInfoLog("vertex shader", shader_object)
-
- # Check if compiled, and attach if it did
- compiled = glGetObjectParameterivARB(shader_object, GL_OBJECT_COMPILE_STATUS_ARB)
- if compiled:
- glAttachObjectARB(self.m_program, shader_object)
-
- # Delete the object (glAttachObjectARB makes a copy)
- glDeleteObjectARB(shader_object)
-
- # print the gl error log
- self.PrintGLError()
-
- def link(self):
- \"\"\"
- Links the shaders together.
- \"\"\"
- # clear error indicator
- glGetError()
-
- glLinkProgramARB(self.m_program)
-
- self.PrintInfoLog("link", self.m_program)
-
- linked = glGetObjectParameterivARB(self.m_program, GL_OBJECT_LINK_STATUS_ARB)
- if not linked:
- print "Shader failed to link"
- return
-
- glValidateProgramARB(self.m_program)
- valid = glGetObjectParameterivARB(self.m_program, GL_OBJECT_VALIDATE_STATUS_ARB)
- if not valid:
- print "Shader failed to validate"
- return
-
- def activate(self, rasty, cachingInfo, mat):
- self.pass_no+=1
- if (self.pass_no == 1):
- glDisable(GL_COLOR_MATERIAL)
- glUseProgramObjectARB(self.m_program)
- return True
-
- glEnable(GL_COLOR_MATERIAL)
- glUseProgramObjectARB(0)
- self.pass_no = 0
- return False
-
- obj = GameLogic.getCurrentController().owner
-
- mesh = obj.meshes[0]
-
- for mat in mesh.materials:
- mat.setCustomMaterial(MyMaterial())
- print mat.texture
-
- @ivar texture: Texture name
- @type texture: string (read-only)
-
- @ivar gl_texture: OpenGL texture handle (eg for glBindTexture(GL_TEXTURE_2D, gl_texture)
- @type gl_texture: integer (read-only)
-
- @ivar material: Material name
- @type material: string (read-only)
-
- @ivar tface: Texture face properties
- @type tface: CObject (read-only)
-
- @ivar tile: Texture is tiling
- @type tile: boolean
- @ivar tilexrep: Number of tile repetitions in x direction.
- @type tilexrep: integer
- @ivar tileyrep: Number of tile repetitions in y direction.
- @type tileyrep: integer
-
- @ivar drawingmode: Drawing mode for the material.
- - 2 (drawingmode & 4) Textured
- - 4 (drawingmode & 16) Light
- - 14 (drawingmode & 16384) 3d Polygon Text
- @type drawingmode: bitfield
-
- @ivar transparent: This material is transparent. All meshes with this
- material will be rendered after non transparent meshes from back
- to front.
- @type transparent: boolean
-
- @ivar zsort: Transparent polygons in meshes with this material will be sorted back to
- front before rendering.
- Non-Transparent polygons will be sorted front to back before rendering.
- @type zsort: boolean
-
- @ivar lightlayer: Light layers this material affects.
- @type lightlayer: bitfield.
-
- @ivar triangle: Mesh data with this material is triangles. It's probably not safe to change this.
- @type triangle: boolean
-
- @ivar diffuse: The diffuse colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0]
- @type diffuse: list [r, g, b]
- @ivar specular: The specular colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0]
- @type specular: list [r, g, b]
- @ivar shininess: The shininess (specular exponent) of the material. 0.0 <= shininess <= 128.0
- @type shininess: float
- @ivar specularity: The amount of specular of the material. 0.0 <= specularity <= 1.0
- @type specularity: float
- """
- def updateTexture(tface, rasty):
- """
- Updates a realtime animation.
-
- @param tface: Texture face (eg mat.tface)
- @type tface: CObject
- @param rasty: Rasterizer
- @type rasty: CObject
- """
- def setTexture(tface):
- """
- Sets texture render state.
-
- Example::
- mat.setTexture(mat.tface)
-
- @param tface: Texture face
- @type tface: CObject
- """
- def activate(rasty, cachingInfo):
- """
- Sets material parameters for this object for rendering.
-
- Material Parameters set:
- 1. Texture
- 2. Backface culling
- 3. Line drawing
- 4. Specular Colour
- 5. Shininess
- 6. Diffuse Colour
- 7. Polygon Offset.
-
- @param rasty: Rasterizer instance.
- @type rasty: CObject
- @param cachingInfo: Material cache instance.
- @type cachingInfo: CObject
- """
- def setCustomMaterial(material):
- """
- Sets the material state setup object.
-
- Using this method, you can extend or completely replace the gameengine material
- to do your own advanced multipass effects.
-
- Use this method to register your material class. Instead of the normal material,
- your class's activate method will be called just before rendering the mesh.
- This should setup the texture, material, and any other state you would like.
- It should return True to render the mesh, or False if you are finished. You should
- clean up any state Blender does not set before returning False.
-
- Activate Method Definition::
- def activate(self, rasty, cachingInfo, material):
-
- Example::
- class PyMaterial:
- def __init__(self):
- self.pass_no = -1
-
- def activate(self, rasty, cachingInfo, material):
- # Activate the material here.
- #
- # The activate method will be called until it returns False.
- # Every time the activate method returns True the mesh will
- # be rendered.
- #
- # rasty is a CObject for passing to material.updateTexture()
- # and material.activate()
- # cachingInfo is a CObject for passing to material.activate()
- # material is the KX_PolygonMaterial instance this material
- # was added to
-
- # default material properties:
- self.pass_no += 1
- if self.pass_no == 0:
- material.activate(rasty, cachingInfo)
- # Return True to do this pass
- return True
-
- # clean up and return False to finish.
- self.pass_no = -1
- return False
-
- # Create a new Python Material and pass it to the renderer.
- mat.setCustomMaterial(PyMaterial())
-
- @param material: The material object.
- @type material: instance
- """
-
-class KX_RadarSensor(KX_NearSensor):
- """
- Radar sensor is a near sensor with a conical sensor object.
-
- @ivar coneOrigin: The origin of the cone with which to test. The origin
- is in the middle of the cone.
- (read-only)
- @type coneOrigin: list of floats [x, y, z]
- @ivar coneTarget: The center of the bottom face of the cone with which to test.
- (read-only)
- @type coneTarget: list of floats [x, y, z]
- @ivar distance: The height of the cone with which to test.
- @type distance: float
- @ivar angle: The angle of the cone (in degrees) with which to test.
- @type angle: float from 0 to 360
- @ivar axis: The axis on which the radar cone is cast
- @type axis: int from 0 to 5
- KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z,
- KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z
- """
-#{Deprecated
- #--The following methods are deprecated, please use properties instead.
- def getConeOrigin():
- """
- Returns the origin of the cone with which to test. The origin
- is in the middle of the cone.
-
- @deprecated: Use the L{coneOrigin} property.
- @rtype: list [x, y, z]
- """
-
- def getConeTarget():
- """
- Returns the center of the bottom face of the cone with which to test.
-
- @deprecated: Use the L{coneTarget} property.
- @rtype: list [x, y, z]
- """
-#}
-
- def getConeHeight():
- """
- Returns the height of the cone with which to test.
-
- @rtype: float
- """
-
-class KX_RaySensor(SCA_ISensor):
- """
- A ray sensor detects the first object in a given direction.
-
- @ivar propName: The property the ray is looking for.
- @type propName: string
- @ivar range: The distance of the ray.
- @type range: float
- @ivar useMaterial: Whether or not to look for a material (false = property)
- @type useMaterial: boolean
- @ivar useXRay: Whether or not to use XRay.
- @type useXRay: boolean
- @ivar hitObject: The game object that was hit by the ray. (Read-only)
- @type hitObject: L{KX_GameObject}
- @ivar hitPosition: The position (in worldcoordinates) where the object was hit by the ray. (Read-only)
- @type hitPosition: list [x, y, z]
- @ivar hitNormal: The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (Read-only)
- @type hitNormal: list [x, y, z]
- @ivar rayDirection: The direction from the ray (in worldcoordinates). (Read-only)
- @type rayDirection: list [x, y, z]
- @ivar axis: The axis the ray is pointing on.
- @type axis: int from 0 to 5
- KX_RAY_AXIS_POS_X, KX_RAY_AXIS_POS_Y, KX_RAY_AXIS_POS_Z,
- KX_RAY_AXIS_NEG_X, KX_RAY_AXIS_NEG_Y, KX_RAY_AXIS_NEG_Z
- """
-#{ Deprecated
- def getHitObject():
- """
- Returns the game object that was hit by this ray.
-
- @deprecated: Use the L{hitObject} attribute instead.
- @rtype: L{KX_GameObject}
- """
- def getHitPosition():
- """
- Returns the position (in worldcoordinates) where the object was hit by this ray.
-
- @deprecated: Use the L{hitPosition} attribute instead.
- @rtype: list [x, y, z]
- """
- def getHitNormal():
- """
- Returns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray.
-
- @deprecated: Use the L{hitNormal} attribute instead.
- @rtype: list [nx, ny, nz]
- """
- def getRayDirection():
- """
- Returns the direction from the ray (in worldcoordinates)
-
- @deprecated: Use the L{rayDirection} attribute instead.
- @rtype: list [dx, dy, dz]
- """
-#}
-
-class KX_SCA_AddObjectActuator(SCA_IActuator):
- """
- Edit Object Actuator (in Add Object Mode)
- @ivar object: the object this actuator adds.
- @type object: L{KX_GameObject} or None
- @ivar objectLastCreated: the last added object from this actuator (read-only).
- @type objectLastCreated: L{KX_GameObject} or None
- @ivar time: the lifetime of added objects, in frames. Set to 0 to disable automatic deletion.
- @type time: integer
- @ivar linearVelocity: the initial linear velocity of added objects.
- @type linearVelocity: list [vx, vy, vz]
- @ivar angularVelocity: the initial angular velocity of added objects.
- @type angularVelocity: list [vx, vy, vz]
-
- @warning: An Add Object actuator will be ignored if at game start, the linked object doesn't exist
- (or is empty) or the linked object is in an active layer.
-
- This will genereate a warning in the console:
-
- C{ERROR: GameObject I{Name} has a AddObjectActuator I{ActuatorName} without object (in 'nonactive' layer)}
- """
-#{Deprecated
- def setObject(object):
- """
- Sets the game object to add.
-
- A copy of the object will be added to the scene when the actuator is activated.
-
- If the object does not exist, this function is ignored.
-
- object can either be a L{KX_GameObject} or the name of an object or None.
-
- @deprecated: use the L{object} property
- @type object: L{KX_GameObject}, string or None
- """
- def getObject(name_only = 0):
- """
- Returns the name of the game object to be added.
-
- Returns None if no game object has been assigned to be added.
-
- @deprecated: use the L{object} property
- @type name_only: bool
- @param name_only: optional argument, when 0 return a KX_GameObject
- @rtype: string, L{KX_GameObject} or None if no object is set
- """
- def setTime(time):
- """
- Sets the lifetime of added objects, in frames.
-
- If time == 0, the object will last forever.
-
- @deprecated: use the L{time} property
- @type time: integer
- @param time: The minimum value for time is 0.
- """
- def getTime():
- """
- Returns the lifetime of the added object, in frames.
-
- @deprecated: use the L{time} property
- @rtype: integer
- """
- def setLinearVelocity(vx, vy, vz):
- """
- Sets the initial linear velocity of added objects.
-
- @deprecated: use the L{linearVelocity} property
- @type vx: float
- @param vx: the x component of the initial linear velocity.
- @type vy: float
- @param vy: the y component of the initial linear velocity.
- @type vz: float
- @param vz: the z component of the initial linear velocity.
- """
- def getLinearVelocity():
- """
- Returns the initial linear velocity of added objects.
-
- @deprecated: use the L{linearVelocity} property
- @rtype: list [vx, vy, vz]
- """
- def setAngularVelocity(vx, vy, vz):
- """
- Sets the initial angular velocity of added objects.
-
- @deprecated: use the L{angularVelocity} property
- @type vx: float
- @param vx: the x component of the initial angular velocity.
- @type vy: float
- @param vy: the y component of the initial angular velocity.
- @type vz: float
- @param vz: the z component of the initial angular velocity.
- """
- def getAngularVelocity():
- """
- Returns the initial angular velocity of added objects.
-
- @deprecated: use the L{angularVelocity} property
- @rtype: list [vx, vy, vz]
- """
- def getLastCreatedObject():
- """
- Returns the last object created by this actuator.
-
- @deprecated: use the L{objectLastCreated} property
- @rtype: L{KX_GameObject}
- @return: A L{KX_GameObject} or None if no object has been created.
- """
-#}
- def instantAddObject():
- """
- Returns the last object created by this actuator. The object can then be accessed from L{objectLastCreated}.
-
- @rtype: None
- """
-
-class KX_SCA_DynamicActuator(SCA_IActuator):
- """
- Dynamic Actuator.
- @ivar mode: the type of operation of the actuator, 0-4
- KX_DYN_RESTORE_DYNAMICS, KX_DYN_DISABLE_DYNAMICS,
- KX_DYN_ENABLE_RIGID_BODY, KX_DYN_DISABLE_RIGID_BODY, KX_DYN_SET_MASS
- @type mode: integer
- @ivar mass: the mass value for the KX_DYN_SET_MASS operation
- @type mass: float
- """
-#{ Deprecated
- def setOperation(operation):
- """
- Set the type of operation when the actuator is activated:
- - 0 = restore dynamics
- - 1 = disable dynamics
- - 2 = enable rigid body
- - 3 = disable rigid body
- - 4 = set mass
-
- @deprecated: Use the L{mode} attribute instead.
- """
- def getOperation():
- """
- return the type of operation
- @deprecated: Use the L{mode} attribute instead.
- """
-#}
-
-class KX_SCA_EndObjectActuator(SCA_IActuator):
- """
- Edit Object Actuator (in End Object mode)
-
- This actuator has no python methods.
- """
-
-class KX_SCA_ReplaceMeshActuator(SCA_IActuator):
- """
- Edit Object actuator, in Replace Mesh mode.
-
- Example::
- # Level-of-detail
- # Switch a game object's mesh based on its depth in the camera view.
- # +----------+ +-----------+ +-------------------------------------+
- # | Always +-----+ Python +-----+ Edit Object (Replace Mesh) LOD.Mesh |
- # +----------+ +-----------+ +-------------------------------------+
- import GameLogic
-
- # List detail meshes here
- # Mesh (name, near, far)
- # Meshes overlap so that they don't 'pop' when on the edge of the distance.
- meshes = ((".Hi", 0.0, -20.0),
- (".Med", -15.0, -50.0),
- (".Lo", -40.0, -100.0)
- )
-
- co = GameLogic.getCurrentController()
- obj = co.owner
- act = co.actuators["LOD." + obj.name]
- cam = GameLogic.getCurrentScene().active_camera
-
- def Depth(pos, plane):
- return pos[0]*plane[0] + pos[1]*plane[1] + pos[2]*plane[2] + plane[3]
-
- # Depth is negative and decreasing further from the camera
- depth = Depth(obj.position, cam.world_to_camera[2])
-
- newmesh = None
- curmesh = None
- # Find the lowest detail mesh for depth
- for mesh in meshes:
- if depth < mesh[1] and depth > mesh[2]:
- newmesh = mesh
- if "ME" + obj.name + mesh[0] == act.getMesh():
- curmesh = mesh
-
- if newmesh != None and "ME" + obj.name + newmesh[0] != act.getMesh():
- # The mesh is a different mesh - switch it.
- # Check the current mesh is not a better fit.
- if curmesh == None or curmesh[1] < depth or curmesh[2] > depth:
- act.mesh = obj.getName() + newmesh[0]
- GameLogic.addActiveActuator(act, True)
-
- @warning: Replace mesh actuators will be ignored if at game start, the
- named mesh doesn't exist.
-
- This will generate a warning in the console:
-
- C{ERROR: GameObject I{Name} ReplaceMeshActuator I{ActuatorName} without object}
-
- @ivar mesh: L{KX_MeshProxy} or the name of the mesh that will replace the current one
- Set to None to disable actuator
- @type mesh: L{KX_MeshProxy} or None if no mesh is set
-
- @ivar useDisplayMesh: when true the displayed mesh is replaced.
- @type useDisplayMesh: boolean
- @ivar usePhysicsMesh: when true the physics mesh is replaced.
- @type usePhysicsMesh: boolean
- """
- def setMesh(name):
- """
- Sets the name of the mesh that will replace the current one.
- When the name is None it will unset the mesh value so no action is taken.
-
- @deprecated: Use the L{mesh} attribute instead.
- @type name: string or None
- """
- def getMesh():
- """
- Returns the name of the mesh that will replace the current one.
-
- Returns None if no mesh has been scheduled to be added.
-
- @deprecated: Use the L{mesh} attribute instead.
- @rtype: string or None
- """
- def instantReplaceMesh():
- """
- Immediately replace mesh without delay.
- @rtype: None
- """
-
-class KX_Scene(PyObjectPlus):
- """
- An active scene that gives access to objects, cameras, lights and scene attributes.
-
- The activity culling stuff is supposed to disable logic bricks when their owner gets too far
- from the active camera. It was taken from some code lurking at the back of KX_Scene - who knows
- what it does!
-
- Example::
- import GameLogic
-
- # get the scene
- scene = GameLogic.getCurrentScene()
-
- # print all the objects in the scene
- for obj in scene.objects:
- print obj.name
-
- # get an object named 'Cube'
- obj = scene.objects["Cube"]
-
- # get the first object in the scene.
- obj = scene.objects[0]
-
- Example::
- # Get the depth of an object in the camera view.
- import GameLogic
-
- obj = GameLogic.getCurrentController().owner
- cam = GameLogic.getCurrentScene().active_camera
-
- # Depth is negative and decreasing further from the camera
- depth = obj.position[0]*cam.world_to_camera[2][0] + obj.position[1]*cam.world_to_camera[2][1] + obj.position[2]*cam.world_to_camera[2][2] + cam.world_to_camera[2][3]
-
- @bug: All attributes are read only at the moment.
-
- @ivar name: The scene's name, (read-only).
- @type name: string
- @ivar objects: A list of objects in the scene, (read-only).
- @type objects: L{CListValue} of L{KX_GameObject}
- @ivar objectsInactive: A list of objects on background layers (used for the addObject actuator), (read-only).
- @type objectsInactive: L{CListValue} of L{KX_GameObject}
- @ivar lights: A list of lights in the scene, (read-only).
- @type lights: L{CListValue} of L{KX_LightObject}
- @ivar cameras: A list of cameras in the scene, (read-only).
- @type cameras: L{CListValue} of L{KX_Camera}
- @ivar active_camera: The current active camera.
- note: this can be set directly from python to avoid using the L{KX_SceneActuator}.
- @type active_camera: L{KX_Camera}
- @ivar suspended: True if the scene is suspended, (read-only).
- @type suspended: boolean
- @ivar activity_culling: True if the scene is activity culling
- @type activity_culling: boolean
- @ivar activity_culling_radius: The distance outside which to do activity culling. Measured in manhattan distance.
- @type activity_culling_radius: float
- @ivar dbvt_culling: True when Dynamic Bounding box Volume Tree is set (read-only).
- @type dbvt_culling: bool
- @ivar pre_draw: A list of callables to be run before the render step.
- @type pre_draw: list
- @ivar post_draw: A list of callables to be run after the render step.
- @type post_draw: list
- @group Deprecated: getLightList, getObjectList, getName
- """
-
- def getLightList():
- """
- Returns the list of lights in the scene.
-
- @deprecated: Use the L{lights} attribute instead.
- @rtype: list [L{KX_LightObject}]
- """
- def getObjectList():
- """
- Returns the list of objects in the scene.
-
- @deprecated: Use the L{objects} attribute instead.
- @rtype: list [L{KX_GameObject}]
- """
- def getName():
- """
- Returns the name of the scene.
-
- @deprecated: Use the L{name} attribute instead.
- @rtype: string
- """
-
- def addObject(object, other, time=0):
- """
- Adds an object to the scene like the Add Object Actuator would, and returns the created object.
-
- @param object: The object to add
- @type object: L{KX_GameObject} or string
- @param other: The object's center to use when adding the object
- @type other: L{KX_GameObject} or string
- @param time: The lifetime of the added object, in frames. A time of 0 means the object will last forever.
- @type time: int
-
- @rtype: L{KX_GameObject}
- """
-
- def end():
- """
- Removes the scene from the game.
- """
-
- def restart():
- """
- Restarts the scene.
- """
-
- def replace(scene):
- """
- Replaces this scene with another one.
-
- @param scene: The name of the scene to replace this scene with.
- @type scene: string
- """
-
- def suspend():
- """
- Suspends this scene.
- """
-
- def resume():
- """
- Resume this scene.
- """
-
- def get(key, default=None):
- """
- Return the value matching key, or the default value if its not found.
- @return: The key value or a default.
- """
-
-class KX_SceneActuator(SCA_IActuator):
- """
- Scene Actuator logic brick.
-
- @warning: Scene actuators that use a scene name will be ignored if at game start, the
- named scene doesn't exist or is empty
-
- This will generate a warning in the console:
-
- C{ERROR: GameObject I{Name} has a SceneActuator I{ActuatorName} (SetScene) without scene}
-
- @ivar scene: the name of the scene to change to/overlay/underlay/remove/suspend/resume
- @type scene: string.
- @ivar camera: the camera to change to.
- When setting the attribute, you can use either a L{KX_Camera} or the name of the camera.
- @type camera: L{KX_Camera} on read, string or L{KX_Camera} on write
- @ivar useRestart: Set flag to True to restart the sene
- @type useRestart: bool
- @ivar mode: The mode of the actuator
- @type mode: int from 0 to 5 L{GameLogic.Scene Actuator}
- """
-#{ Deprecated
- def setUseRestart(flag):
- """
- Set flag to True to restart the scene.
-
- @deprecated: Use the L{useRestart} attribute instead.
- @type flag: boolean
- """
- def setScene(scene):
- """
- Sets the name of the scene to change to/overlay/underlay/remove/suspend/resume.
-
- @deprecated: use the L{scene} attribute instead.
- @type scene: string
- """
- def setCamera(camera):
- """
- Sets the camera to change to.
-
- Camera can be either a L{KX_Camera} or the name of the camera.
-
- @deprecated: use the L{camera} attribute instead.
- @type camera: L{KX_Camera} or string
- """
- def getUseRestart():
- """
- Returns True if the scene will be restarted.
-
- @deprecated: use the L{useRestart} attribute instead.
- @rtype: boolean
- """
- def getScene():
- """
- Returns the name of the scene to change to/overlay/underlay/remove/suspend/resume.
-
- Returns an empty string ("") if no scene has been set.
-
- @deprecated: use the L{scene} attribute instead.
- @rtype: string
- """
- def getCamera():
- """
- Returns the name of the camera to change to.
-
- @deprecated: use the L{camera} attribute instead.
- @rtype: string
- """
-#}
-
-class KX_SoundActuator(SCA_IActuator):
- """
- Sound Actuator.
-
- The L{startSound()}, L{pauseSound()} and L{stopSound()} do not require
- the actuator to be activated - they act instantly provided that the actuator has
- been activated once at least.
-
- @ivar fileName: The filename of the sound this actuator plays.
- @type fileName: string
-
- @ivar volume: The volume (gain) of the sound.
- @type volume: float
-
- @ivar pitch: The pitch of the sound.
- @type pitch: float
-
- @ivar rollOffFactor: The roll off factor. Rolloff defines the rate of attenuation as the sound gets further away.
- @type rollOffFactor: float
-
- @ivar looping: The loop mode of the actuator.
- @type looping: integer
-
- @ivar position: The position of the sound as a list: [x, y, z].
- @type position: float array
-
- @ivar velocity: The velocity of the emitter as a list: [x, y, z]. The relative velocity to the observer determines the pitch. List of 3 floats: [x, y, z].
- @type velocity: float array
-
- @ivar orientation: The orientation of the sound. When setting the orientation you can also use quaternion [float,float,float,float] or euler angles [float,float,float]
- @type orientation: 3x3 matrix [[float]]
-
- @ivar mode: The operation mode of the actuator. You can use one of the following constants:
- - KX_SOUNDACT_PLAYSTOP (1)
- - KX_SOUNDACT_PLAYEND (2)
- - KX_SOUNDACT_LOOPSTOP (3)
- - KX_SOUNDACT_LOOPEND (4)
- - KX_SOUNDACT_LOOPBIDIRECTIONAL (5)
- - KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP (6)
- @type mode: integer
- """
-
-#{ Play Methods
- def startSound():
- """
- Starts the sound.
- """
- def pauseSound():
- """
- Pauses the sound.
- """
- def stopSound():
- """
- Stops the sound.
- """
-#}
-
-#{ Deprecated
- def setFilename(filename):
- """
- Sets the filename of the sound this actuator plays.
-
- @deprecated: Use the L{fileName} attribute instead.
- @type filename: string
- """
- def getFilename():
- """
- Returns the filename of the sound this actuator plays.
-
- @deprecated: Use the L{fileName} attribute instead.
- @rtype: string
- """
- def setGain(gain):
- """
- Sets the gain (volume) of the sound
-
- @deprecated: Use the L{volume} attribute instead.
- @type gain: float
- @param gain: 0.0 (quiet) <= gain <= 1.0 (loud)
- """
- def getGain():
- """
- Gets the gain (volume) of the sound.
-
- @deprecated: Use the L{volume} attribute instead.
- @rtype: float
- """
- def setPitch(pitch):
- """
- Sets the pitch of the sound.
-
- @deprecated: Use the L{pitch} attribute instead.
- @type pitch: float
- """
- def getPitch():
- """
- Returns the pitch of the sound.
-
- @deprecated: Use the L{pitch} attribute instead.
- @rtype: float
- """
- def setRollOffFactor(rolloff):
- """
- Sets the rolloff factor for the sounds.
-
- Rolloff defines the rate of attenuation as the sound gets further away.
- Higher rolloff factors shorten the distance at which the sound can be heard.
-
- @deprecated: Use the L{rollOffFactor} attribute instead.
- @type rolloff: float
- """
- def getRollOffFactor():
- """
- Returns the rolloff factor for the sound.
-
- @deprecated: Use the L{rollOffFactor} attribute instead.
- @rtype: float
- """
- def setLooping(loop):
- """
- Sets the loop mode of the actuator.
-
- @bug: There are no constants defined for this method!
- @param loop: - Play Stop 1
- - Play End 2
- - Loop Stop 3
- - Loop End 4
- - Bidirection Stop 5
- - Bidirection End 6
-
- @deprecated: Use the L{looping} attribute instead.
- @type loop: integer
- """
- def getLooping():
- """
- Returns the current loop mode of the actuator.
-
- @deprecated: Use the L{looping} attribute instead.
- @rtype: integer
- """
- def setPosition(x, y, z):
- """
- Sets the position this sound will come from.
-
- @deprecated: Use the L{position} attribute instead.
- @type x: float
- @param x: The x coordinate of the sound.
- @type y: float
- @param y: The y coordinate of the sound.
- @type z: float
- @param z: The z coordinate of the sound.
- """
- def setVelocity(vx, vy, vz):
- """
- Sets the velocity this sound is moving at.
-
- The sound's pitch is determined from the velocity.
-
- @deprecated: Use the L{velocity} attribute instead.
- @type vx: float
- @param vx: The vx coordinate of the sound.
- @type vy: float
- @param vy: The vy coordinate of the sound.
- @type vz: float
- @param vz: The vz coordinate of the sound.
- """
- def setOrientation(o11, o12, o13, o21, o22, o23, o31, o32, o33):
- """
- Sets the orientation of the sound.
-
- The nine parameters specify a rotation matrix::
- | o11, o12, o13 |
- | o21, o22, o23 |
- | o31, o32, o33 |
- @deprecated: Use the L{orientation} attribute instead.
- """
-
- def setType(mode):
- """
- Sets the operation mode of the actuator.
-
- @deprecated: Use the L{type} attribute instead.
- @param mode: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP
- @type mode: integer
- """
-
- def getType():
- """
- Returns the operation mode of the actuator.
-
- @deprecated: Use the L{type} attribute instead.
- @rtype: integer
- @return: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP
- """
-#}
-
-class KX_StateActuator(SCA_IActuator):
- """
- State actuator changes the state mask of parent object.
-
- Property:
-
- @ivar operation: type of bit operation to be applied on object state mask.
- You can use one of the following constant:
- - KX_STATE_OP_CPY (0) : Copy state mask
- - KX_STATE_OP_SET (1) : Add bits to state mask
- - KX_STATE_OP_CLR (2) : Substract bits to state mask
- - KX_STATE_OP_NEG (3) : Invert bits to state mask
- @type operation: integer
-
- @ivar mask: value that defines the bits that will be modified by the operation.
- The bits that are 1 in the mask will be updated in the object state,
- the bits that are 0 are will be left unmodified expect for the Copy operation
- which copies the mask to the object state
- @type mask: integer
- """
- def setOperation(op):
- """
- Set the type of bit operation to be applied on object state mask.
- Use setMask() to specify the bits that will be modified.
-
- @deprecated: Use the L{operation} attribute instead.
- @param op: bit operation (0=Copy, 1=Add, 2=Substract, 3=Invert)
- @type op: integer
- """
- def setMask(mask):
- """
- Set the value that defines the bits that will be modified by the operation.
- The bits that are 1 in the value will be updated in the object state,
- the bits that are 0 are will be left unmodified expect for the Copy operation
- which copies the value to the object state.
-
- @deprecated: Use the L{mask} attribute instead.
- @param mask: bits that will be modified
- @type mask: integer
- """
-
-class KX_TrackToActuator(SCA_IActuator):
- """
- Edit Object actuator in Track To mode.
-
- @warning: Track To Actuators will be ignored if at game start, the
- object to track to is invalid.
-
- This will generate a warning in the console:
-
- C{ERROR: GameObject I{Name} no object in EditObjectActuator I{ActuatorName}}
-
- @ivar object: the object this actuator tracks.
- @type object: L{KX_GameObject} or None
- @ivar time: the time in frames with which to delay the tracking motion
- @type time: integer
- @ivar use3D: the tracking motion to use 3D
- @type use3D: boolean
-
- """
-#{ Deprecated
- def setObject(object):
- """
- Sets the object to track.
-
- @deprecated: Use the L{object} attribute instead.
- @type object: L{KX_GameObject}, string or None
- @param object: Either a reference to a game object or the name of the object to track.
- """
- def getObject(name_only):
- """
- Returns the name of the object to track.
-
- @deprecated: Use the L{object} attribute instead.
- @type name_only: bool
- @param name_only: optional argument, when 0 return a KX_GameObject
- @rtype: string, L{KX_GameObject} or None if no object is set
- """
- def setTime(time):
- """
- Sets the time in frames with which to delay the tracking motion.
-
- @deprecated: Use the L{time} attribute instead.
- @type time: integer
- """
- def getTime():
- """
- Returns the time in frames with which the tracking motion is delayed.
-
- @deprecated: Use the L{time} attribute instead.
- @rtype: integer
- """
- def setUse3D(use3d):
- """
- DEPRECATED: Use the property.
- Sets the tracking motion to use 3D.
-
- @deprecated: Use the L{use3D} attribute instead.
- @type use3d: boolean
- @param use3d: - True: allow the tracking motion to extend in the z-direction.
- - False: lock the tracking motion to the x-y plane.
- """
- def getUse3D():
- """
- Returns True if the tracking motion will track in the z direction.
-
- @deprecated: Use the L{use3D} attribute instead.
- @rtype: boolean
- """
-#}
-
-class KX_VehicleWrapper(PyObjectPlus):
- """
- KX_VehicleWrapper
-
- TODO - description
- """
-
- def addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering):
-
- """
- Add a wheel to the vehicle
-
- @param wheel: The object to use as a wheel.
- @type wheel: L{KX_GameObject} or a KX_GameObject name
- @param attachPos: The position that this wheel will attach to.
- @type attachPos: vector of 3 floats
- @param attachDir: The direction this wheel points.
- @type attachDir: vector of 3 floats
- @param axleDir: The direction of this wheels axle.
- @type axleDir: vector of 3 floats
- @param suspensionRestLength: TODO - Description
- @type suspensionRestLength: float
- @param wheelRadius: The size of the wheel.
- @type wheelRadius: float
- """
-
- def applyBraking(force, wheelIndex):
- """
- Apply a braking force to the specified wheel
-
- @param force: the brake force
- @type force: float
-
- @param wheelIndex: index of the wheel where the force needs to be applied
- @type wheelIndex: integer
- """
- def applyEngineForce(force, wheelIndex):
- """
- Apply an engine force to the specified wheel
-
- @param force: the engine force
- @type force: float
-
- @param wheelIndex: index of the wheel where the force needs to be applied
- @type wheelIndex: integer
- """
- def getConstraintId():
- """
- Get the constraint ID
-
- @rtype: integer
- @return: the constraint id
- """
- def getConstraintType():
- """
- Returns the constraint type.
-
- @rtype: integer
- @return: constraint type
- """
- def getNumWheels():
- """
- Returns the number of wheels.
-
- @rtype: integer
- @return: the number of wheels for this vehicle
- """
- def getWheelOrientationQuaternion(wheelIndex):
- """
- Returns the wheel orientation as a quaternion.
-
- @param wheelIndex: the wheel index
- @type wheelIndex: integer
-
- @rtype: TODO - type should be quat as per method name but from the code it looks like a matrix
- @return: TODO Description
- """
- def getWheelPosition(wheelIndex):
- """
- Returns the position of the specified wheel
-
- @param wheelIndex: the wheel index
- @type wheelIndex: integer
-
- @rtype: list[x, y, z]
- @return: position vector
- """
- def getWheelRotation(wheelIndex):
- """
- Returns the rotation of the specified wheel
-
- @param wheelIndex: the wheel index
- @type wheelIndex: integer
-
- @rtype: float
- @return: the wheel rotation
- """
- def setRollInfluence(rollInfluece, wheelIndex):
- """
- Set the specified wheel's roll influence.
- The higher the roll influence the more the vehicle will tend to roll over in corners.
-
- @param rollInfluece: the wheel roll influence
- @type rollInfluece: float
-
- @param wheelIndex: the wheel index
- @type wheelIndex: integer
- """
- def setSteeringValue(steering, wheelIndex):
- """
- Set the specified wheel's steering
-
- @param steering: the wheel steering
- @type steering: float
-
- @param wheelIndex: the wheel index
- @type wheelIndex: integer
- """
- def setSuspensionCompression(compression, wheelIndex):
- """
- Set the specified wheel's compression
-
- @param compression: the wheel compression
- @type compression: float
-
- @param wheelIndex: the wheel index
- @type wheelIndex: integer
- """
- def setSuspensionDamping(damping, wheelIndex):
- """
- Set the specified wheel's damping
-
- @param damping: the wheel damping
- @type damping: float
-
- @param wheelIndex: the wheel index
- @type wheelIndex: integer
- """
- def setSuspensionStiffness(stiffness, wheelIndex):
- """
- Set the specified wheel's stiffness
-
- @param stiffness: the wheel stiffness
- @type stiffness: float
-
- @param wheelIndex: the wheel index
- @type wheelIndex: integer
- """
- def setTyreFriction(friction, wheelIndex):
- """
- Set the specified wheel's tyre friction
-
- @param friction: the tyre friction
- @type friction: float
-
- @param wheelIndex: the wheel index
- @type wheelIndex: integer
- """
-
-class KX_VertexProxy(SCA_IObject):
- """
- A vertex holds position, UV, colour and normal information.
-
- Note:
- The physics simulation is NOT currently updated - physics will not respond
- to changes in the vertex position.
-
- @ivar XYZ: The position of the vertex.
- @type XYZ: list [x, y, z]
- @ivar UV: The texture coordinates of the vertex.
- @type UV: list [u, v]
- @ivar normal: The normal of the vertex
- @type normal: list [nx, ny, nz]
- @ivar colour: The colour of the vertex.
- Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0]
- @type colour: list [r, g, b, a]
- @ivar color: Synonym for colour.
-
- @group Position: x, y, z
- @ivar x: The x coordinate of the vertex.
- @type x: float
- @ivar y: The y coordinate of the vertex.
- @type y: float
- @ivar z: The z coordinate of the vertex.
- @type z: float
-
- @group Texture Coordinates: u, v
- @ivar u: The u texture coordinate of the vertex.
- @type u: float
- @ivar v: The v texture coordinate of the vertex.
- @type v: float
-
- @ivar u2: The second u texture coordinate of the vertex.
- @type u2: float
- @ivar v2: The second v texture coordinate of the vertex.
- @type v2: float
-
- @group Colour: r, g, b, a
- @ivar r: The red component of the vertex colour. 0.0 <= r <= 1.0
- @type r: float
- @ivar g: The green component of the vertex colour. 0.0 <= g <= 1.0
- @type g: float
- @ivar b: The blue component of the vertex colour. 0.0 <= b <= 1.0
- @type b: float
- @ivar a: The alpha component of the vertex colour. 0.0 <= a <= 1.0
- @type a: float
- """
-
- def getXYZ():
- """
- Gets the position of this vertex.
-
- @rtype: list [x, y, z]
- @return: this vertexes position in local coordinates.
- """
- def setXYZ(pos):
- """
- Sets the position of this vertex.
-
- @type pos: list [x, y, z]
- @param pos: the new position for this vertex in local coordinates.
- """
- def getUV():
- """
- Gets the UV (texture) coordinates of this vertex.
-
- @rtype: list [u, v]
- @return: this vertexes UV (texture) coordinates.
- """
- def setUV(uv):
- """
- Sets the UV (texture) coordinates of this vertex.
-
- @type uv: list [u, v]
- """
- def getUV2():
- """
- Gets the 2nd UV (texture) coordinates of this vertex.
-
- @rtype: list [u, v]
- @return: this vertexes UV (texture) coordinates.
- """
- def setUV2(uv, unit):
- """
- Sets the 2nd UV (texture) coordinates of this vertex.
-
- @type uv: list [u, v]
- @param unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV
- @param unit: int
- """
- def getRGBA():
- """
- Gets the colour of this vertex.
-
- The colour is represented as four bytes packed into an integer value. The colour is
- packed as RGBA.
-
- Since Python offers no way to get each byte without shifting, you must use the struct module to
- access colour in an machine independent way.
-
- Because of this, it is suggested you use the r, g, b and a attributes or the colour attribute instead.
-
- Example::
- import struct;
- col = struct.unpack('4B', struct.pack('I', v.getRGBA()))
- # col = (r, g, b, a)
- # black = ( 0, 0, 0, 255)
- # white = (255, 255, 255, 255)
-
- @rtype: integer
- @return: packed colour. 4 byte integer with one byte per colour channel in RGBA format.
- """
- def setRGBA(col):
- """
- Sets the colour of this vertex.
-
- See getRGBA() for the format of col, and its relevant problems. Use the r, g, b and a attributes
- or the colour attribute instead.
-
- setRGBA() also accepts a four component list as argument col. The list represents the colour as [r, g, b, a]
- with black = [0.0, 0.0, 0.0, 1.0] and white = [1.0, 1.0, 1.0, 1.0]
-
- Example::
- v.setRGBA(0xff0000ff) # Red
- v.setRGBA(0xff00ff00) # Green on little endian, transparent purple on big endian
- v.setRGBA([1.0, 0.0, 0.0, 1.0]) # Red
- v.setRGBA([0.0, 1.0, 0.0, 1.0]) # Green on all platforms.
-
- @type col: integer or list [r, g, b, a]
- @param col: the new colour of this vertex in packed RGBA format.
- """
- def getNormal():
- """
- Gets the normal vector of this vertex.
-
- @rtype: list [nx, ny, nz]
- @return: normalised normal vector.
- """
- def setNormal(normal):
- """
- Sets the normal vector of this vertex.
-
- @type normal: sequence of floats [r, g, b]
- @param normal: the new normal of this vertex.
- """
-
-class KX_VisibilityActuator(SCA_IActuator):
- """
- Visibility Actuator.
- @ivar visibility: whether the actuator makes its parent object visible or invisible
- @type visibility: boolean
- @ivar useOcclusion: whether the actuator makes its parent object an occluder or not
- @type useOcclusion: boolean
- @ivar useRecursion: whether the visibility/occlusion should be propagated to all children of the object
- @type useRecursion: boolean
- """
-#{ Deprecated
- def set(visible):
- """
- Sets whether the actuator makes its parent object visible or invisible.
-
- @deprecated: Use the L{visibility} attribute instead.
- @param visible: - True: Makes its parent visible.
- - False: Makes its parent invisible.
- """
-#}
-
-class SCA_2DFilterActuator(SCA_IActuator):
- """
- Create, enable and disable 2D filters
-
- Properties:
-
- The following properties don't have an immediate effect.
- You must active the actuator to get the result.
- The actuator is not persistent: it automatically stops itself after setting up the filter
- but the filter remains active. To stop a filter you must activate the actuator with 'type'
- set to RAS_2DFILTER_DISABLED or RAS_2DFILTER_NOFILTER.
-
- @ivar shaderText: shader source code for custom shader
- @type shaderText: string
- @ivar disableMotionBlur: action on motion blur: 0=enable, 1=disable
- @type disableMotionBlur: integer
- @ivar mode: type of 2D filter, use one of the following constants:
- RAS_2DFILTER_ENABLED (-2) : enable the filter that was previously disabled
- RAS_2DFILTER_DISABLED (-1) : disable the filter that is currently active
- RAS_2DFILTER_NOFILTER (0) : disable and destroy the filter that is currently active
- RAS_2DFILTER_MOTIONBLUR (1) : create and enable preset filters
- RAS_2DFILTER_BLUR (2)
- RAS_2DFILTER_SHARPEN (3)
- RAS_2DFILTER_DILATION (4)
- RAS_2DFILTER_EROSION (5)
- RAS_2DFILTER_LAPLACIAN (6)
- RAS_2DFILTER_SOBEL (7)
- RAS_2DFILTER_PREWITT (8)
- RAS_2DFILTER_GRAYSCALE (9)
- RAS_2DFILTER_SEPIA (10)
- RAS_2DFILTER_INVERT (11)
- RAS_2DFILTER_CUSTOMFILTER (12) : customer filter, the code code is set via shaderText property
- @type mode: integer
- @ivar passNumber: order number of filter in the stack of 2D filters. Filters are executed in increasing order of passNb.
- Only be one filter can be defined per passNb.
- @type passNumber: integer (0-100)
- @ivar value: argument for motion blur filter
- @type value: float (0.0-100.0)
- """
-
-class SCA_ANDController(SCA_IController):
- """
- An AND controller activates only when all linked sensors are activated.
-
- There are no special python methods for this controller.
- """
-
-class SCA_ActuatorSensor(SCA_ISensor):
- """
- Actuator sensor detect change in actuator state of the parent object.
- It generates a positive pulse if the corresponding actuator is activated
- and a negative pulse if the actuator is deactivated.
-
- Properties:
-
- @ivar actuator: the name of the actuator that the sensor is monitoring.
- @type actuator: string
- """
-#{Deprecated
- def getActuator():
- """
- Return the Actuator with which the sensor operates.
-
- @deprecated: Use the L{actuator} attribute instead.
- @rtype: string
- """
- def setActuator(name):
- """
- Sets the Actuator with which to operate. If there is no Actuator
- of this name, the function has no effect.
-
- @deprecated: Use the L{actuator} attribute instead.
- @param name: actuator name
- @type name: string
- """
-#}
-
-class SCA_AlwaysSensor(SCA_ISensor):
- """
- This sensor is always activated.
- """
-
-class SCA_DelaySensor(SCA_ISensor):
- """
- The Delay sensor generates positive and negative triggers at precise time,
- expressed in number of frames. The delay parameter defines the length
- of the initial OFF period. A positive trigger is generated at the end of this period.
- The duration parameter defines the length of the ON period following the OFF period.
- There is a negative trigger at the end of the ON period. If duration is 0, the sensor
- stays ON and there is no negative trigger.
- The sensor runs the OFF-ON cycle once unless the repeat option is set: the
- OFF-ON cycle repeats indefinately (or the OFF cycle if duration is 0).
- Use SCA_ISensor::reset() at any time to restart sensor.
-
- Properties:
-
- @ivar delay: length of the initial OFF period as number of frame, 0 for immediate trigger.
- @type delay: integer.
- @ivar duration: length of the ON period in number of frame after the initial OFF period.
- If duration is greater than 0, a negative trigger is sent at the end of the ON pulse.
- @type duration: integer
- @ivar repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once.
- @type repeat: integer
- """
-#{Deprecated
- def setDelay(delay):
- """
- Set the initial delay before the positive trigger.
-
- @deprecated: Use the L{delay} attribute instead.
- @param delay: length of the initial OFF period as number of frame, 0 for immediate trigger
- @type delay: integer
- """
- def setDuration(duration):
- """
- Set the duration of the ON pulse after initial delay and the generation of the positive trigger.
- If duration is greater than 0, a negative trigger is sent at the end of the ON pulse.
-
- @deprecated: Use the L{duration} attribute instead.
- @param duration: length of the ON period in number of frame after the initial OFF period
- @type duration: integer
- """
- def setRepeat(repeat):
- """
- Set if the sensor repeat mode.
-
- @deprecated: Use the L{repeat} attribute instead.
- @param repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once.
- @type repeat: integer
- """
- def getDelay():
- """
- Return the delay parameter value.
-
- @deprecated: Use the L{delay} attribute instead.
- @rtype: integer
- """
- def getDuration():
- """
- Return the duration parameter value
-
- @deprecated: Use the L{duration} attribute instead.
- @rtype: integer
- """
- def getRepeat():
- """
- Return the repeat parameter value
-
- @deprecated: Use the L{repeat} attribute instead.
- @rtype: KX_TRUE or KX_FALSE
- """
-#}
-
-class SCA_JoystickSensor(SCA_ISensor):
- """
- This sensor detects player joystick events.
-
- Properties:
-
- @ivar axisValues: (read-only) The state of the joysticks axis as a list of values L{numAxis} long.
- each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing.
- The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
- left:[-32767, 0, ...], right:[32767, 0, ...], up:[0, -32767, ...], down:[0, 32767, ...]
- @type axisValues: list of ints
-
- @ivar axisSingle: (read-only) like L{axisValues} but returns a single axis value that is set by the sensor.
- Only use this for "Single Axis" type sensors otherwise it will raise an error.
- @type axisSingle: int
-
- @ivar hatValues: (read-only) The state of the joysticks hats as a list of values L{numHats} long.
- each spesifying the direction of the hat from 1 to 12, 0 when inactive.
- Hat directions are as follows...
- - 0:None
- - 1:Up
- - 2:Right
- - 4:Down
- - 8:Left
- - 3:Up - Right
- - 6:Down - Right
- - 12:Down - Left
- - 9:Up - Left
-
- @type hatValues: list of ints
-
- @ivar hatSingle: (read-only) like L{hatValues} but returns a single hat direction value that is set by the sensor.
- @type hatSingle: int
-
- @ivar numAxis: (read-only) The number of axes for the joystick at this index.
- @type numAxis: integer
- @ivar numButtons: (read-only) The number of buttons for the joystick at this index.
- @type numButtons: integer
- @ivar numHats: (read-only) The number of hats for the joystick at this index.
- @type numHats: integer
- @ivar connected: (read-only) True if a joystick is connected at this joysticks index.
- @type connected: boolean
- @ivar index: The joystick index to use (from 0 to 7). The first joystick is always 0.
- @type index: integer
- @ivar threshold: Axis threshold. Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive.
- @type threshold: integer
- @ivar button: The button index the sensor reacts to (first button = 0). When the "All Events" toggle is set, this option has no effect.
- @type button: integer
- @ivar axis: The axis this sensor reacts to, as a list of two values [axisIndex, axisDirection]
- axisIndex: the axis index to use when detecting axis movement, 1=primary directional control, 2=secondary directional control.
- axisDirection: 0=right, 1=up, 2=left, 3=down
- @type axis: [integer, integer]
- @ivar hat: The hat the sensor reacts to, as a list of two values: [hatIndex, hatDirection]
- hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat (4 max).
- hatDirection: 1-12
- @type hat: [integer, integer]
- """
-
- def getButtonActiveList():
- """
- Returns a list containing the indicies of the currently pressed buttons.
- @rtype: list
- """
- def getButtonStatus(buttonIndex):
- """
- Returns a bool of the current pressed state of the specified button.
- @param buttonIndex: the button index, 0=first button
- @type buttonIndex: integer
- @rtype: bool
- """
-#{Deprecated
- def getIndex():
- """
- Returns the joystick index to use (from 1 to 8).
-
- @deprecated: Use the L{index} attribute instead.
- @rtype: integer
- """
- def setIndex(index):
- """
- Sets the joystick index to use.
-
- @deprecated: Use the L{index} attribute instead.
- @param index: The index of this joystick sensor, Clamped between 1 and 8.
- @type index: integer
- @note: This is only useful when you have more then 1 joystick connected to your computer - multiplayer games.
- """
- def getAxis():
- """
- Returns the current axis this sensor reacts to. See L{getAxisValue()<SCA_JoystickSensor.getAxisValue>} for the current axis state.
-
- @deprecated: Use the L{axis} attribute instead.
- @rtype: list
- @return: 2 values returned are [axisIndex, axisDirection] - see L{setAxis()<SCA_JoystickSensor.setAxis>} for their purpose.
- @note: When the "All Events" toggle is set, this option has no effect.
- """
- def setAxis(axisIndex, axisDirection):
- """
- @deprecated: Use the L{axis} attribute instead.
- @param axisIndex: Set the axis index to use when detecting axis movement.
- @type axisIndex: integer from 1 to 2
- @param axisDirection: Set the axis direction used for detecting motion. 0:right, 1:up, 2:left, 3:down.
- @type axisDirection: integer from 0 to 3
- @note: When the "All Events" toggle is set, this option has no effect.
- """
- def getAxisValue():
- """
- Returns the state of the joysticks axis. See differs to L{getAxis()<SCA_JoystickSensor.getAxis>} returning the current state of the joystick.
-
- @deprecated: Use the L{axisValues} attribute instead.
- @rtype: list
- @return: 4 values, each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing.
-
- The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
-
- left:[-32767, 0, ...], right:[32767, 0, ...], up:[0, -32767, ...], down:[0, 32767, ...]
- @note: Some gamepads only set the axis on and off like a button.
- """
- def getThreshold():
- """
- Get the axis threshold. See L{setThreshold()<SCA_JoystickSensor.setThreshold>} for details.
-
- @deprecated: Use the L{threshold} attribute instead.
- @rtype: integer
- """
- def setThreshold(threshold):
- """
- Set the axis threshold.
-
- @deprecated: Use the L{threshold} attribute instead.
- @param threshold: Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive.
- @type threshold: integer
- """
- def getButton():
- """
- Returns the button index the sensor reacts to. See L{getButtonValue()<SCA_JoystickSensor.getButtonValue>} for a list of pressed buttons.
-
- @deprecated: Use the L{button} attribute instead.
- @rtype: integer
- @note: When the "All Events" toggle is set, this option has no effect.
- """
- def setButton(index):
- """
- Sets the button index the sensor reacts to when the "All Events" option is not set.
-
- @deprecated: Use the L{button} attribute instead.
- @note: When the "All Events" toggle is set, this option has no effect.
- """
- def getButtonValue():
- """
- Returns a list containing the indicies of the currently pressed buttons.
-
- @deprecated: Use the L{getButtonActiveList} method instead.
- @rtype: list
- """
- def getHat():
- """
- Returns the current hat direction this sensor is set to.
- [hatNumber, hatDirection].
-
- @deprecated: Use the L{hat} attribute instead.
- @rtype: list
- @note: When the "All Events" toggle is set, this option has no effect.
- """
- def setHat(index,direction):
- """
- Sets the hat index the sensor reacts to when the "All Events" option is not set.
-
- @deprecated: Use the L{hat} attribute instead.
- @type index: integer
- """
- def getNumAxes():
- """
- Returns the number of axes for the joystick at this index.
-
- @deprecated: Use the L{numAxis} attribute instead.
- @rtype: integer
- """
- def getNumButtons():
- """
- Returns the number of buttons for the joystick at this index.
-
- @deprecated: Use the L{numButtons} attribute instead.
- @rtype: integer
- """
- def getNumHats():
- """
- Returns the number of hats for the joystick at this index.
-
- @deprecated: Use the L{numHats} attribute instead.
- @rtype: integer
- """
- def isConnected():
- """
- Returns True if a joystick is detected at this joysticks index.
-
- @deprecated: Use the L{connected} attribute instead.
- @rtype: bool
- """
-#}
-
-class SCA_KeyboardSensor(SCA_ISensor):
- """
- A keyboard sensor detects player key presses.
-
- See module L{GameKeys} for keycode values.
-
- @ivar key: The key code this sensor is looking for.
- @type key: keycode from L{GameKeys} module
- @ivar hold1: The key code for the first modifier this sensor is looking for.
- @type hold1: keycode from L{GameKeys} module
- @ivar hold2: The key code for the second modifier this sensor is looking for.
- @type hold2: keycode from L{GameKeys} module
- @ivar toggleProperty: The name of the property that indicates whether or not to log keystrokes as a string.
- @type toggleProperty: string
- @ivar targetProperty: The name of the property that receives keystrokes in case in case a string is logged.
- @type targetProperty: string
- @ivar useAllKeys: Flag to determine whether or not to accept all keys.
- @type useAllKeys: boolean
- @ivar events: a list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only).
-
- - 'keycode' matches the values in L{GameKeys}.
- - 'status' uses...
- - L{GameLogic.KX_INPUT_NONE}
- - L{GameLogic.KX_INPUT_JUST_ACTIVATED}
- - L{GameLogic.KX_INPUT_ACTIVE}
- - L{GameLogic.KX_INPUT_JUST_RELEASED}
-
- @type events: list [[keycode, status], ...]
- """
-
- def getKeyStatus(keycode):
- """
- Get the status of a key.
-
- @rtype: key state L{GameLogic} members (KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED)
- @return: The state of the given key
- @type keycode: integer
- @param keycode: The code that represents the key you want to get the state of
- """
-
-#{Deprecated
- def getKey():
- """
- Returns the key code this sensor is looking for.
-
- @deprecated: Use the L{key} attribute instead.
- @rtype: keycode from L{GameKeys} module
- """
-
- def setKey(keycode):
- """
- Set the key this sensor should listen for.
-
- @deprecated: Use the L{key} attribute instead.
- @type keycode: keycode from L{GameKeys} module
- """
-
- def getHold1():
- """
- Returns the key code for the first modifier this sensor is looking for.
-
- @deprecated: Use the L{hold1} attribute instead.
- @rtype: keycode from L{GameKeys} module
- """
-
- def setHold1(keycode):
- """
- Sets the key code for the first modifier this sensor should look for.
-
- @deprecated: Use the L{hold1} attribute instead.
- @type keycode: keycode from L{GameKeys} module
- """
-
- def getHold2():
- """
- Returns the key code for the second modifier this sensor is looking for.
-
- @deprecated: Use the L{hold2} attribute instead.
- @rtype: keycode from L{GameKeys} module
- """
-
- def setHold2(keycode):
- """
- Sets the key code for the second modifier this sensor should look for.
-
- @deprecated: Use the L{hold2} attribute instead.
- @type keycode: keycode from L{GameKeys} module
- """
-
- def getPressedKeys():
- """
- Get a list of keys that have either been pressed, or just released this frame.
-
- @deprecated: Use the L{events} attribute instead.
- @rtype: list of key status. [[keycode, status]]
- """
-
- def getCurrentlyPressedKeys():
- """
- Get a list of currently pressed keys that have either been pressed, or just released
-
- @deprecated: Use the L{events} attribute instead.
- @rtype: list of key status. [[keycode, status]]
- """
-#}
-
-class SCA_NANDController(SCA_IController):
- """
- An NAND controller activates when all linked sensors are not active.
-
- There are no special python methods for this controller.
- """
-
-class SCA_NORController(SCA_IController):
- """
- An NOR controller activates only when all linked sensors are de-activated.
-
- There are no special python methods for this controller.
- """
-
-class SCA_ORController(SCA_IController):
- """
- An OR controller activates when any connected sensor activates.
-
- There are no special python methods for this controller.
- """
-
-class SCA_PropertyActuator(SCA_IActuator):
- """
- Property Actuator
-
- Properties:
-
- @ivar propName: the property on which to operate.
- @type propName: string
- @ivar value: the value with which the actuator operates.
- @type value: string
- @ivar mode: TODO - add constants to game logic dict!.
- @type mode: int
- """
-#{ Deprecated
- def setProperty(prop):
- """
- Set the property on which to operate.
-
- If there is no property of this name, the call is ignored.
-
- @deprecated: Use the L{propName} attribute instead.
- @type prop: string
- @param prop: The name of the property to set.
- """
- def getProperty():
- """
- Returns the name of the property on which to operate.
-
- @deprecated: Use the L{propName} attribute instead.
- @rtype: string
- """
- def setValue(value):
- """
- Set the value with which the actuator operates.
-
- If the value is not compatible with the type of the
- property, the subsequent action is ignored.
-
- @deprecated: Use the L{value} attribute instead.
- @type value: string
- """
- def getValue():
- """
- Gets the value with which this actuator operates.
-
- @deprecated: Use the L{value} attribute instead.
- @rtype: string
- """
-#}
-
-class SCA_PropertySensor(SCA_ISensor):
- """
- Activates when the game object property matches.
-
- Properties:
-
- @ivar mode: type of check on the property:
- KX_PROPSENSOR_EQUAL(1), KX_PROPSENSOR_NOTEQUAL(2), KX_PROPSENSOR_INTERVAL(3),
- KX_PROPSENSOR_CHANGED(4), KX_PROPSENSOR_EXPRESSION(5)
- @type mode: integer
- @ivar propName: the property the sensor operates.
- @type propName: string
- @ivar value: the value with which the sensor compares to the value of the property.
- @type value: string
- @ivar min: the minimum value of the range used to evaluate the property when in interval mode.
- @type min: string
- @ivar max: the maximum value of the range used to evaluate the property when in interval mode.
- @type max: string
- """
-#{ Deprecated
- def getType():
- """
- Gets when to activate this sensor.
-
- @deprecated: Use the L{mode} attribute instead.
- @return: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL,
- KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED,
- or KX_PROPSENSOR_EXPRESSION.
- """
-
- def setType(checktype):
- """
- Set the type of check to perform.
-
- @deprecated: Use the L{mode} attribute instead.
- @type checktype: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL,
- KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED,
- or KX_PROPSENSOR_EXPRESSION.
- """
-
- def getProperty():
- """
- Return the property with which the sensor operates.
-
- @deprecated: Use the L{propName} attribute instead.
- @rtype: string
- @return: the name of the property this sensor is watching.
- """
- def setProperty(name):
- """
- Sets the property with which to operate. If there is no property
- of that name, this call is ignored.
-
- @deprecated: Use the L{propName} attribute instead.
- @type name: string.
- """
- def getValue():
- """
- Return the value with which the sensor compares to the value of the property.
-
- @deprecated: Use the L{value} attribute instead.
- @rtype: string
- @return: the value of the property this sensor is watching.
- """
- def setValue(value):
- """
- Set the value with which the sensor operates. If the value
- is not compatible with the type of the property, the subsequent
- action is ignored.
-
- @deprecated: Use the L{value} attribute instead.
- @type value: string
- """
-#}
-
-class SCA_PythonController(SCA_IController):
- """
- A Python controller uses a Python script to activate it's actuators,
- based on it's sensors.
-
- Properties:
-
- @ivar script: The value of this variable depends on the execution methid.
- - When 'Script' execution mode is set this value contains the entire python script as a single string (not the script name as you might expect) which can be modified to run different scripts.
- - When 'Module' execution mode is set this value will contain a single line string - module name and function "module.func" or "package.modile.func" where the module names are python textblocks or external scripts.
- note: once this is set the script name given for warnings will remain unchanged.
- @type script: string
- @ivar mode: the execution mode for this controller (read-only).
- - Script: 0, Execite the L{script} as a python code.
- - Module: 1, Execite the L{script} as a module and function.
- @type mode: int
-
- @group Deprecated: getScript, setScript
- """
- def activate(actuator):
- """
- Activates an actuator attached to this controller.
- @type actuator: actuator or the actuator name as a string
- """
- def deactivate(actuator):
- """
- Deactivates an actuator attached to this controller.
- @type actuator: actuator or the actuator name as a string
- """
- def getScript():
- """
- Gets the Python script body this controller executes.
-
- @deprecated: Use the L{script} attribute instead.
- @rtype: string
- """
- def setScript(script_body):
- """
- Sets the Python script string this controller executes.
-
- @deprecated: Use the L{script} attribute instead.
- @type script_body: string.
- """
-
-class SCA_RandomActuator(SCA_IActuator):
- """
- Random Actuator
-
- Properties:
-
- @ivar seed: Seed of the random number generator.
- Equal seeds produce equal series. If the seed is 0,
- the generator will produce the same value on every call.
- @type seed: integer
- @ivar para1: the first parameter of the active distribution.
- Refer to the documentation of the generator types for the meaning
- of this value.
- @type para1: float, read-only
- @ivar para2: the second parameter of the active distribution.
- Refer to the documentation of the generator types for the meaning
- of this value.
- @type para2: float, read-only
- @ivar distribution: distribution type:
- KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI,
- KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON,
- KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL,
- KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL
- @type distribution: integer, read-only
- @ivar propName: the name of the property to set with the random value.
- If the generator and property types do not match, the assignment is ignored.
- @type propName: string
-
- """
- def setBoolConst(value):
- """
- Sets this generator to produce a constant boolean value.
-
- @param value: The value to return.
- @type value: boolean
- """
- def setBoolUniform():
- """
- Sets this generator to produce a uniform boolean distribution.
-
- The generator will generate True or False with 50% chance.
- """
- def setBoolBernouilli(value):
- """
- Sets this generator to produce a Bernouilli distribution.
-
- @param value: Specifies the proportion of False values to produce.
- - 0.0: Always generate True
- - 1.0: Always generate False
- @type value: float
- """
- def setIntConst(value):
- """
- Sets this generator to always produce the given value.
-
- @param value: the value this generator produces.
- @type value: integer
- """
- def setIntUniform(lower_bound, upper_bound):
- """
- Sets this generator to produce a random value between the given lower and
- upper bounds (inclusive).
-
- @type lower_bound: integer
- @type upper_bound: integer
- """
- def setIntPoisson(value):
- """
- Generate a Poisson-distributed number.
-
- This performs a series of Bernouilli tests with parameter value.
- It returns the number of tries needed to achieve succes.
-
- @type value: float
- """
- def setFloatConst(value):
- """
- Always generate the given value.
-
- @type value: float
- """
- def setFloatUniform(lower_bound, upper_bound):
- """
- Generates a random float between lower_bound and upper_bound with a
- uniform distribution.
-
- @type lower_bound: float
- @type upper_bound: float
- """
- def setFloatNormal(mean, standard_deviation):
- """
- Generates a random float from the given normal distribution.
-
- @type mean: float
- @param mean: The mean (average) value of the generated numbers
- @type standard_deviation: float
- @param standard_deviation: The standard deviation of the generated numbers.
- """
- def setFloatNegativeExponential(half_life):
- """
- Generate negative-exponentially distributed numbers.
-
- The half-life 'time' is characterized by half_life.
-
- @type half_life: float
- """
-#{ Deprecated
- def setSeed(seed):
- """
- Sets the seed of the random number generator.
-
- Equal seeds produce equal series. If the seed is 0,
- the generator will produce the same value on every call.
-
- @deprecated: Use the L{seed} attribute instead.
- @type seed: integer
- """
- def getSeed():
- """
- Returns the initial seed of the generator.
-
- @deprecated: Use the L{seed} attribute instead.
- @rtype: integer
- """
- def getPara1():
- """
- Returns the first parameter of the active distribution.
-
- Refer to the documentation of the generator types for the meaning
- of this value.
-
- @deprecated: Use the L{para1} attribute instead.
- @rtype: float
- """
- def getPara2():
- """
- Returns the second parameter of the active distribution.
-
- Refer to the documentation of the generator types for the meaning
- of this value.
-
- @deprecated: Use the L{para2} attribute instead.
- @rtype: float
- """
- def getDistribution():
- """
- Returns the type of random distribution.
-
- @deprecated: Use the L{distribution} attribute instead.
- @rtype: distribution type
- @return: KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI,
- KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON,
- KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL,
- KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL
- """
- def setProperty(property):
- """
- Set the property to which the random value is assigned.
-
- If the generator and property types do not match, the assignment is ignored.
-
- @deprecated: Use the L{propName} attribute instead.
- @type property: string
- @param property: The name of the property to set.
- """
- def getProperty():
- """
- Returns the name of the property to set.
-
- @deprecated: Use the L{propName} attribute instead.
- @rtype: string
- """
-#}
-
-
-class SCA_RandomSensor(SCA_ISensor):
- """
- This sensor activates randomly.
-
- @ivar lastDraw: The seed of the random number generator.
- @type lastDraw: int
- @ivar seed: The seed of the random number generator.
- @type seed: int
- """
-
- def setSeed(seed):
- """
- Sets the seed of the random number generator.
-
- If the seed is 0, the generator will produce the same value on every call.
-
- @type seed: integer.
- """
- def getSeed():
- """
- Returns the initial seed of the generator. Equal seeds produce equal random
- series.
-
- @rtype: integer
- """
- def getLastDraw():
- """
- Returns the last random number generated.
-
- @rtype: integer
- """
-
-class SCA_XNORController(SCA_IController):
- """
- An XNOR controller activates when all linked sensors are the same (activated or inative).
-
- There are no special python methods for this controller.
- """
-
-class SCA_XORController(SCA_IController):
- """
- An XOR controller activates when there is the input is mixed, but not when all are on or off.
-
- There are no special python methods for this controller.
- """
-
-class KX_Camera(KX_GameObject):
- """
- A Camera object.
-
- @group Constants: INSIDE, INTERSECT, OUTSIDE
- @ivar INSIDE: see sphereInsideFrustum() and boxInsideFrustum()
- @ivar INTERSECT: see sphereInsideFrustum() and boxInsideFrustum()
- @ivar OUTSIDE: see sphereInsideFrustum() and boxInsideFrustum()
-
- @ivar lens: The camera's lens value.
- @type lens: float
- @ivar near: The camera's near clip distance.
- @type near: float
- @ivar far: The camera's far clip distance.
- @type far: float
- @ivar perspective: True if this camera has a perspective transform, False for an orthographic projection.
- @type perspective: boolean
- @ivar frustum_culling: True if this camera is frustum culling.
- @type frustum_culling: boolean
- @ivar projection_matrix: This camera's 4x4 projection matrix.
- @type projection_matrix: 4x4 Matrix [[float]]
- @ivar modelview_matrix: This camera's 4x4 model view matrix. (read-only)
- Regenerated every frame from the camera's position and orientation.
- @type modelview_matrix: 4x4 Matrix [[float]]
- @ivar camera_to_world: This camera's camera to world transform. (read-only)
- Regenerated every frame from the camera's position and orientation.
- @type camera_to_world: 4x4 Matrix [[float]]
- @ivar world_to_camera: This camera's world to camera transform. (read-only)
- Regenerated every frame from the camera's position and orientation.
- This is camera_to_world inverted.
- @type world_to_camera: 4x4 Matrix [[float]]
- @ivar useViewport: True when the camera is used as a viewport, set True to enable a viewport for this camera.
- @type useViewport: bool
-
- @group Deprecated: enableViewport, getProjectionMatrix, setProjectionMatrix
- """
-
- def sphereInsideFrustum(centre, radius):
- """
- Tests the given sphere against the view frustum.
-
- @note: when the camera is first initialized the result will be invalid because the projection matrix has not been set.
- @param centre: The centre of the sphere (in world coordinates.)
- @type centre: list [x, y, z]
- @param radius: the radius of the sphere
- @type radius: float
- @return: INSIDE, OUTSIDE or INTERSECT
-
- Example::
- import GameLogic
- co = GameLogic.getCurrentController()
- cam = co.owner
-
- # A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0]
- if (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE):
- # Sphere is inside frustum !
- # Do something useful !
- else:
- # Sphere is outside frustum
- """
- def boxInsideFrustum(box):
- """
- Tests the given box against the view frustum.
-
- Example::
- import GameLogic
- co = GameLogic.getCurrentController()
- cam = co.owner
-
- # Box to test...
- box = []
- box.append([-1.0, -1.0, -1.0])
- box.append([-1.0, -1.0, 1.0])
- box.append([-1.0, 1.0, -1.0])
- box.append([-1.0, 1.0, 1.0])
- box.append([ 1.0, -1.0, -1.0])
- box.append([ 1.0, -1.0, 1.0])
- box.append([ 1.0, 1.0, -1.0])
- box.append([ 1.0, 1.0, 1.0])
-
- if (cam.boxInsideFrustum(box) != cam.OUTSIDE):
- # Box is inside/intersects frustum !
- # Do something useful !
- else:
- # Box is outside the frustum !
-
- @note: when the camera is first initialized the result will be invalid because the projection matrix has not been set.
- @return: INSIDE, OUTSIDE or INTERSECT
- @type box: list
- @param box: Eight (8) corner points of the box (in world coordinates.)
- """
- def pointInsideFrustum(point):
- """
- Tests the given point against the view frustum.
-
- Example::
- import GameLogic
- co = GameLogic.getCurrentController()
- cam = co.owner
-
- # Test point [0.0, 0.0, 0.0]
- if (cam.pointInsideFrustum([0.0, 0.0, 0.0])):
- # Point is inside frustum !
- # Do something useful !
- else:
- # Box is outside the frustum !
-
- @note: when the camera is first initialized the result will be invalid because the projection matrix has not been set.
- @rtype: boolean
- @return: True if the given point is inside this camera's viewing frustum.
- @type point: [x, y, z]
- @param point: The point to test (in world coordinates.)
- """
- def getCameraToWorld():
- """
- Returns the camera-to-world transform.
-
- @rtype: matrix (4x4 list)
- @return: the camera-to-world transform matrix.
- """
- def getWorldToCamera():
- """
- Returns the world-to-camera transform.
-
- This returns the inverse matrix of getCameraToWorld().
-
- @rtype: matrix (4x4 list)
- @return: the world-to-camera transform matrix.
- """
- def getProjectionMatrix():
- """
- Returns the camera's projection matrix.
-
- @deprecated: Use the L{projection_matrix} attribute instead.
- @rtype: matrix (4x4 list)
- @return: the camera's projection matrix.
- """
- def setProjectionMatrix(matrix):
- """
- Sets the camera's projection matrix.
-
- You should use normalised device coordinates for the clipping planes:
- left = -1.0, right = 1.0, top = 1.0, bottom = -1.0, near = cam.near, far = cam.far
-
- Example::
- import GameLogic
-
- def Scale(matrix, size):
- for y in range(4):
- for x in range(4):
- matrix[y][x] = matrix[y][x] * size[y]
- return matrix
-
- # Generate a perspective projection matrix
- def Perspective(cam):
- return [[cam.near, 0.0 , 0.0 , 0.0 ],
- [0.0 , cam.near, 0.0 , 0.0 ],
- [0.0 , 0.0 , -(cam.far+cam.near)/(cam.far-cam.near), -2.0*cam.far*cam.near/(cam.far - cam.near)],
- [0.0 , 0.0 , -1.0 , 0.0 ]]
-
- # Generate an orthographic projection matrix
- # You will need to scale the camera
- def Orthographic(cam):
- return [[1.0/cam.scaling[0], 0.0 , 0.0 , 0.0 ],
- [0.0 , 1.0/cam.scaling[1], 0.0 , 0.0 ],
- [0.0 , 0.0 , -2.0/(cam.far-cam.near), -(cam.far+cam.near)/(cam.far-cam.near)],
- [0.0 , 0.0 , 0.0 , 1.0 ]]
-
- # Generate an isometric projection matrix
- def Isometric(cam):
- return Scale([[0.707, 0.0 , 0.707, 0.0],
- [0.408, 0.816,-0.408, 0.0],
- [0.0 , 0.0 , 0.0 , 0.0],
- [0.0 , 0.0 , 0.0 , 1.0]],
- [1.0/cam.scaling[0], 1.0/cam.scaling[1], 1.0/cam.scaling[2], 1.0])
-
- co = GameLogic.getCurrentController()
- cam = co.owner
- cam.setProjectionMatrix(Perspective(cam)))
-
- @deprecated: Use the L{projection_matrix} attribute instead.
- @type matrix: 4x4 matrix.
- @param matrix: The new projection matrix for this camera.
- """
-
- def enableViewport(viewport):
- """
- Use this camera to draw a viewport on the screen (for split screen games or overlay scenes). The viewport region is defined with L{setViewport}.
-
- @deprecated: Use the L{useViewport} attribute instead.
- @type viewport: bool
- @param viewport: the new viewport status
- """
- def setOnTop():
- """
- Set this cameras viewport ontop of all other viewport.
- """
- def setViewport(left, bottom, right, top):
- """
- Sets the region of this viewport on the screen in pixels.
-
- Use L{Rasterizer.getWindowHeight} L{Rasterizer.getWindowWidth} to calculate values relative to the entire display.
-
- @type left: int
- @type bottom: int
- @type right: int
- @type top: int
- """
- def getScreenPosition(arg):
- """
- Gets the position of an object projected on screen space.
-
- Example:
- # For an object in the middle of the screen, coord = [0.5,0.5]
- coord = camera.getScreenPosition(object)
-
- @param arg: L{KX_GameObject}, object name or list [x, y, z]
- @rtype: list [x, y]
- @return: the object's position in screen coordinates.
- """
- def getScreenVect(x, y):
- """
- Gets the vector from the camera position in the screen coordinate direction.
-
- Example:
- # Gets the vector of the camera front direction:
- m_vect = camera.getScreenVect(0.5,0.5)
-
- @type x: float
- @type y: float
- @rtype: 3d vector
- @return: the vector from a screen coordinate.
- """
- def getScreenRay(x, y, dist, property):
- """
- Look towards a screen coordinate (x,y) and find first object hit within dist that matches prop.
- The ray is similar to KX_GameObject->rayCastTo.
-
- Example:
- # Gets an object with a property "wall" in front of the camera within a distance of 100:
- target = camera.getScreenRay(0.5,0.5,100,"wall")
-
- @type x: float
- @type y: float
- @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other
- @type dist: float
- @param property: property name that object must have; can be omitted => detect any object
- @type property: string
- @rtype: L{KX_GameObject}
- @return: the first object hit or None if no object or object does not match prop
- """
-
-class BL_ArmatureObject(KX_GameObject):
- """
- An armature object.
-
- @ivar constraints: The list of armature constraint defined on this armature
- Elements of the list can be accessed by index or string.
- The key format for string access is '<bone_name>:<constraint_name>'
- @type constraints: list of L{BL_ArmatureConstraint}
- @ivar channels: The list of armature channels.
- Elements of the list can be accessed by index or name the bone.
- @type channels: list of L{BL_ArmatureChannel}
- """
-
- def update():
- """
- Ensures that the armature will be updated on next graphic frame.
-
- This action is unecessary if a KX_ArmatureActuator with mode run is active
- or if an action is playing. Use this function in other cases. It must be called
- on each frame to ensure that the armature is updated continously.
- """
-
-class BL_ArmatureActuator(SCA_IActuator):
- """
- Armature Actuators change constraint condition on armatures.
-
- @group Constants: KX_ACT_ARMATURE_RUN, KX_ACT_ARMATURE_ENABLE, KX_ACT_ARMATURE_DISABLE, KX_ACT_ARMATURE_SETTARGET, KX_ACT_ARMATURE_SETWEIGHT
- @ivar KX_ACT_ARMATURE_RUN: see type
- @ivar KX_ACT_ARMATURE_ENABLE: see type
- @ivar KX_ACT_ARMATURE_DISABLE: see type
- @ivar KX_ACT_ARMATURE_SETTARGET: see type
- @ivar KX_ACT_ARMATURE_SETWEIGHT: see type
- @ivar type: The type of action that the actuator executes when it is active.
-
- KX_ACT_ARMATURE_RUN(0): just make sure the armature will be updated on the next graphic frame
- This is the only persistent mode of the actuator: it executes automatically once per frame until stopped by a controller
-
- KX_ACT_ARMATURE_ENABLE(1): enable the constraint.
-
- KX_ACT_ARMATURE_DISABLE(2): disable the constraint (runtime constraint values are not updated).
-
- KX_ACT_ARMATURE_SETTARGET(3): change target and subtarget of constraint
-
- KX_ACT_ARMATURE_SETWEIGHT(4): change weight of (only for IK constraint)
- @type type: integer
- @ivar constraint: The constraint object this actuator is controlling.
- @type constraint: L{BL_ArmatureConstraint}
- @ivar target: The object that this actuator will set as primary target to the constraint it controls
- @type target: L{KX_GameObject}
- @ivar subtarget: The object that this actuator will set as secondary target to the constraint it controls.
- Currently, the only secondary target is the pole target for IK constraint.
- @type subtarget: L{KX_GameObject}
- @ivar weight: The weight this actuator will set on the constraint it controls.
- Currently only the IK constraint has a weight. It must be a value between 0 and 1.
- A weight of 0 disables a constraint while still updating constraint runtime values (see L{BL_ArmatureConstraint})
- @type weight: float
- """
-
-class KX_ArmatureSensor(SCA_ISensor):
- """
- Armature sensor detect conditions on armatures.
-
- @group Constants: KX_ARMSENSOR_STATE_CHANGED, KX_ARMSENSOR_LIN_ERROR_BELOW, KX_ARMSENSOR_LIN_ERROR_ABOVE, KX_ARMSENSOR_ROT_ERROR_BELOW, KX_ARMSENSOR_ROT_ERROR_ABOVE
- @ivar KX_ARMSENSOR_STATE_CHANGED: see type
- @ivar KX_ARMSENSOR_LIN_ERROR_BELOW: see type
- @ivar KX_ARMSENSOR_LIN_ERROR_ABOVE: see type
- @ivar KX_ARMSENSOR_ROT_ERROR_BELOW: see type
- @ivar KX_ARMSENSOR_ROT_ERROR_ABOVE: see type
- @ivar type: The type of measurement that the sensor make when it is active.
-
- KX_ARMSENSOR_STATE_CHANGED(0): detect that the constraint is changing state (active/inactive)
-
- KX_ARMSENSOR_LIN_ERROR_BELOW(1): detect that the constraint linear error is above a threshold
-
- KX_ARMSENSOR_LIN_ERROR_ABOVE(2): detect that the constraint linear error is below a threshold
-
- KX_ARMSENSOR_ROT_ERROR_BELOW(3): detect that the constraint rotation error is above a threshold
-
- KX_ARMSENSOR_ROT_ERROR_ABOVE(4): detect that the constraint rotation error is below a threshold
- @type type: integer
- @ivar constraint: The constraint object this sensor is watching.
- @type constraint: L{BL_ArmatureConstraint}
- @ivar value: The threshold used in the comparison with the constraint error
- The linear error is only updated on CopyPose/Distance IK constraint with iTaSC solver
- The rotation error is only updated on CopyPose+rotation IK constraint with iTaSC solver
- The linear error on CopyPose is always >= 0: it is the norm of the distance between the target and the bone
- The rotation error on CopyPose is always >= 0: it is the norm of the equivalent rotation vector between the bone and the target orientations
- The linear error on Distance can be positive if the distance between the bone and the target is greater than the desired distance, and negative if the distance is smaller
- @type value: float
- """
-
-class BL_ArmatureConstraint(PyObjectPlus):
- """
- Proxy to Armature Constraint. Allows to change constraint on the fly.
- Obtained through L{BL_ArmatureObject}.constraints.
- Note: not all armature constraints are supported in the GE.
-
- @group Constants: CONSTRAINT_TYPE_TRACKTO, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_ROTLIKE, CONSTRAINT_TYPE_LOCLIKE, CONSTRAINT_TYPE_MINMAX, CONSTRAINT_TYPE_SIZELIKE, CONSTRAINT_TYPE_LOCKTRACK, CONSTRAINT_TYPE_STRETCHTO, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_TRANSFORM, CONSTRAINT_TYPE_DISTLIMIT,CONSTRAINT_IK_COPYPOSE, CONSTRAINT_IK_DISTANCE,CONSTRAINT_IK_MODE_INSIDE, CONSTRAINT_IK_MODE_OUTSIDE,CONSTRAINT_IK_MODE_ONSURFACE,CONSTRAINT_IK_FLAG_TIP,CONSTRAINT_IK_FLAG_ROT, CONSTRAINT_IK_FLAG_STRETCH, CONSTRAINT_IK_FLAG_POS
- @ivar CONSTRAINT_TYPE_TRACKTO: see type
- @ivar CONSTRAINT_TYPE_KINEMATIC: see type
- @ivar CONSTRAINT_TYPE_ROTLIKE: see type
- @ivar CONSTRAINT_TYPE_LOCLIKE: see type
- @ivar CONSTRAINT_TYPE_MINMAX: see type
- @ivar CONSTRAINT_TYPE_SIZELIKE: see type
- @ivar CONSTRAINT_TYPE_LOCKTRACK: see type
- @ivar CONSTRAINT_TYPE_STRETCHTO: see type
- @ivar CONSTRAINT_TYPE_CLAMPTO: see type
- @ivar CONSTRAINT_TYPE_TRANSFORM: see type
- @ivar CONSTRAINT_TYPE_DISTLIMIT: see type
- @ivar CONSTRAINT_IK_COPYPOSE: see ik_type
- @ivar CONSTRAINT_IK_DISTANCE: see ik_type
- @ivar CONSTRAINT_IK_MODE_INSIDE: see ik_mode
- @ivar CONSTRAINT_IK_MODE_OUTSIDE: see ik_mode
- @ivar CONSTRAINT_IK_MODE_ONSURFACE: see ik_mode
- @ivar CONSTRAINT_IK_FLAG_TIP: see ik_flag
- @ivar CONSTRAINT_IK_FLAG_ROT: see ik_flag
- @ivar CONSTRAINT_IK_FLAG_STRETCH: see ik_flag
- @ivar CONSTRAINT_IK_FLAG_POS: see ik_flag
- @ivar type: Type of constraint, read-only
- @type type: integer, one of CONSTRAINT_TYPE_ constant
- @ivar name: Name of constraint constructed as <bone_name>:<constraint_name>
- This name is also the key subscript on L{BL_ArmatureObject}.constraints list
- @type name: string
- @ivar enforce: fraction of constraint effect that is enforced. Between 0 and 1.
- @type enforce: float
- @ivar headtail: position of target between head and tail of the target bone: 0=head, 1=tail
- Only used if the target is a bone (i.e target object is an armature)
- @type headtail: float
- @ivar lin_error: runtime linear error (in Blender unit) on constraint at the current frame.
- This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
- @type lin_error: float
- @ivar rot_error: runtime rotation error (in radiant) on constraint at the current frame.
- This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
- It is only set if the constraint has a rotation part, for example, a CopyPose+Rotation IK constraint.
- @type rot_error: float
- @ivar target: Primary target object for the constraint. The position of this object in the GE will be used as target for the constraint.
- @type target: L{KX_GameObject}
- @ivar subtarget: Secondary target object for the constraint. The position of this object in the GE will be used as secondary target for the constraint.
- Currently this is only used for pole target on IK constraint.
- @type subtarget: L{KX_GameObject}
- @ivar active: True if the constraint is active.
- Note: an inactive constraint does not update lin_error and rot_error.
- @type active: boolean
- @ivar ik_weight: Weight of the IK constraint between 0 and 1.
- Only defined for IK constraint.
- @type ik_weight: float
- @ivar ik_type: Type of IK constraint, read-only
-
- CONSTRAINT_IK_COPYPOSE(0): constraint is trying to match the position and eventually the rotation of the target.
-
- CONSTRAINT_IK_DISTANCE(1): constraint is maintaining a certain distance to target subject to ik_mode
- @type ik_type: integer
- @ivar ik_flag: Combination of IK constraint option flags, read-only
-
- CONSTRAINT_IK_FLAG_TIP(1) : set when the constraint operates on the head of the bone and not the tail
-
- CONSTRAINT_IK_FLAG_ROT(2) : set when the constraint tries to match the orientation of the target
-
- CONSTRAINT_IK_FLAG_STRETCH(16) : set when the armature is allowed to stretch (only the bones with stretch factor > 0.0)
-
- CONSTRAINT_IK_FLAG_POS(32) : set when the constraint tries to match the position of the target
- @type ik_flag: integer
- @ivar ik_dist: Distance the constraint is trying to maintain with target, only used when ik_type=CONSTRAINT_IK_DISTANCE
- @type ik_dist: float
- @ivar ik_mode: Additional mode for IK constraint. Currently only used for Distance constraint:
-
- CONSTRAINT_IK_MODE_INSIDE(0) : the constraint tries to keep the bone within ik_dist of target
-
- CONSTRAINT_IK_MODE_OUTSIDE(1) : the constraint tries to keep the bone outside ik_dist of the target
-
- CONSTRAINT_IK_MODE_ONSURFACE(2) : the constraint tries to keep the bone exactly at ik_dist of the target
- @type ik_mode: integer
- """
-
-class BL_ArmatureChannel(PyObjectPlus):
- """
- Proxy to armature pose channel. Allows to read and set armature pose.
- The attributes are identical to RNA attributes, but mostly in read-only mode.
-
- @group Constants: PCHAN_ROT_QUAT, PCHAN_ROT_XYZ, PCHAN_ROT_XZY, PCHAN_ROT_YXZ, PCHAN_ROT_YZX, PCHAN_ROT_ZXY, PCHAN_ROT_ZYX
- @ivar PCHAN_ROT_QUAT: see rotation_mode
- @ivar PCHAN_ROT_XYZ: see rotation_mode
- @ivar PCHAN_ROT_XZY: see rotation_mode
- @ivar PCHAN_ROT_YXZ: see rotation_mode
- @ivar PCHAN_ROT_YZX: see rotation_mode
- @ivar PCHAN_ROT_ZXY: see rotation_mode
- @ivar PCHAN_ROT_ZYX: see rotation_mode
- @ivar name: channel name (=bone name), read-only.
- @type name: string
- @ivar bone: return the bone object corresponding to this pose channel, read-only.
- @type bone: L{BL_ArmatureBone}
- @ivar parent: return the parent channel object, None if root channel, read-only.
- @type parent: L{BL_ArmatureChannel}
- @ivar has_ik: true if the bone is part of an active IK chain, read-only.
- This flag is not set when an IK constraint is defined but not enabled (miss target information for example)
- @type has_ik: boolean
- @ivar ik_dof_x: true if the bone is free to rotation in the X axis, read-only.
- @type ik_dof_x: boolean
- @ivar ik_dof_y: true if the bone is free to rotation in the Y axis, read-only.
- @type ik_dof_y: boolean
- @ivar ik_dof_z: true if the bone is free to rotation in the Z axis, read-only.
- @type ik_dof_z: boolean
- @ivar ik_limit_x: true if a limit is imposed on X rotation, read-only.
- @type ik_limit_x: boolean
- @ivar ik_limit_y: true if a limit is imposed on Y rotation, read-only.
- @type ik_limit_y: boolean
- @ivar ik_limit_z: true if a limit is imposed on Z rotation, read-only.
- @type ik_limit_z: boolean
- @ivar ik_rot_control: true if channel rotation should applied as IK constraint, read-only.
- @type ik_rot_control: boolean
- @ivar ik_lin_control: true if channel size should applied as IK constraint, read-only.
- @type ik_lin_control: boolean
- @ivar location: displacement of the bone head in armature local space, read-write.
- You can only move a bone if it is unconnected to its parent. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
- Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see L{BL_ArmatureObject.update})
- @type location: vector [X,Y,Z]
- @ivar scale: scale of the bone relative to its parent, read-write.
- An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
- Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see L{BL_ArmatureObject.update})
- @type scale: vector [sizeX, sizeY, sizeZ]
- @ivar rotation: rotation of the bone relative to its parent expressed as a quaternion, read-write.
- This field is only used if rotation_mode is 0. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
- Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see L{BL_ArmatureObject.update})
- @type rotation: vector [qr, qi, qj, qk]
- @ivar euler_rotation: rotation of the bone relative to its parent expressed as a set of euler angles, read-write.
- This field is only used if rotation_mode is > 0. You must always pass the angles in [X,Y,Z] order; the order of applying the angles to the bone depends on rotation_mode. An action playing on the armature may change this field. An IK chain does not update this value, see joint_rotation.
- Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see L{BL_ArmatureObject.update})
- @type euler_rotation: vector [X, Y, Z]
- @ivar rotation_mode: method of updating the bone rotation, read-write.
- Use the following constants (euler mode are named as in BLender UI but the actual axis order is reversed):
- - PCHAN_ROT_QUAT(0) : use quaternioin in rotation attribute to update bone rotation
- - PCHAN_ROT_XYZ(1) : use euler_rotation and apply angles on bone's Z, Y, X axis successively
- - PCHAN_ROT_XZY(2) : use euler_rotation and apply angles on bone's Y, Z, X axis successively
- - PCHAN_ROT_YXZ(3) : use euler_rotation and apply angles on bone's Z, X, Y axis successively
- - PCHAN_ROT_YZX(4) : use euler_rotation and apply angles on bone's X, Z, Y axis successively
- - PCHAN_ROT_ZXY(5) : use euler_rotation and apply angles on bone's Y, X, Z axis successively
- - PCHAN_ROT_ZYX(6) : use euler_rotation and apply angles on bone's X, Y, Z axis successively
- @type rotation_mode: integer
- @ivar channel_matrix: pose matrix in bone space (deformation of the bone due to action, constraint, etc), Read-only.
- This field is updated after the graphic render, it represents the current pose.
- @type channel_matrix: matrix [4][4]
- @ivar pose_matrix: pose matrix in armature space, read-only,
- This field is updated after the graphic render, it represents the current pose.
- @type pose_matrix: matrix [4][4]
- @ivar pose_head: position of bone head in armature space, read-only.
- @type pose_head: vector [x, y, z]
- @ivar pose_tail: position of bone tail in armature space, read-only.
- @type pose_tail: vector [x, y, z]
- @ivar ik_min_x: minimum value of X rotation in degree (<= 0) when X rotation is limited (see ik_limit_x), read-only.
- @type ik_min_x: float
- @ivar ik_max_x: maximum value of X rotation in degree (>= 0) when X rotation is limited (see ik_limit_x), read-only.
- @type ik_max_x: float
- @ivar ik_min_y: minimum value of Y rotation in degree (<= 0) when Y rotation is limited (see ik_limit_y), read-only.
- @type ik_min_y: float
- @ivar ik_max_y: maximum value of Y rotation in degree (>= 0) when Y rotation is limited (see ik_limit_y), read-only.
- @type ik_max_y: float
- @ivar ik_min_z: minimum value of Z rotation in degree (<= 0) when Z rotation is limited (see ik_limit_z), read-only.
- @type ik_min_z: float
- @ivar ik_max_z: maximum value of Z rotation in degree (>= 0) when Z rotation is limited (see ik_limit_z), read-only.
- @type ik_max_z: float
- @ivar ik_stiffness_x: bone rotation stiffness in X axis, read-only
- @type ik_stiffness_x: float between 0 and 1
- @ivar ik_stiffness_y: bone rotation stiffness in Y axis, read-only
- @type ik_stiffness_y: float between 0 and 1
- @ivar ik_stiffness_z: bone rotation stiffness in Z axis, read-only
- @type ik_stiffness_z: float between 0 and 1
- @ivar ik_stretch: ratio of scale change that is allowed, 0=bone can't change size, read-only.
- @type ik_stretch: float
- @ivar ik_rot_weight: weight of rotation constraint when ik_rot_control is set, read-write.
- @type ik_rot_weight: float between 0 and 1
- @ivar ik_lin_weight: weight of size constraint when ik_lin_control is set, read-write.
- @type ik_lin_weight: float between 0 and 1
- @ivar joint_rotation: control bone rotation in term of joint angle (for robotic applications), read-write.
- When writing to this attribute, you pass a [x, y, z] vector and an appropriate set of euler angles or quaternion is calculated according to the rotation_mode.
- When you read this attribute, the current pose matrix is converted into a [x, y, z] vector representing the joint angles.
- The value and the meaning of the x, y, z depends on the ik_dof_ attributes:
- - 1DoF joint X, Y or Z: the corresponding x, y, or z value is used an a joint angle in radiant
- - 2DoF joint X+Y or Z+Y: treated as 2 successive 1DoF joints: first X or Z, then Y. The x or z value is used as a joint angle in radiant along the X or Z axis, followed by a rotation along the new Y axis of y radiants.
- - 2DoF joint X+Z: treated as a 2DoF joint with rotation axis on the X/Z plane. The x and z values are used as the coordinates of the rotation vector in the X/Z plane.
- - 3DoF joint X+Y+Z: treated as a revolute joint. The [x,y,z] vector represents the equivalent rotation vector to bring the joint from the rest pose to the new pose.
-
- Notes:
- - The bone must be part of an IK chain if you want to set the ik_dof_ attributes via the UI, but this will interfere with this attribute since the IK solver will overwrite the pose. You can stay in control of the armature if you create an IK constraint but do not finalize it (e.g. don't set a target): the IK solver will not run but the IK panel will show up on the UI for each bone in the chain.
- - [0,0,0] always corresponds to the rest pose.
- - You must request the armature pose to update and wait for the next graphic frame to see the effect of setting this attribute (see L{BL_ArmatureObject.update}).
- - You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute.
- @type joint_rotation: vector [x, y, z]
- """
-
-class BL_ArmatureBone(PyObjectPlus):
- """
- Proxy to Blender bone structure. All fields are read-only and comply to RNA names.
- All space attribute correspond to the rest pose.
-
- @ivar name: bone name
- @type name: string
- @ivar connected: true when the bone head is struck to the parent's tail
- @type connected: boolean
- @ivar hinge: true when bone doesn't inherit rotation or scale from parent bone
- @type hinge: boolean
- @ivar inherit_scale: true when bone inherits scaling from parent bone
- @type inherit_scale: boolean
- @ivar bbone_segments: number of B-bone segments
- @type bbone_segments: integer
- @ivar roll: bone rotation around head-tail axis
- @type roll: float
- @ivar head: location of head end of the bone in parent bone space
- @type head: vector [x, y, z]
- @ivar tail: location of head end of the bone in parent bone space
- @type tail: vector [x, y, z]
- @ivar length: bone length
- @type length: float
- @ivar arm_head: location of head end of the bone in armature space
- @type arm_head: vector [x, y, z]
- @ivar arm_tail: location of tail end of the bone in armature space
- @type arm_tail: vector [x, y, z]
- @ivar arm_mat: matrix of the bone head in armature space
- This matrix has no scale part.
- @type arm_mat: matrix [4][4]
- @ivar bone_mat: rotation matrix of the bone in parent bone space.
- @type bone_mat: matrix [3][3]
- @ivar parent: parent bone, or None for root bone
- @type parent: L{BL_ArmatureBone}
- @ivar children: list of bone's children
- @type children: list of L{BL_ArmatureBone}
- """
-# Util func to extract all attrs
-"""
-import types
-attrs = []
-for name, val in locals().items():
- if name.startswith('__'):
- continue
- if type(val) == types.ClassType:
- for line in val.__doc__.split('\n'):
- if '@ivar' in line:
- attrs.append(name + '::' + line.split()[1].replace(':', ''))
-
-for a in attrs:
- print a
-"""
-
-
-# Util func to construct a mapping from deprecated attrs to new ones.
-"""
-import types
-import re
-import pprint
-depAttrs = {}
-for name, val in locals().items():
- if name.startswith('__'):
- continue
- if type(val) == types.ClassType:
- print "\t# %s" % name
-
- # Inspect each attribute.
- for attrName in dir(val):
- if attrName.startswith('__'):
- continue
- attr = getattr(val, attrName)
-
- # Check whether this attribute is deprecated by searching each line.
- newAttrName = None
- for line in attr.__doc__.split('\n'):
- match = re.search(r'@deprecated.*L{(\w+)}', line)
- if match:
- newAttrName = match.group(1)
- break
- if not newAttrName:
- continue
-
- # Store the mappings to new attributes in a list (because there
- # could be collisions).
- if attrName not in depAttrs:
- depAttrs[attrName] = {}
- mapping = depAttrs[attrName]
-
- for line in val.__doc__.split('\n'):
- if ("@type %s:" % newAttrName) in line:
- # The attribute is being replaced in this class (i.e. the
- # deprecated attribute wasn't inherited from a parent). We
- # have a winner!
- funcType = None
- if 'sequence' in line:
- funcType = 'Keyed'
- else:
- funcType = 'Simple'
-
- if attrName.startswith('get') or attrName.startswith('is'):
- func = "replace%sGetter" % funcType
- elif attrName.startswith('set') or attrName.startswith('enable'):
- func = "replace%sSetter" % funcType
- else:
- func = 'UNKNOWN'
-
- # Another mapping, from a conversion tuple to lists of class
- # names.
- conversion = (func, newAttrName)
- if conversion not in mapping:
- mapping[conversion] = []
- mapping[conversion].append(name)
- break
-
-pprint.pprint(depAttrs, width = 100)
-"""
diff --git a/source/gameengine/PyDoc/PhysicsConstraints.py b/source/gameengine/PyDoc/PhysicsConstraints.py
index d78a32f4f79..2859aedd2d1 100644
--- a/source/gameengine/PyDoc/PhysicsConstraints.py
+++ b/source/gameengine/PyDoc/PhysicsConstraints.py
@@ -1,126 +1,294 @@
# $Id$
"""
Documentation for the PhysicsConstraints module.
+================================================
-Example:
+Example::
+
+
+ # Adding a point constraint #
+ ###############################
+
+
+ # import BGE internal module
+ import PhysicsConstraints
+
+ # get object list
+ obj_list = GameLogic.getCurrentScene().objects
+
+ # get object named Obj_1
+ root = obj_list["root"]
+ obj = obj_list["obj"]
+
+ # get object physics ID
+ phido = obj.getPhysicsId()
+
+ # get root physics ID
+ phidr = root.getPhysicsId()
+
+ # want to use point constraint type
+ constraint_type = 1
+
+ # Use bottom right front corner of object for point constraint position
+ point_pos_x = 1.0
+ point_pos_y = -1.0
+ point_pos_z = -1.0
+
+ # create a point constraint
+ const = PhysicsConstraints.createConstraint( phido, phidr, constraint_type, point_pos_x, point_pos_y, point_pos_z)
+
+ # stores the new constraint ID to be used later
+ obj["constraint_ID"] = const.getConstraintId()
+
+
+Example::
+
+
+ # Removing a point constraint #
+ #################################
+
+
+ # import BGE internal module
import PhysicsConstraints
- import GameLogic
+
+ # get object list
+ obj_list = GameLogic.getCurrentScene().objects
+
+ # get object 1
+ obj = obj_list["obj"]
+
+ # get constraint ID that was saved as an obj property
+ # when the constraint was created
+ constraint_ID = obj["constraint_ID"]
+
+ # remove constraint
+ PhysicsConstraints.removeConstraint(constraint_ID)
"""
-# TODO
-# error
-def createConstraint():
- """
- Does something
+def createConstraint(obj_PhysicsID, root_PhysicsID, constraintType, pointPos_x, pointPos_y, pointPos_z, edgePos_x, edgePos_y, edgePos_z, edgeAngle_x, edgeAngle_y, edgeAngle_z):
+ """
+ Create a point constraint between two objects, an edge constraint between two objects, or a vehicle constraint on an object.
- @rtype:
- """
-def getAppliedImpulse():
- """
- Does something
+ You only have to input the needed parammeters depending on the type of constraint you are trying to create.
- @rtype:
- """
-def getVehicleConstraint():
- """
- Does something
+
+ B{Point Constraint} ::
- @rtype:
- """
-def removeConstraint():
- """
- Does something
+ While creating a point constraint, the "pointPos" values define where you want the pivot point to be located.
+ If you are creating a point constraint be sure to assing the integer "1" as the constraintType value.
- @rtype:
- """
-def setCcdMode():
- """
- Does something
+ Parameters to use:
+ obj_PhysicsID, root_PhysicsID, constraintType, pointPos_x, pointPos_y, pointPos_z
- @rtype:
- """
-def setContactBreakingTreshold():
- """
- Does something
+ B{Edge Constraint} ::
+
+ While creating an edge constraint, the "edgePos" values define where you want the center of the edge constraint to be.
+ Also, the "edgeAngle" values define in which direction you want the edge constraint to point (As a 3 dimensions vector).
+ If you want to create an edge constraint be sure to assing the integer "2" as the constraintType value.
+
+ Parameters to use:
+ obj_PhysicsID, root_PhysicsID, constraintType, edgePos_x, edgePos_y, edgePos_z, edgeAngle_x, edgeAngle_y, edgeAngle_z}
- @rtype:
- """
-def setDeactivationAngularTreshold():
- """
- Does something
+ B{Vehicle Constraint} ::
+
+ While creating a point constraint, the "pointPos" values define where you want the pivot point to be located.
+ If you want to create an edge constraint be sure to assing the integer "0" as the constraintType value.
+
+ Parameters to use :
+ obj_PhysicsID, root_PhysicsID, constraintType
- @rtype:
- """
-def setDeactivationLinearTreshold():
+ @type obj_PhysicsID: integer
+ @param obj_PhysicsID: The physic ID of the first object to constraint.
+
+ @type root_PhysicsID: integer
+ @param root_PhysicsID: The physic ID of the second object to constraint.
+
+ @type constraintType: integer
+ @param constraintType: The type of constraint.
+
+ @type pointPos_x: float
+ @param pointPos_x: The X position of the point constraint.
+
+ @type pointPos_y: float
+ @param pointPos_y: The Y position of the point constraint.
+
+ @type pointPos_z: float
+ @param pointPos_z: The Z position of the point constraint.
+
+ @type edgePos_x: float
+ @param edgePos_x: The X value of the center of the edge constraint.
+
+ @type edgePos_y: float
+ @param edgePos_y: The Y value of the center of the edge constraint.
+
+ @type edgePos_z: float
+ @param edgePos_z: The Z value of the center of the edge constraint.
+
+ @type edgeAngle_x: float
+ @param edgeAngle_x: The X value of the edge's orientation vector.
+
+ @type edgeAngle_y: float
+ @param edgeAngle_y: The Y value of the edge's orientation vector.
+
+ @type edgeAngle_z: float
+ @param edgeAngle_z: The Z value of the edge's orientation vector.
+
+ @rtype: integer
+ @return: The created constraint ID
"""
- Does something
- @rtype:
- """
-def setDeactivationTime():
+
+def getAppliedImpulse(constraint_ID):
"""
- Does something
+ Returns the applied impulse.
- @rtype:
+ @param constraint_ID: The constraint ID that was saved on the creation of the constraint.
+ @type constraint_ID: integer
+ @rtype: float
+ @return: Measure the stress on a constraint.
"""
-def setDebugMode():
+
+
+def getVehicleConstraint(constraint_ID):
"""
- Does something
+ Returns the vehicle constraint ID.
- @rtype:
+ @param constraint_ID: The constraint ID that was saved on the creation of the constraint.
+ @type constraint_ID: integer
+ @rtype: integer
"""
-def setGravity():
+def removeConstraint(constraint_ID):
"""
- Does something
- @rtype:
- """
-def setLinearAirDamping():
- """
- Does something
+ Removes the constraint between 2 game objects (point and edge constraints).
+
+ It does not remove vehicle constraints.
- @rtype:
+ @param constraint_ID: The constraint ID that was saved on the creation of the constraint.
+ @type constraint_ID: integer
"""
-def setNumIterations():
+def setDeactivationLinearTreshold(linearTreshold):
"""
- Does something
- @rtype:
+ Sets the linear velocity that an object must be below before the deactivation timer can start.
+
+ This affects every object in the scene, except for game objects that have 'No sleeping' turned on.
+
+ @param linearTreshold: The linear velocity.
+ @type linearTreshold: float
"""
-def setNumTimeSubSteps():
+def setDeactivationAngularTreshold(angularTreshold):
"""
- Does something
- @rtype:
+ Sets the angular velocity that an object must be below before the deactivation timer can start.
+
+ This affects every object in the scene, except for game objects that have 'No sleeping' turned on.
+
+ @param angularTreshold: The angular velocity.
+ @type angularTreshold: float
"""
-def setSolverDamping():
+def setDeactivationTime(time):
"""
- Does something
- @rtype:
+ Time (in seconds) after objects with velocity less then thresholds (see below) are deactivated.
+
+ This affects every object in the scene, except for game objects that have 'No sleeping' turned on.
+
+ This function is directly related with the 2 above functions.
+
+
+ @param time: The time in seconds.
+ @type time: float
"""
-def setSolverTau():
+def setGravity(gx, gy, gz):
"""
- Does something
+ Sets the gravity for the actual scene only.
+
+ All other scenes remain unaffected.
- @rtype:
+ This affects every object in the scene that has physics enabled.
+
+ @param gx: The force of gravity on world x axis.
+ @type gx: float
+ @param gy: The force of gravity on world y axis.
+ @type gy: float
+ @param gz: The force of gravity on world z axis.
+ @type gz: float
"""
-def setSolverType():
+def setLinearAirDamping(damping):
"""
- Does something
- @rtype:
+ Sets the linear air resistance for all objects in the scene.
+
+ @param damping: The linear air resistance.
+ @type damping: float
"""
-def setSorConstant():
+def setNumIterations(numIter):
"""
- Does something
+ Sets the number of times an iterative constraint solver is repeated.
- @rtype:
+ Increasing the number of iterations improves the constraint solver at the cost of performances & the speed of the game engine.
+
+ @param numIter: The number of timesubsteps. (Input 0 to suspend simulation numSubStep)
+ @type numIter: integer
"""
-def setUseEpa():
+def setNumTimeSubSteps(numSubStep):
"""
- Does something
+ Set the quality of the entire physics simulation including collision detection and constraint solver.
+
+ Increase the number of time substeps to improves the quality of the entire physics simulation at the cost of the performance & the speed of the game engine.
- @rtype:
- """ \ No newline at end of file
+ @param numSubStep: The number of timesubsteps. (Input 0 to suspend simulation numSubStep)
+ @type numSubStep: integer
+ """
+#def setDebugMode():
+# """
+#
+#
+#
+# @param numIter:
+# @type numIter:
+# """
+#def setCcdMode():
+# """
+# Does something
+#
+# @rtype:
+# """
+#def setContactBreakingTreshold():
+# """
+# Does something
+#
+# @rtype:
+# """
+#def setSolverDamping():
+# """
+# Does something
+#
+# @rtype:
+# """
+#def setSolverTau():
+# """
+# Does something
+#
+# @rtype:
+# """
+#def setSolverType():
+# """
+# Does something
+#
+# @rtype:
+# """
+#def setSorConstant():
+# """
+# Does something
+#
+# @rtype:
+# """
+#def setUseEpa():
+# """
+# Does something
+#
+# @rtype:
+# """ \ No newline at end of file
diff --git a/source/gameengine/PyDoc/Rasterizer.py b/source/gameengine/PyDoc/Rasterizer.py
deleted file mode 100644
index 8fd4d506bde..00000000000
--- a/source/gameengine/PyDoc/Rasterizer.py
+++ /dev/null
@@ -1,221 +0,0 @@
-# $Id$
-"""
-Documentation for the Rasterizer module.
-
-Example Uses an L{SCA_MouseSensor}, and two L{KX_ObjectActuator}s to implement MouseLook::
- # To use a mouse movement sensor "Mouse" and a
- # motion actuator to mouse look:
- import Rasterizer
- import GameLogic
-
- # SCALE sets the speed of motion
- SCALE=[1, 0.5]
-
- co = GameLogic.getCurrentController()
- obj = co.getOwner()
- mouse = co.getSensor("Mouse")
- lmotion = co.getActuator("LMove")
- wmotion = co.getActuator("WMove")
-
- # Transform the mouse coordinates to see how far the mouse has moved.
- def mousePos():
- x = (Rasterizer.getWindowWidth()/2 - mouse.getXPosition())*SCALE[0]
- y = (Rasterizer.getWindowHeight()/2 - mouse.getYPosition())*SCALE[1]
- return (x, y)
-
- pos = mousePos()
-
- # Set the amount of motion: X is applied in world coordinates...
- lmotion.setTorque(0.0, 0.0, pos[0], False)
- # ...Y is applied in local coordinates
- wmotion.setTorque(-pos[1], 0.0, 0.0, True)
-
- # Activate both actuators
- GameLogic.addActiveActuator(lmotion, True)
- GameLogic.addActiveActuator(wmotion, True)
-
- # Centre the mouse
- Rasterizer.setMousePosition(Rasterizer.getWindowWidth()/2, Rasterizer.getWindowHeight()/2)
-
-@group Material Types: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
-@var KX_TEXFACE_MATERIAL: Materials as defined by the texture face settings.
-@var KX_BLENDER_MULTITEX_MATERIAL: Materials approximating blender materials with multitexturing.
-@var KX_BLENDER_GLSL_MATERIAL: Materials approximating blender materials with GLSL.
-
-"""
-def getWindowWidth():
- """
- Gets the width of the window (in pixels)
-
- @rtype: integer
- """
-def getWindowHeight():
- """
- Gets the height of the window (in pixels)
-
- @rtype: integer
- """
-def makeScreenshot(filename):
- """
- Writes a screenshot to the given filename.
-
- If filename starts with // the image will be saved relative to the current directory.
- If the filename contains # it will be replaced with the frame number.
-
- The standalone player saves .png files. It does not support colour space conversion
- or gamma correction.
-
- When run from Blender, makeScreenshot supports Iris, IrisZ, TGA, Raw TGA, PNG, HamX, and Jpeg.
- Gamma, Colourspace conversion and Jpeg compression are taken from the Render settings panels.
-
- @type filename: string
- """
-
-def enableVisibility(visible):
- """
- Doesn't really do anything...
- """
-
-def showMouse(visible):
- """
- Enables or disables the operating system mouse cursor.
-
- @type visible: boolean
- """
-
-def setMousePosition(x, y):
- """
- Sets the mouse cursor position.
-
- @type x: integer
- @type y: integer
- """
-
-def setBackgroundColor(rgba):
- """
- Sets the window background colour.
-
- @type rgba: list [r, g, b, a]
- """
-
-def setMistColor(rgb):
- """
- Sets the mist colour.
-
- @type rgb: list [r, g, b]
- """
-
-def setAmbientColor(rgb):
- """
- Sets the color of ambient light.
-
- @type rgb: list [r, g, b]
- """
-
-def setMistStart(start):
- """
- Sets the mist start value. Objects further away than start will have mist applied to them.
-
- @type start: float
- """
-
-def setMistEnd(end):
- """
- Sets the mist end value. Objects further away from this will be coloured solid with
- the colour set by setMistColor().
-
- @type end: float
- """
-
-def disableMist():
- """
- Disables mist.
-
- @note: Set any of the mist properties to enable mist.
- """
-
-def setEyeSeparation(eyesep):
- """
- Sets the eye separation for stereo mode. Usually Focal Length/30 provides a confortable value.
-
- @param eyesep: The distance between the left and right eye.
- @type eyesep: float
- """
-
-def getEyeSeparation():
- """
- Gets the current eye separation for stereo mode.
-
- @rtype: float
- """
-
-def setFocalLength(focallength):
- """
- Sets the focal length for stereo mode. It uses the current camera focal length as initial value.
-
- @param focallength: The focal length.
- @type focallength: float
- """
-
-def getFocalLength():
- """
- Gets the current focal length for stereo mode.
-
- @rtype: float
- """
-
-def setMaterialMode(mode):
- """
- Set the material mode to use for OpenGL rendering.
-
- @type mode: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
- @note: Changes will only affect newly created scenes.
- """
-
-def getMaterialMode(mode):
- """
- Get the material mode to use for OpenGL rendering.
-
- @rtype: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
- """
-
-def setGLSLMaterialSetting(setting, enable):
- """
- Enables or disables a GLSL material setting.
-
- @type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
- @type enable: boolean
- """
-
-def getGLSLMaterialSetting(setting, enable):
- """
- Get the state of a GLSL material setting.
-
- @type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
- @rtype: boolean
- """
-
-def drawLine(fromVec,toVec,color):
- """
- Draw a line in the 3D scene.
-
- @param fromVec: the origin of the line
- @type fromVec: list [x, y, z]
- @param toVec: the end of the line
- @type toVec: list [x, y, z]
- @param color: the color of the line
- @type color: list [r, g, b]
- """
-
-def enableMotionBlur(factor):
- """
- Enable the motion blue effect.
-
- @param factor: the ammount of motion blur to display.
- @type factor: float [0.0 - 1.0]
- """
-
-def disableMotionBlur():
- """
- Disable the motion blue effect.
- """
diff --git a/source/gameengine/PyDoc/SConscript b/source/gameengine/PyDoc/SConscript
deleted file mode 100644
index dabe004ae6a..00000000000
--- a/source/gameengine/PyDoc/SConscript
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/python
-Import ('env')
-import os
-
-if env['WITH_BF_FHS']:
- BLENDERPATH = os.path.join(env['BF_INSTALLDIR'], 'share', 'blender', env['BF_VERSION'])
-else:
- BLENDERPATH = env['BF_INSTALLDIR']
-
-from optparse import OptionParser
-import epydoc
-from epydoc.docbuilder import build_doc_index
-from epydoc import cli
-names = env.Glob("source/gameengine/PyDoc/*.py")
-docindex = build_doc_index(names)
-optvalues = cli.OPTION_DEFAULTS
-optvalues["verbose"] = 1
-optvalues["quiet"] = 0
-optvalues["include_source_code"] = 0
-optvalues["inheritance"] = "included"
-optvalues["show_private"] = 0
-optvalues["target"] = os.path.join(BLENDERPATH, 'doc')
-optvalues["url"] = "http://www.blender.org"
-optvalues["top"] = "Game Engine API"
-optvalues["name"] = "Blender"
-optvalues["noprivate"] = 1
-optvalues["noframes"] = 1
-optvalues["names"] = names
-optparser = OptionParser()
-optparser.set_defaults(**optvalues)
-(options, args) = optparser.parse_args([])
-print "Writing Game Engine epydocs to \"%s\"" % optvalues["target"]
-cli.write_html(docindex, options)
-
diff --git a/source/gameengine/PyDoc/VideoTexture.py b/source/gameengine/PyDoc/VideoTexture.py
index 73809a7a15c..c74bd4f0f16 100644
--- a/source/gameengine/PyDoc/VideoTexture.py
+++ b/source/gameengine/PyDoc/VideoTexture.py
@@ -1,32 +1,38 @@
# $Id$
"""
-The VideoTexture module allows you to manipulate textures during the game.
+The VideoTexture module allows you to manipulate textures during the game.
+
Several sources for texture are possible: video files, image files,
-video capture, memory buffer, camera render or a mix of that.
+video capture, memory buffer, camera render or a mix of that.
+
The video and image files can be loaded from the internet using an URL
-instead of a file name. In addition, you can apply filters on the images
-before sending them to the GPU, allowing video effect: blue screen,
-color band, gray, normal map.
+instead of a file name.
+
+In addition, you can apply filters on the images before sending them to the GPU, allowing video effect: blue screen,
+color band, gray, normal map.
+
VideoTexture uses FFmpeg to load images and videos. All the formats and codecs
-that FFmpeg supports are supported by VideoTexture, including but not limited to:
+that FFmpeg supports are supported by VideoTexture, including but not limited to::
- * AVI
- * Ogg
- * Xvid
- * Theora
- * dv1394 camera
- * video4linux capture card (this includes many webcams)
- * videoForWindows capture card (this includes many webcams)
- * JPG
+ * AVI
+ * Ogg
+ * Xvid
+ * Theora
+ * dv1394 camera
+ * video4linux capture card (this includes many webcams)
+ * videoForWindows capture card (this includes many webcams)
+ * JPG
The principle is simple: first you identify a texture on an existing object using
the L{materialID} function, then you create a new texture with dynamic content
-and swap the two textures in the GPU.
+and swap the two textures in the GPU.
+
The GE is not aware of the substitution and continues to display the object as always,
-except that you are now in control of the texture. When the texture object is deleted,
-the new texture is deleted and the old texture restored.
+except that you are now in control of the texture.
-Example:
+When the texture object is deleted, the new texture is deleted and the old texture restored.
+
+Example::
import VideoTexture
import GameLogic
@@ -58,7 +64,7 @@ Example:
"""
def getLastError():
"""
- Returns the description of the last error that occured in a VideoTexture function.
+ Returns the description of the last error that occurred in a VideoTexture function.
@rtype: string
"""
@@ -71,15 +77,18 @@ def imageToArray(image,mode):
@param mode: optional argument representing the pixel format.
You can use the characters R, G, B for the 3 color channels, A for the alpha channel,
0 to force a fixed 0 color channel and 1 to force a fixed 255 color channel.
- Example: "BGR" will return 3 bytes per pixel with the Blue, Green and Red channels in that order.
+ Example: "BGR" will return 3 bytes per pixel with the Blue, Green and Red channels in that order. \
"RGB1" will return 4 bytes per pixel with the Red, Green, Blue channels in that order and the alpha channel forced to 255.
The default mode is "RGBA".
@type mode: string
- @rtype: BGL.buffer object representing the image as one dimensional array of bytes of size (pixel_size*width*height), line by line starting from the bottom of the image. The pixel size and format is determined by the mode parameter.
+ @rtype: BGL.buffer
+ @returns: object representing the image as one dimensional array of bytes of size (pixel_size*width*height), line by line starting from the bottom of the image. The pixel size and format is determined by the mode parameter.
"""
+
def materialID(object,name):
"""
Returns a numeric value that can be used in L{Texture} to create a dynamic texture.
+
The value corresponds to an internal material number that uses the texture identified
by name. name is a string representing a texture name with IM prefix if you want to
identify the texture directly. This method works for basic tex face and for material,
@@ -87,6 +96,7 @@ def materialID(object,name):
position of the texture stack. name can also have MA prefix if you want to identify
the texture by material. In that case the material must have a texture channel in first
position.
+
If the object has no material that matches name, it generates a runtime error. Use try/except to catch the exception.
Ex: VideoTexture.materialID(obj, 'IMvideo.png')
@@ -198,7 +208,7 @@ def Texture():
"""
Does something
- @rtype:
+ @rtype: L{Texture}
"""
def VideoFFmpeg():
"""
diff --git a/source/gameengine/PyDoc/bge.events.rst b/source/gameengine/PyDoc/bge.events.rst
new file mode 100644
index 00000000000..f642291fe97
--- /dev/null
+++ b/source/gameengine/PyDoc/bge.events.rst
@@ -0,0 +1,229 @@
+
+Game Engine bge.events module
+=============================
+
+*****
+Intro
+*****
+
+This module holds key constants for the SCA_KeyboardSensor.
+
+.. module:: bge.events
+
+.. code-block:: python
+
+ # Set a connected keyboard sensor to accept F1
+ import bge
+
+ co = bge.logic.getCurrentController()
+ # 'Keyboard' is a keyboard sensor
+ sensor = co.sensors["Keyboard"]
+ sensor.key = bge.keys.F1KEY
+
+.. code-block:: python
+
+ # Do the all keys thing
+ import bge
+
+ co = bge.logic.getCurrentController()
+ # 'Keyboard' is a keyboard sensor
+ sensor = co.sensors["Keyboard"]
+
+ for key,status in sensor.events:
+ # key[0] == bge.keys.keycode, key[1] = status
+ if status == bge.logic.KX_INPUT_JUST_ACTIVATED:
+ if key == bge.keys.WKEY:
+ # Activate Forward!
+ if key == bge.keys.SKEY:
+ # Activate Backward!
+ if key == bge.keys.AKEY:
+ # Activate Left!
+ if key == bge.keys.DKEY:
+ # Activate Right!
+
+*********
+Functions
+*********
+
+.. function:: EventToString(event)
+
+ Return the string name of a key event. Will raise a ValueError error if its invalid.
+
+ :arg event: key event from bge.keys or the keyboard sensor.
+ :type event: int
+ :rtype: string
+
+.. function:: EventToCharacter(event, shift)
+
+ Return the string name of a key event. Returns an empty string if the event cant be represented as a character.
+
+ :type event: int
+ :arg event: key event from :mod:`bge.keys` or the keyboard sensor.
+ :type shift: bool
+ :arg shift: set to true if shift is held.
+ :rtype: string
+
+****************
+Keys (Constants)
+****************
+
+.. _mouse-keys:
+
+==========
+Mouse Keys
+==========
+
+.. data:: LEFTMOUSE
+.. data:: MIDDLEMOUSE
+.. data:: RIGHTMOUSE
+.. data:: WHEELUPMOUSE
+.. data:: WHEELDOWNMOUSE
+.. data:: MOUSEX
+.. data:: MOUSEY
+
+.. _keyboard-keys:
+
+=============
+Keyboard Keys
+=============
+
+-------------
+Alphabet keys
+-------------
+
+.. data:: AKEY
+.. data:: BKEY
+.. data:: CKEY
+.. data:: DKEY
+.. data:: EKEY
+.. data:: FKEY
+.. data:: GKEY
+.. data:: HKEY
+.. data:: IKEY
+.. data:: JKEY
+.. data:: KKEY
+.. data:: LKEY
+.. data:: MKEY
+.. data:: NKEY
+.. data:: OKEY
+.. data:: PKEY
+.. data:: QKEY
+.. data:: RKEY
+.. data:: SKEY
+.. data:: TKEY
+.. data:: UKEY
+.. data:: VKEY
+.. data:: WKEY
+.. data:: XKEY
+.. data:: YKEY
+.. data:: ZKEY
+
+-----------
+Number keys
+-----------
+
+.. data:: ZEROKEY
+.. data:: ONEKEY
+.. data:: TWOKEY
+.. data:: THREEKEY
+.. data:: FOURKEY
+.. data:: FIVEKEY
+.. data:: SIXKEY
+.. data:: SEVENKEY
+.. data:: EIGHTKEY
+.. data:: NINEKEY
+
+--------------
+Modifiers Keys
+--------------
+
+.. data:: CAPSLOCKKEY
+.. data:: LEFTCTRLKEY
+.. data:: LEFTALTKEY
+.. data:: RIGHTALTKEY
+.. data:: RIGHTCTRLKEY
+.. data:: RIGHTSHIFTKEY
+.. data:: LEFTSHIFTKEY
+
+----------
+Arrow Keys
+----------
+
+.. data:: LEFTARROWKEY
+.. data:: DOWNARROWKEY
+.. data:: RIGHTARROWKEY
+.. data:: UPARROWKEY
+
+--------------
+Numberpad Keys
+--------------
+
+.. data:: PAD0
+.. data:: PAD1
+.. data:: PAD2
+.. data:: PAD3
+.. data:: PAD4
+.. data:: PAD5
+.. data:: PAD6
+.. data:: PAD7
+.. data:: PAD8
+.. data:: PAD9
+.. data:: PADPERIOD
+.. data:: PADSLASHKEY
+.. data:: PADASTERKEY
+.. data:: PADMINUS
+.. data:: PADENTER
+.. data:: PADPLUSKEY
+
+-------------
+Function Keys
+-------------
+
+.. data:: F1KEY
+.. data:: F2KEY
+.. data:: F3KEY
+.. data:: F4KEY
+.. data:: F5KEY
+.. data:: F6KEY
+.. data:: F7KEY
+.. data:: F8KEY
+.. data:: F9KEY
+.. data:: F10KEY
+.. data:: F11KEY
+.. data:: F12KEY
+.. data:: F13KEY
+.. data:: F14KEY
+.. data:: F15KEY
+.. data:: F16KEY
+.. data:: F17KEY
+.. data:: F18KEY
+.. data:: F19KEY
+
+----------
+Other Keys
+----------
+
+.. data:: ACCENTGRAVEKEY
+.. data:: BACKSLASHKEY
+.. data:: BACKSPACEKEY
+.. data:: COMMAKEY
+.. data:: DELKEY
+.. data:: ENDKEY
+.. data:: EQUALKEY
+.. data:: ESCKEY
+.. data:: HOMEKEY
+.. data:: INSERTKEY
+.. data:: LEFTBRACKETKEY
+.. data:: LINEFEEDKEY
+.. data:: MINUSKEY
+.. data:: PAGEDOWNKEY
+.. data:: PAGEUPKEY
+.. data:: PAUSEKEY
+.. data:: PERIODKEY
+.. data:: QUOTEKEY
+.. data:: RIGHTBRACKETKEY
+.. data:: RETKEY
+.. data:: SEMICOLONKEY
+.. data:: SLASHKEY
+.. data:: SPACEKEY
+.. data:: TABKEY
diff --git a/source/gameengine/PyDoc/bge.logic.rst b/source/gameengine/PyDoc/bge.logic.rst
new file mode 100644
index 00000000000..a10733569f3
--- /dev/null
+++ b/source/gameengine/PyDoc/bge.logic.rst
@@ -0,0 +1,930 @@
+
+Game Engine bge.logic Module
+============================
+*****
+Intro
+*****
+
+Module to access logic functions, imported automatically into the python controllers namespace.
+
+.. module:: bge.logic
+
+.. code-block:: python
+
+ # To get the controller thats running this python script:
+ cont = bge.logic.getCurrentController() # bge.logic is automatically imported
+
+ # To get the game object this controller is on:
+ obj = cont.owner
+
+:class:`~bge.types.KX_GameObject` and :class:`~bge.types.KX_Camera` or :class:`bge.types.~KX_LightObject` methods are available depending on the type of object
+
+.. code-block:: python
+
+ # To get a sensor linked to this controller.
+ # "sensorname" is the name of the sensor as defined in the Blender interface.
+ # +---------------------+ +--------+
+ # | Sensor "sensorname" +--+ Python +
+ # +---------------------+ +--------+
+ sens = cont.sensors["sensorname"]
+
+ # To get a sequence of all sensors:
+ sensors = co.sensors
+
+See the sensor's reference for available methods:
+
+.. hlist::
+ :columns: 3
+
+ * :class:`~bge.types.KX_MouseFocusSensor`
+ * :class:`~bge.types.KX_NearSensor`
+ * :class:`~bge.types.KX_NetworkMessageSensor`
+ * :class:`~bge.types.KX_RadarSensor`
+ * :class:`~bge.types.KX_RaySensor`
+ * :class:`~bge.types.KX_TouchSensor`
+ * :class:`~bge.types.SCA_DelaySensor`
+ * :class:`~bge.types.SCA_JoystickSensor`
+ * :class:`~bge.types.SCA_KeyboardSensor`
+ * :class:`~bge.types.SCA_MouseSensor`
+ * :class:`~bge.types.SCA_PropertySensor`
+ * :class:`~bge.types.SCA_RandomSensor`
+
+You can also access actuators linked to the controller
+
+.. code-block:: python
+
+ # To get an actuator attached to the controller:
+ # +--------+ +-------------------------+
+ # + Python +--+ Actuator "actuatorname" |
+ # +--------+ +-------------------------+
+ actuator = co.actuators["actuatorname"]
+
+ # Activate an actuator
+ controller.activate(actuator)
+
+See the actuator's reference for available methods
+
+.. hlist::
+ :columns: 3
+
+ * :class:`~bge.types.BL_ActionActuator`
+ * :class:`~bge.types.BL_ShapeActionActuator`
+ * :class:`~bge.types.KX_CameraActuator`
+ * :class:`~bge.types.KX_ConstraintActuator`
+ * :class:`~bge.types.KX_GameActuator`
+ * :class:`~bge.types.KX_IpoActuator`
+ * :class:`~bge.types.KX_NetworkMessageActuator`
+ * :class:`~bge.types.KX_ObjectActuator`
+ * :class:`~bge.types.KX_ParentActuator`
+ * :class:`~bge.types.KX_SCA_AddObjectActuator`
+ * :class:`~bge.types.KX_SCA_DynamicActuator`
+ * :class:`~bge.types.KX_SCA_EndObjectActuator`
+ * :class:`~bge.types.KX_SCA_ReplaceMeshActuator`
+ * :class:`~bge.types.KX_SceneActuator`
+ * :class:`~bge.types.KX_SoundActuator`
+ * :class:`~bge.types.KX_StateActuator`
+ * :class:`~bge.types.KX_TrackToActuator`
+ * :class:`~bge.types.KX_VisibilityActuator`
+ * :class:`~bge.types.SCA_2DFilterActuator`
+ * :class:`~bge.types.SCA_PropertyActuator`
+ * :class:`~bge.types.SCA_RandomActuator`
+
+Most logic brick's methods are accessors for the properties available in the logic buttons.
+Consult the logic bricks documentation for more information on how each logic brick works.
+
+There are also methods to access the current :class:`bge.types.KX_Scene`
+
+.. code-block:: python
+
+ # Get the current scene
+ scene = bge.logic.getCurrentScene()
+
+ # Get the current camera
+ cam = scene.active_camera
+
+Matricies as used by the game engine are **row major**
+``matrix[row][col] = float``
+
+:class:`bge.types.KX_Camera` has some examples using matricies.
+
+*********
+Variables
+*********
+
+.. data:: globalDict
+
+ A dictionary that is saved between loading blend files so you can use it to store inventory and other variables you want to store between scenes and blend files.
+ It can also be written to a file and loaded later on with the game load/save actuators.
+
+ .. note:: only python built in types such as int/string/bool/float/tuples/lists can be saved, GameObjects, Actuators etc will not work as expected.
+
+.. data:: keyboard
+
+ The current keyboard wrapped in an :class:`~bge.types.SCA_PythonKeyboard` object.
+
+.. data:: mouse
+
+ The current mouse wrapped in an :class:`~bge.types.SCA_PythonMouse` object.
+
+*****************
+General functions
+*****************
+
+.. function:: getCurrentController()
+
+ Gets the Python controller associated with this Python script.
+
+ :rtype: :class:`bge.types.SCA_PythonController`
+
+.. function:: getCurrentScene()
+
+ Gets the current Scene.
+
+ :rtype: :class:`bge.types.KX_Scene`
+
+.. function:: getSceneList()
+
+ Gets a list of the current scenes loaded in the game engine.
+
+ :rtype: list of :class:`bge.types.KX_Scene`
+
+ .. note:: Scenes in your blend file that have not been converted wont be in this list. This list will only contain scenes such as overlays scenes.
+
+.. function:: loadGlobalDict()
+
+ Loads bge.logic.globalDict from a file.
+
+.. function:: saveGlobalDict()
+
+ Saves bge.logic.globalDict to a file.
+
+.. function:: startGame(blend)
+
+ Loads the blend file.
+
+ :arg blend: The name of the blend file
+ :type blend: string
+
+.. function:: endGame()
+
+ Ends the current game.
+
+.. function:: restartGame()
+
+ Restarts the current game by reloading the .blend file (the last saved version, not what is currently running).
+
+.. function:: LibLoad(blend, type)
+
+ Converts the all of the datablocks of the given type from the given blend.
+
+ :arg blend: The path to the blend file
+ :type blend: string
+ :arg type: The datablock type (currently only "Scene" and "Mesh" are supported)
+ :type type: string
+
+.. function:: LibNew(name, type, data)
+
+ Uses existing datablock data and loads in as a new library.
+
+ :arg name: A unique library name used for removal later
+ :type name: string
+ :arg type: The datablock type (currently only "Mesh" is supported)
+ :type type: string
+ :arg data: A list of names of the datablocks to load
+ :type data: list of strings
+
+.. function:: LibFree(name)
+
+ Frees a library, removing all objects and meshes from the currently active scenes.
+
+ :arg name: The name of the library to free (the name used in LibNew)
+ :type name: string
+
+.. function:: addScene(name, overlay=1)
+
+ Loads a scene into the game engine.
+
+ :arg name: The name of the scene
+ :type name: string
+ :arg overlay: Overlay or underlay (optional)
+ :type overlay: integer
+
+.. function:: sendMessage(subject, body="", to="", message_from="")
+
+ Sends a message to sensors in any active scene.
+
+ :arg subject: The subject of the message
+ :type subject: string
+ :arg body: The body of the message (optional)
+ :type body: string
+ :arg to: The name of the object to send the message to (optional)
+ :type to: string
+ :arg message_from: The name of the object that the message is coming from (optional)
+ :type message_from: string
+
+.. function:: setGravity(gravity)
+
+ Sets the world gravity.
+
+ :type gravity: list [fx, fy, fz]
+
+.. function:: getSpectrum()
+
+ Returns a 512 point list from the sound card.
+ This only works if the fmod sound driver is being used.
+
+ :rtype: list [float], len(getSpectrum()) == 512
+
+.. function:: stopDSP()
+
+ Stops the sound driver using DSP effects.
+
+ Only the fmod sound driver supports this.
+ DSP can be computationally expensive.
+
+.. function:: getMaxLogicFrame()
+
+ Gets the maximum number of logic frames per render frame.
+
+ :return: The maximum number of logic frames per render frame
+ :rtype: integer
+
+.. function:: setMaxLogicFrame(maxlogic)
+
+ Sets the maximum number of logic frames that are executed per render frame.
+ This does not affect the physic system that still runs at full frame rate.
+
+ :arg maxlogic: The new maximum number of logic frames per render frame. Valid values: 1..5
+ :type maxlogic: integer
+
+.. function:: getMaxPhysicsFrame()
+
+ Gets the maximum number of physics frames per render frame.
+
+ :return: The maximum number of physics frames per render frame
+ :rtype: integer
+
+.. function:: setMaxPhysicsFrame(maxphysics)
+
+ Sets the maximum number of physics timestep that are executed per render frame.
+ Higher value allows physics to keep up with realtime even if graphics slows down the game.
+ Physics timestep is fixed and equal to 1/tickrate (see setLogicTicRate)
+ maxphysics/ticrate is the maximum delay of the renderer that physics can compensate.
+
+ :arg maxphysics: The new maximum number of physics timestep per render frame. Valid values: 1..5.
+ :type maxphysics: integer
+
+.. function:: getLogicTicRate()
+
+ Gets the logic update frequency.
+
+ :return: The logic frequency in Hz
+ :rtype: float
+
+.. function:: setLogicTicRate(ticrate)
+
+ Sets the logic update frequency.
+
+ The logic update frequency is the number of times logic bricks are executed every second.
+ The default is 60 Hz.
+
+ :arg ticrate: The new logic update frequency (in Hz).
+ :type ticrate: float
+
+.. function:: getPhysicsTicRate()
+
+ Gets the physics update frequency
+
+ :return: The physics update frequency in Hz
+ :rtype: float
+
+ .. warning: Not implimented yet
+
+.. function:: setPhysicsTicRate(ticrate)
+
+ Sets the physics update frequency
+
+ The physics update frequency is the number of times the physics system is executed every second.
+ The default is 60 Hz.
+
+ :arg ticrate: The new update frequency (in Hz).
+ :type ticrate: float
+
+ .. warning: Not implimented yet
+
+*****************
+Utility functions
+*****************
+
+.. function:: expandPath(path)
+
+ Converts a blender internal path into a proper file system path.
+
+ Use / as directory separator in path
+ You can use '//' at the start of the string to define a relative path;
+ Blender replaces that string by the directory of the startup .blend or runtime file
+ to make a full path name (doesn't change during the game, even if you load other .blend).
+ The function also converts the directory separator to the local file system format.
+
+ :arg path: The path string to be converted/expanded.
+ :type path: string
+ :return: The converted string
+ :rtype: string
+
+.. function:: getAverageFrameRate()
+
+ Gets the estimated average framerate
+
+ :return: The estimed average framerate in frames per second
+ :rtype: float
+
+.. function:: getBlendFileList(path = "//")
+
+ Returns a list of blend files in the same directory as the open blend file, or from using the option argument.
+
+ :arg path: Optional directory argument, will be expanded (like expandPath) into the full path.
+ :type path: string
+ :return: A list of filenames, with no directory prefix
+ :rtype: list
+
+.. function:: getRandomFloat()
+
+ Returns a random floating point value in the range [0 - 1)
+
+.. function:: PrintGLInfo()
+
+ Prints GL Extension Info into the console
+
+*********
+Constants
+*********
+
+.. data:: KX_TRUE
+
+ True value used by some modules.
+
+.. data:: KX_FALSE
+
+ False value used by some modules.
+
+=======
+Sensors
+=======
+
+.. _sensor-status:
+
+-------------
+Sensor Status
+-------------
+
+.. data:: KX_SENSOR_INACTIVE
+.. data:: KX_SENSOR_JUST_ACTIVATED
+.. data:: KX_SENSOR_ACTIVE
+.. data:: KX_SENSOR_JUST_DEACTIVATED
+
+.. _logic-property-sensor:
+
+---------------
+Property Sensor
+---------------
+
+.. data:: KX_PROPSENSOR_EQUAL
+
+ Activate when the property is equal to the sensor value.
+
+ :value: 1
+
+.. data:: KX_PROPSENSOR_NOTEQUAL
+
+ Activate when the property is not equal to the sensor value.
+
+ :value: 2
+
+.. data:: KX_PROPSENSOR_INTERVAL
+
+ Activate when the property is between the specified limits.
+
+ :value: 3
+
+.. data:: KX_PROPSENSOR_CHANGED
+
+ Activate when the property changes
+
+ :value: 4
+
+.. data:: KX_PROPSENSOR_EXPRESSION
+
+ Activate when the expression matches
+
+ :value: 5
+
+------------
+Radar Sensor
+------------
+
+See :class:`bge.types.KX_RadarSensor`
+
+.. data:: KX_RADAR_AXIS_POS_X
+.. data:: KX_RADAR_AXIS_POS_Y
+.. data:: KX_RADAR_AXIS_POS_Z
+.. data:: KX_RADAR_AXIS_NEG_X
+.. data:: KX_RADAR_AXIS_NEG_Y
+.. data:: KX_RADAR_AXIS_NEG_Z
+
+----------
+Ray Sensor
+----------
+
+See :class:`bge.types.KX_RaySensor`
+
+.. data:: KX_RAY_AXIS_POS_X
+.. data:: KX_RAY_AXIS_POS_Y
+.. data:: KX_RAY_AXIS_POS_Z
+.. data:: KX_RAY_AXIS_NEG_X
+.. data:: KX_RAY_AXIS_NEG_Y
+.. data:: KX_RAY_AXIS_NEG_Z
+
+
+=========
+Actuators
+=========
+
+.. _action-actuator:
+
+---------------
+Action Actuator
+---------------
+
+See :class:`bge.types.BL_ActionActuator`
+
+.. data:: KX_ACTIONACT_PLAY
+.. data:: KX_ACTIONACT_FLIPPER
+.. data:: KX_ACTIONACT_LOOPSTOP
+.. data:: KX_ACTIONACT_LOOPEND
+.. data:: KX_ACTIONACT_PROPERTY
+
+-------------------
+Constraint Actuator
+-------------------
+
+.. _constraint-actuator-option:
+
+See :class:`bge.types.KX_ConstraintActuator.option`
+
+* Applicable to Distance constraint:
+
+ .. data:: KX_ACT_CONSTRAINT_NORMAL
+
+ Activate alignment to surface
+
+ .. data:: KX_ACT_CONSTRAINT_DISTANCE
+
+ Activate distance control
+
+ .. data:: KX_ACT_CONSTRAINT_LOCAL
+
+ Direction of the ray is along the local axis
+
+* Applicable to Force field constraint:
+
+ .. data:: KX_ACT_CONSTRAINT_DOROTFH
+
+ Force field act on rotation as well
+
+* Applicable to both:
+
+ .. data:: KX_ACT_CONSTRAINT_MATERIAL
+
+ Detect material rather than property
+
+ .. data:: KX_ACT_CONSTRAINT_PERMANENT
+
+ No deactivation if ray does not hit target
+
+.. _constraint-actuator-limit:
+
+See :class:`bge.types.KX_ConstraintActuator.limit`
+
+.. data:: KX_CONSTRAINTACT_LOCX
+
+ Limit X coord.
+
+.. data:: KX_CONSTRAINTACT_LOCY
+
+ Limit Y coord
+
+.. data:: KX_CONSTRAINTACT_LOCZ
+
+ Limit Z coord
+
+.. data:: KX_CONSTRAINTACT_ROTX
+
+ Limit X rotation
+
+.. data:: KX_CONSTRAINTACT_ROTY
+
+ Limit Y rotation
+
+.. data:: KX_CONSTRAINTACT_ROTZ
+
+ Limit Z rotation
+
+.. data:: KX_CONSTRAINTACT_DIRNX
+
+ Set distance along negative X axis
+
+.. data:: KX_CONSTRAINTACT_DIRNY
+
+ Set distance along negative Y axis
+
+.. data:: KX_CONSTRAINTACT_DIRNZ
+
+ Set distance along negative Z axis
+
+.. data:: KX_CONSTRAINTACT_DIRPX
+
+ Set distance along positive X axis
+
+.. data:: KX_CONSTRAINTACT_DIRPY
+
+ Set distance along positive Y axis
+
+.. data:: KX_CONSTRAINTACT_DIRPZ
+
+ Set distance along positive Z axis
+
+.. data:: KX_CONSTRAINTACT_ORIX
+
+ Set orientation of X axis
+
+.. data:: KX_CONSTRAINTACT_ORIY
+
+ Set orientation of Y axis
+
+.. data:: KX_CONSTRAINTACT_ORIZ
+
+ Set orientation of Z axis
+
+.. data:: KX_ACT_CONSTRAINT_FHNX
+
+ Set force field along negative X axis
+
+.. data:: KX_ACT_CONSTRAINT_FHNY
+
+ Set force field along negative Y axis
+
+.. data:: KX_ACT_CONSTRAINT_FHNZ
+
+ Set force field along negative Z axis
+
+.. data:: KX_ACT_CONSTRAINT_FHPX
+
+ Set force field along positive X axis
+
+.. data:: KX_ACT_CONSTRAINT_FHPY
+
+ Set force field along positive Y axis
+
+.. data:: KX_ACT_CONSTRAINT_FHPZ
+
+ Set force field along positive Z axis
+
+----------------
+Dynamic Actuator
+----------------
+
+See :class:`bge.types.KX_SCA_DynamicActuator`
+
+.. data:: KX_DYN_RESTORE_DYNAMICS
+.. data:: KX_DYN_DISABLE_DYNAMICS
+.. data:: KX_DYN_ENABLE_RIGID_BODY
+.. data:: KX_DYN_DISABLE_RIGID_BODY
+.. data:: KX_DYN_SET_MASS
+
+.. _game-actuator:
+
+-------------
+Game Actuator
+-------------
+
+See :class:`bge.types.KX_GameActuator`
+
+.. data:: KX_GAME_LOAD
+.. data:: KX_GAME_START
+.. data:: KX_GAME_RESTART
+.. data:: KX_GAME_QUIT
+.. data:: KX_GAME_SAVECFG
+.. data:: KX_GAME_LOADCFG
+
+.. _ipo-actuator:
+
+------------
+IPO Actuator
+------------
+
+See :class:`bge.types.KX_IpoActuator`
+
+.. data:: KX_IPOACT_PLAY
+.. data:: KX_IPOACT_PINGPONG
+.. data:: KX_IPOACT_FLIPPER
+.. data:: KX_IPOACT_LOOPSTOP
+.. data:: KX_IPOACT_LOOPEND
+.. data:: KX_IPOACT_FROM_PROP
+
+---------------
+Parent Actuator
+---------------
+
+.. data:: KX_PARENT_REMOVE
+.. data:: KX_PARENT_SET
+
+.. _logic-random-distributions:
+
+--------------------
+Random Distributions
+--------------------
+
+See :class:`bge.types.SCA_RandomActuator`
+
+.. data:: KX_RANDOMACT_BOOL_CONST
+.. data:: KX_RANDOMACT_BOOL_UNIFORM
+.. data:: KX_RANDOMACT_BOOL_BERNOUILLI
+.. data:: KX_RANDOMACT_INT_CONST
+.. data:: KX_RANDOMACT_INT_UNIFORM
+.. data:: KX_RANDOMACT_INT_POISSON
+.. data:: KX_RANDOMACT_FLOAT_CONST
+.. data:: KX_RANDOMACT_FLOAT_UNIFORM
+.. data:: KX_RANDOMACT_FLOAT_NORMAL
+.. data:: KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL
+
+--------------
+Scene Actuator
+--------------
+
+See :class:`bge.types.KX_SceneActuator`
+
+.. data:: KX_SCENE_RESTART
+.. data:: KX_SCENE_SET_SCENE
+.. data:: KX_SCENE_SET_CAMERA
+.. data:: KX_SCENE_ADD_FRONT_SCENE
+.. data:: KX_SCENE_ADD_BACK_SCENE
+.. data:: KX_SCENE_REMOVE_SCENE
+.. data:: KX_SCENE_SUSPEND
+.. data:: KX_SCENE_RESUME
+
+.. _shape-action-actuator:
+
+---------------------
+Shape Action Actuator
+---------------------
+
+See :class:`bge.types.BL_ActionActuator`
+
+.. data:: KX_ACTIONACT_PLAY
+.. data:: KX_ACTIONACT_FLIPPER
+.. data:: KX_ACTIONACT_LOOPSTOP
+.. data:: KX_ACTIONACT_LOOPEND
+.. data:: KX_ACTIONACT_PROPERTY
+
+.. _logic-sound-actuator:
+
+--------------
+Sound Actuator
+--------------
+
+See :class:`bge.types.KX_SoundActuator`
+
+.. data:: KX_SOUNDACT_PLAYSTOP
+
+ :value: 1
+
+.. data:: KX_SOUNDACT_PLAYEND
+
+ :value: 2
+
+.. data:: KX_SOUNDACT_LOOPSTOP
+
+ :value: 3
+
+.. data:: KX_SOUNDACT_LOOPEND
+
+ :value: 4
+
+.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL
+
+ :value: 5
+
+.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP
+
+ :value: 6
+
+
+=======
+Various
+=======
+
+.. _input-status:
+
+------------
+Input Status
+------------
+
+See :class:`bge.types.SCA_PythonKeyboard`, :class:`bge.types.SCA_PythonMouse`, :class:`bge.types.SCA_MouseSensor`, :class:`bge.types.SCA_KeyboardSensor`
+
+.. data:: KX_INPUT_NONE
+.. data:: KX_INPUT_JUST_ACTIVATED
+.. data:: KX_INPUT_ACTIVE
+.. data:: KX_INPUT_JUST_RELEASED
+
+-------------
+Mouse Buttons
+-------------
+
+See :class:`bge.types.SCA_MouseSensor`
+
+.. data:: KX_MOUSE_BUT_LEFT
+.. data:: KX_MOUSE_BUT_MIDDLE
+.. data:: KX_MOUSE_BUT_RIGHT
+
+------
+States
+------
+
+See :class:`bge.types.KX_StateActuator`
+
+.. data:: KX_STATE1
+.. data:: KX_STATE2
+.. data:: KX_STATE3
+.. data:: KX_STATE4
+.. data:: KX_STATE5
+.. data:: KX_STATE6
+.. data:: KX_STATE7
+.. data:: KX_STATE8
+.. data:: KX_STATE9
+.. data:: KX_STATE10
+.. data:: KX_STATE11
+.. data:: KX_STATE12
+.. data:: KX_STATE13
+.. data:: KX_STATE14
+.. data:: KX_STATE15
+.. data:: KX_STATE16
+.. data:: KX_STATE17
+.. data:: KX_STATE18
+.. data:: KX_STATE19
+.. data:: KX_STATE20
+.. data:: KX_STATE21
+.. data:: KX_STATE22
+.. data:: KX_STATE23
+.. data:: KX_STATE24
+.. data:: KX_STATE25
+.. data:: KX_STATE26
+.. data:: KX_STATE27
+.. data:: KX_STATE28
+.. data:: KX_STATE29
+.. data:: KX_STATE30
+
+.. _state-actuator-operation:
+
+See :class:`bge.types.KX_StateActuator.operation`
+
+.. data:: KX_STATE_OP_CLR
+
+ Substract bits to state mask
+
+ :value: 0
+
+.. data:: KX_STATE_OP_CPY
+
+ Copy state mask
+
+ :value: 1
+
+.. data:: KX_STATE_OP_NEG
+
+ Invert bits to state mask
+
+ :value: 2
+
+.. data:: KX_STATE_OP_SET
+
+ Add bits to state mask
+
+ :value: 3
+
+.. _Two-D-FilterActuator-mode:
+
+---------
+2D Filter
+---------
+
+.. data:: RAS_2DFILTER_BLUR
+
+ :value: 2
+
+.. data:: RAS_2DFILTER_CUSTOMFILTER
+
+ Customer filter, the code code is set via shaderText property.
+
+ :value: 12
+
+.. data:: RAS_2DFILTER_DILATION
+
+ :value: 4
+
+.. data:: RAS_2DFILTER_DISABLED
+
+ Disable the filter that is currently active
+
+ :value: -1
+
+.. data:: RAS_2DFILTER_ENABLED
+
+ Enable the filter that was previously disabled
+
+ :value: -2
+
+.. data:: RAS_2DFILTER_EROSION
+
+ :value: 5
+
+.. data:: RAS_2DFILTER_GRAYSCALE
+
+ :value: 9
+
+.. data:: RAS_2DFILTER_INVERT
+
+ :value: 11
+
+.. data:: RAS_2DFILTER_LAPLACIAN
+
+ :value: 6
+
+.. data:: RAS_2DFILTER_MOTIONBLUR
+
+ Create and enable preset filters
+
+ :value: 1
+
+.. data:: RAS_2DFILTER_NOFILTER
+
+ Disable and destroy the filter that is currently active
+
+ :value: 0
+
+.. data:: RAS_2DFILTER_PREWITT
+
+ :value: 8
+
+.. data:: RAS_2DFILTER_SEPIA
+
+ :value: 10
+
+.. data:: RAS_2DFILTER_SHARPEN
+
+ :value: 3
+
+.. data:: RAS_2DFILTER_SOBEL
+
+ :value: 7
+
+------
+Shader
+------
+
+.. data:: VIEWMATRIX
+.. data:: VIEWMATRIX_INVERSE
+.. data:: VIEWMATRIX_INVERSETRANSPOSE
+.. data:: VIEWMATRIX_TRANSPOSE
+.. data:: MODELMATRIX
+.. data:: MODELMATRIX_INVERSE
+.. data:: MODELMATRIX_INVERSETRANSPOSE
+.. data:: MODELMATRIX_TRANSPOSE
+.. data:: MODELVIEWMATRIX
+.. data:: MODELVIEWMATRIX_INVERSE
+.. data:: MODELVIEWMATRIX_INVERSETRANSPOSE
+.. data:: MODELVIEWMATRIX_TRANSPOSE
+.. data:: CAM_POS
+
+ Current camera position
+
+.. data:: CONSTANT_TIMER
+
+ User a timer for the uniform value.
+
+.. data:: SHD_TANGENT
+
+----------------
+Blender Material
+----------------
+
+.. data:: BL_DST_ALPHA
+.. data:: BL_DST_COLOR
+.. data:: BL_ONE
+.. data:: BL_ONE_MINUS_DST_ALPHA
+.. data:: BL_ONE_MINUS_DST_COLOR
+.. data:: BL_ONE_MINUS_SRC_ALPHA
+.. data:: BL_ONE_MINUS_SRC_COLOR
+.. data:: BL_SRC_ALPHA
+.. data:: BL_SRC_ALPHA_SATURATE
+.. data:: BL_SRC_COLOR
+.. data:: BL_ZERO
diff --git a/source/gameengine/PyDoc/bge.render.rst b/source/gameengine/PyDoc/bge.render.rst
new file mode 100644
index 00000000000..9f17455601b
--- /dev/null
+++ b/source/gameengine/PyDoc/bge.render.rst
@@ -0,0 +1,242 @@
+
+Game Engine bge.render Module
+=============================
+
+*****
+Intro
+*****
+
+.. module:: bge.render
+
+.. code-block:: python
+
+ # Example Uses an L{SCA_MouseSensor}, and two L{KX_ObjectActuator}s to implement MouseLook::
+ # To use a mouse movement sensor "Mouse" and a
+ # motion actuator to mouse look:
+ import bge.render
+ import bge.logic
+
+ # SCALE sets the speed of motion
+ SCALE=[1, 0.5]
+
+ co = bge.logic.getCurrentController()
+ obj = co.getOwner()
+ mouse = co.getSensor("Mouse")
+ lmotion = co.getActuator("LMove")
+ wmotion = co.getActuator("WMove")
+
+ # Transform the mouse coordinates to see how far the mouse has moved.
+ def mousePos():
+ x = (bge.render.getWindowWidth()/2 - mouse.getXPosition())*SCALE[0]
+ y = (bge.render.getWindowHeight()/2 - mouse.getYPosition())*SCALE[1]
+ return (x, y)
+
+ pos = mousePos()
+
+ # Set the amount of motion: X is applied in world coordinates...
+ lmotion.setTorque(0.0, 0.0, pos[0], False)
+ # ...Y is applied in local coordinates
+ wmotion.setTorque(-pos[1], 0.0, 0.0, True)
+
+ # Activate both actuators
+ bge.logic.addActiveActuator(lmotion, True)
+ bge.logic.addActiveActuator(wmotion, True)
+
+ # Centre the mouse
+ bge.render.setMousePosition(bge.render.getWindowWidth()/2, bge.render.getWindowHeight()/2)
+
+*********
+Constants
+*********
+
+.. data:: KX_TEXFACE_MATERIAL
+
+ Materials as defined by the texture face settings.
+
+.. data:: KX_BLENDER_MULTITEX_MATERIAL
+
+ Materials approximating blender materials with multitexturing.
+
+.. data:: KX_BLENDER_GLSL_MATERIAL
+
+ Materials approximating blender materials with GLSL.
+
+*********
+Functions
+*********
+
+.. function:: getWindowWidth()
+
+ Gets the width of the window (in pixels)
+
+ :rtype: integer
+
+.. function:: getWindowHeight()
+
+ Gets the height of the window (in pixels)
+
+ :rtype: integer
+
+.. function:: makeScreenshot(filename)
+
+ Writes a screenshot to the given filename.
+
+ If filename starts with // the image will be saved relative to the current directory.
+ If the filename contains # it will be replaced with the frame number.
+
+ The standalone player saves .png files. It does not support colour space conversion
+ or gamma correction.
+
+ When run from Blender, makeScreenshot supports Iris, IrisZ, TGA, Raw TGA, PNG, HamX, and Jpeg.
+ Gamma, Colourspace conversion and Jpeg compression are taken from the Render settings panels.
+
+ :type filename: string
+
+
+.. function:: enableVisibility(visible)
+
+ Doesn't really do anything...
+
+
+.. function:: showMouse(visible)
+
+ Enables or disables the operating system mouse cursor.
+
+ :type visible: boolean
+
+
+.. function:: setMousePosition(x, y)
+
+ Sets the mouse cursor position.
+
+ :type x: integer
+ :type y: integer
+
+
+.. function:: setBackgroundColor(rgba)
+
+ Sets the window background colour.
+
+ :type rgba: list [r, g, b, a]
+
+
+.. function:: setMistColor(rgb)
+
+ Sets the mist colour.
+
+ :type rgb: list [r, g, b]
+
+
+.. function:: setAmbientColor(rgb)
+
+ Sets the color of ambient light.
+
+ :type rgb: list [r, g, b]
+
+
+.. function:: setMistStart(start)
+
+ Sets the mist start value. Objects further away than start will have mist applied to them.
+
+ :type start: float
+
+
+.. function:: setMistEnd(end)
+
+ Sets the mist end value. Objects further away from this will be coloured solid with
+ the colour set by setMistColor().
+
+ :type end: float
+
+
+.. function:: disableMist()
+
+ Disables mist.
+
+ .. note:: Set any of the mist properties to enable mist.
+
+
+.. function:: setEyeSeparation(eyesep)
+
+ Sets the eye separation for stereo mode. Usually Focal Length/30 provides a confortable value.
+
+ :arg eyesep: The distance between the left and right eye.
+ :type eyesep: float
+
+
+.. function:: getEyeSeparation()
+
+ Gets the current eye separation for stereo mode.
+
+ :rtype: float
+
+
+.. function:: setFocalLength(focallength)
+
+ Sets the focal length for stereo mode. It uses the current camera focal length as initial value.
+
+ :arg focallength: The focal length.
+ :type focallength: float
+
+.. function:: getFocalLength()
+
+ Gets the current focal length for stereo mode.
+
+ :rtype: float
+
+.. function:: setMaterialMode(mode)
+
+ Set the material mode to use for OpenGL rendering.
+
+ :type mode: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
+
+ .. note:: Changes will only affect newly created scenes.
+
+
+.. function:: getMaterialMode(mode)
+
+ Get the material mode to use for OpenGL rendering.
+
+ :rtype: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
+
+
+.. function:: setGLSLMaterialSetting(setting, enable)
+
+ Enables or disables a GLSL material setting.
+
+ :type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
+ :type enable: boolean
+
+
+.. function:: getGLSLMaterialSetting(setting, enable)
+
+ Get the state of a GLSL material setting.
+
+ :type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
+ :rtype: boolean
+
+
+.. function:: drawLine(fromVec,toVec,color)
+
+ Draw a line in the 3D scene.
+
+ :arg fromVec: the origin of the line
+ :type fromVec: list [x, y, z]
+ :arg toVec: the end of the line
+ :type toVec: list [x, y, z]
+ :arg color: the color of the line
+ :type color: list [r, g, b]
+
+
+.. function:: enableMotionBlur(factor)
+
+ Enable the motion blur effect.
+
+ :arg factor: the ammount of motion blur to display.
+ :type factor: float [0.0 - 1.0]
+
+
+.. function:: disableMotionBlur()
+
+ Disable the motion blur effect.
+
diff --git a/source/gameengine/PyDoc/bge.types.rst b/source/gameengine/PyDoc/bge.types.rst
new file mode 100644
index 00000000000..028b4fa72f3
--- /dev/null
+++ b/source/gameengine/PyDoc/bge.types.rst
@@ -0,0 +1,5202 @@
+
+Game Engine bge.types Module
+=============================
+
+.. module:: bge.types
+
+.. class:: PyObjectPlus
+
+ PyObjectPlus base class of most other types in the Game Engine.
+
+ .. attribute:: invalid
+
+ Test if the object has been freed by the game engine and is no longer valid.
+
+ Normally this is not a problem but when storing game engine data in the GameLogic module,
+ KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data.
+ Calling an attribute or method on an invalid object will raise a SystemError.
+
+ The invalid attribute allows testing for this case without exception handling.
+
+ :type: boolean
+
+ .. method:: isA(game_type)
+
+ Check if this is a type or a subtype game_type.
+
+ :arg game_type: the name of the type or the type its self from the :mod:`bge.types` module.
+ :type game_type: string or type
+ :return: True if this object is a type or a subtype of game_type.
+ :rtype: boolean
+
+.. class:: CValue(PyObjectPlus)
+
+ This class is a basis for other classes.
+
+ .. attribute:: name
+
+ The name of this CValue derived object (read-only).
+
+ :type: string
+
+.. class:: CPropValue(CValue)
+
+ This class has no python functions
+
+.. class:: SCA_ILogicBrick(CValue)
+
+ Base class for all logic bricks.
+
+ .. attribute:: executePriority
+
+ This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first).
+
+ :type: executePriority: int
+
+ .. attribute:: owner
+
+ The game object this logic brick is attached to (read-only).
+
+ :type: :class:`KX_GameObject` or None in exceptional cases.
+
+ .. attribute:: name
+
+ The name of this logic brick (read-only).
+
+ :type: string
+
+.. class:: SCA_PythonKeyboard(PyObjectPlus)
+
+ The current keyboard.
+
+ .. attribute:: events
+
+ A list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only).
+
+ :type: list [[:ref:`keycode<keyboard-keys>`, :ref:`status<input-status>`], ...]
+
+.. class:: SCA_PythonMouse(PyObjectPlus)
+
+ The current mouse.
+
+ .. attribute:: events
+
+ a list of pressed buttons that have either been pressed, or just released, or are active this frame. (read-only).
+
+ :type: list [[:ref:`keycode<mouse-keys>`, :ref:`status<input-status>`], ...]
+
+ .. attribute:: position
+
+ The normalized x and y position of the mouse cursor.
+
+ :type: list [x, y]
+
+ .. attribute:: visible
+
+ The visibility of the mouse cursor.
+
+ :type: boolean
+
+.. class:: SCA_IObject(CValue)
+
+ This class has no python functions
+
+.. class:: SCA_ISensor(SCA_ILogicBrick)
+
+ Base class for all sensor logic bricks.
+
+ .. attribute:: usePosPulseMode
+
+ Flag to turn positive pulse mode on and off.
+
+ :type: boolean
+
+ .. attribute:: useNegPulseMode
+
+ Flag to turn negative pulse mode on and off.
+
+ :type: boolean
+
+ .. attribute:: frequency
+
+ The frequency for pulse mode sensors.
+
+ :type: integer
+
+ .. attribute:: level
+
+ level Option whether to detect level or edge transition when entering a state.
+ It makes a difference only in case of logic state transition (state actuator).
+ A level detector will immediately generate a pulse, negative or positive
+ depending on the sensor condition, as soon as the state is activated.
+ A edge detector will wait for a state change before generating a pulse.
+ note: mutually exclusive with :data:`tap`, enabling will disable :data:`tap`.
+
+ :type: boolean
+
+ .. attribute:: tap
+
+ When enabled only sensors that are just activated will send a positive event,
+ after this they will be detected as negative by the controllers.
+ This will make a key thats held act as if its only tapped for an instant.
+ note: mutually exclusive with :data:`level`, enabling will disable :data:`level`.
+
+ :type: boolean
+
+ .. attribute:: invert
+
+ Flag to set if this sensor activates on positive or negative events.
+
+ :type: boolean
+
+ .. attribute:: triggered
+
+ True if this sensor brick is in a positive state. (read-only).
+
+ :type: boolean
+
+ .. attribute:: positive
+
+ True if this sensor brick is in a positive state. (read-only).
+
+ :type: boolean
+
+ .. attribute:: status
+
+ The status of the sensor (read-only): can be one of :ref:`these constants<sensor-status>`.
+
+ :type: int
+
+ .. note::
+
+ This convenient attribute combines the values of triggered and positive attributes.
+
+ .. method:: reset()
+
+ Reset sensor internal state, effect depends on the type of sensor and settings.
+
+ The sensor is put in its initial state as if it was just activated.
+
+.. class:: SCA_IController(SCA_ILogicBrick)
+
+ Base class for all controller logic bricks.
+
+ .. attribute:: state
+
+ The controllers state bitmask. This can be used with the GameObject's state to test if the controller is active.
+
+ :type: int bitmask
+
+ .. attribute:: sensors
+
+ A list of sensors linked to this controller.
+
+ :type: sequence supporting index/string lookups and iteration.
+
+ .. note::
+
+ The sensors are not necessarily owned by the same object.
+
+ .. note::
+
+ When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
+
+ .. attribute:: actuators
+
+ A list of actuators linked to this controller.
+
+ :type: sequence supporting index/string lookups and iteration.
+
+ .. note::
+
+ The sensors are not necessarily owned by the same object.
+
+ .. note::
+
+ When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
+
+ .. attribute:: useHighPriority
+
+ When set the controller executes always before all other controllers that dont have this set.
+
+ :type: boolen
+
+ .. note::
+
+ Order of execution between high priority controllers is not guaranteed.
+
+.. class:: SCA_IActuator(SCA_ILogicBrick)
+
+ Base class for all actuator logic bricks.
+
+.. class:: BL_ActionActuator(SCA_IActuator)
+
+ Action Actuators apply an action to an actor.
+
+ .. attribute:: action
+
+ The name of the action to set as the current action.
+
+ :type: string
+
+ .. attribute:: channelNames
+
+ A list of channel names that may be used with :data:`setChannel` and :data:`getChannel`.
+
+ :type: list of strings
+
+ .. attribute:: frameStart
+
+ Specifies the starting frame of the animation.
+
+ :type: float
+
+ .. attribute:: frameEnd
+
+ Specifies the ending frame of the animation.
+
+ :type: float
+
+ .. attribute:: blendIn
+
+ Specifies the number of frames of animation to generate when making transitions between actions.
+
+ :type: float
+
+ .. attribute:: priority
+
+ Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
+
+ :type: integer
+
+ .. attribute:: frame
+
+ Sets the current frame for the animation.
+
+ :type: float
+
+ .. attribute:: propName
+
+ Sets the property to be used in FromProp playback mode.
+
+ :type: string
+
+ .. attribute:: blendTime
+
+ Sets the internal frame timer. This property must be in the range from 0.0 to blendIn.
+
+ :type: float
+
+ .. attribute:: mode
+
+ The operation mode of the actuator. Can be one of :ref:`these constants<action-actuator>`.
+
+ :type: integer
+
+ .. attribute:: useContinue
+
+ The actions continue option, True or False. When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame.
+
+ :type: boolean
+
+ .. attribute:: framePropName
+
+ The name of the property that is set to the current frame number.
+
+ :type: string
+
+ .. method:: setChannel(channel, matrix)
+
+ Alternative to the 2 arguments, 4 arguments (channel, matrix, loc, size, quat) are also supported.
+
+ :arg channel: A string specifying the name of the bone channel, error raised if not in :data:`channelNames`.
+ :type channel: string
+ :arg matrix: A 4x4 matrix specifying the overriding transformation as an offset from the bone's rest position.
+ :arg matrix: list [[float]]
+
+ .. note::
+
+ These values are relative to the bones rest position, currently the api has no way to get this info (which is annoying), but can be worked around by using bones with a rest pose that has no translation.
+
+ .. method:: getChannel(channel)
+
+ :arg channel: A string specifying the name of the bone channel. error raised if not in :data:`channelNames`.
+ :type channel: string
+ :return: (loc, size, quat)
+ :rtype: tuple
+
+.. class:: BL_Shader(PyObjectPlus)
+
+ BL_Shader GLSL shaders.
+
+ TODO - Description
+
+ .. method:: setUniformfv(name, fList)
+
+ Set a uniform with a list of float values
+
+ :arg name: the uniform name
+ :type name: string
+ :arg fList: a list (2, 3 or 4 elements) of float values
+ :type fList: list[float]
+
+ .. method:: delSource()
+
+ Clear the shader. Use this method before the source is changed with :data:`setSource`.
+
+ .. method:: getFragmentProg()
+
+ Returns the fragment program.
+
+ :return: The fragment program.
+ :rtype: string
+
+ .. method:: getVertexProg()
+
+ Get the vertex program.
+
+ :return: The vertex program.
+ :rtype: string
+
+ .. method:: isValid()
+
+ Check if the shader is valid.
+
+ :return: True if the shader is valid
+ :rtype: boolean
+
+ .. method:: setAttrib(enum)
+
+ Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.)
+
+ :arg enum: attribute location value
+ :type enum: integer
+
+ .. method:: setNumberOfPasses( max_pass )
+
+ Set the maximum number of passes. Not used a.t.m.
+
+ :arg max_pass: the maximum number of passes
+ :type max_pass: integer
+
+ .. method:: setSampler(name, index)
+
+ Set uniform texture sample index.
+
+ :arg name: Uniform name
+ :type name: string
+ :arg index: Texture sample index.
+ :type index: integer
+
+ .. method:: setSource(vertexProgram, fragmentProgram)
+
+ Set the vertex and fragment programs
+
+ :arg vertexProgram: Vertex program
+ :type vertexProgram: string
+ :arg fragmentProgram: Fragment program
+ :type fragmentProgram: string
+
+ .. method:: setUniform1f(name, fx)
+
+ Set a uniform with 1 float value.
+
+ :arg name: the uniform name
+ :type name: string
+ :arg fx: Uniform value
+ :type fx: float
+
+ .. method:: setUniform1i(name, ix)
+
+ Set a uniform with an integer value.
+
+ :arg name: the uniform name
+ :type name: string
+ :arg ix: the uniform value
+ :type ix: integer
+
+ .. method:: setUniform2f(name, fx, fy)
+
+ Set a uniform with 2 float values
+
+ :arg name: the uniform name
+ :type name: string
+ :arg fx: first float value
+ :type fx: float
+
+ :arg fy: second float value
+ :type fy: float
+
+ .. method:: setUniform2i(name, ix, iy)
+
+ Set a uniform with 2 integer values
+
+ :arg name: the uniform name
+ :type name: string
+ :arg ix: first integer value
+ :type ix: integer
+ :arg iy: second integer value
+ :type iy: integer
+
+ .. method:: setUniform3f(name, fx, fy, fz)
+
+ Set a uniform with 3 float values.
+
+ :arg name: the uniform name
+ :type name: string
+ :arg fx: first float value
+ :type fx: float
+ :arg fy: second float value
+ :type fy: float
+ :arg fz: third float value
+ :type fz: float
+
+ .. method:: setUniform3i(name, ix, iy, iz)
+
+ Set a uniform with 3 integer values
+
+ :arg name: the uniform name
+ :type name: string
+ :arg ix: first integer value
+ :type ix: integer
+ :arg iy: second integer value
+ :type iy: integer
+ :arg iz: third integer value
+ :type iz: integer
+
+ .. method:: setUniform4f(name, fx, fy, fz, fw)
+
+ Set a uniform with 4 float values.
+
+ :arg name: the uniform name
+ :type name: string
+ :arg fx: first float value
+ :type fx: float
+ :arg fy: second float value
+ :type fy: float
+ :arg fz: third float value
+ :type fz: float
+ :arg fw: fourth float value
+ :type fw: float
+
+ .. method:: setUniform4i(name, ix, iy, iz, iw)
+
+ Set a uniform with 4 integer values
+
+ :arg name: the uniform name
+ :type name: string
+ :arg ix: first integer value
+ :type ix: integer
+ :arg iy: second integer value
+ :type iy: integer
+ :arg iz: third integer value
+ :type iz: integer
+ :arg iw: fourth integer value
+ :type iw: integer
+
+ .. method:: setUniformDef(name, type)
+
+ Define a new uniform
+
+ :arg name: the uniform name
+ :type name: string
+ :arg type: uniform type
+ :type type: UNI_NONE, UNI_INT, UNI_FLOAT, UNI_INT2, UNI_FLOAT2, UNI_INT3, UNI_FLOAT3, UNI_INT4, UNI_FLOAT4, UNI_MAT3, UNI_MAT4, UNI_MAX
+
+ .. method:: setUniformMatrix3(name, mat, transpose)
+
+ Set a uniform with a 3x3 matrix value
+
+ :arg name: the uniform name
+ :type name: string
+ :arg mat: A 3x3 matrix [[f, f, f], [f, f, f], [f, f, f]]
+ :type mat: 3x3 matrix
+ :arg transpose: set to True to transpose the matrix
+ :type transpose: boolean
+
+ .. method:: setUniformMatrix4(name, mat, transpose)
+
+ Set a uniform with a 4x4 matrix value
+
+ :arg name: the uniform name
+ :type name: string
+ :arg mat: A 4x4 matrix [[f, f, f, f], [f, f, f, f], [f, f, f, f], [f, f, f, f]]
+ :type mat: 4x4 matrix
+ :arg transpose: set to True to transpose the matrix
+ :type transpose: boolean
+
+ .. method:: setUniformiv(name, iList)
+
+ Set a uniform with a list of integer values
+
+ :arg name: the uniform name
+ :type name: string
+ :arg iList: a list (2, 3 or 4 elements) of integer values
+ :type iList: list[integer]
+
+ .. method:: validate()
+
+ Validate the shader object.
+
+.. class:: BL_ShapeActionActuator(SCA_IActuator)
+
+ ShapeAction Actuators apply an shape action to an mesh object.
+
+ .. attribute:: action
+
+ The name of the action to set as the current shape action.
+
+ :type: string
+
+ .. attribute:: frameStart
+
+ Specifies the starting frame of the shape animation.
+
+ :type: float
+
+ .. attribute:: frameEnd
+
+ Specifies the ending frame of the shape animation.
+
+ :type: float
+
+ .. attribute:: blendIn
+
+ Specifies the number of frames of animation to generate when making transitions between actions.
+
+ :type: float
+
+ .. attribute:: priority
+
+ Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
+
+ :type: integer
+
+ .. attribute:: frame
+
+ Sets the current frame for the animation.
+
+ :type: float
+
+ .. attribute:: propName
+
+ Sets the property to be used in FromProp playback mode.
+
+ :type: string
+
+ .. attribute:: blendTime
+
+ Sets the internal frame timer. This property must be in the range from 0.0 to blendin.
+
+ :type: float
+
+ .. attribute:: mode
+
+ The operation mode of the actuator. Can be one of :ref:`these constants<shape-action-actuator>`.
+
+ :type: integer
+
+ .. attribute:: framePropName
+
+ The name of the property that is set to the current frame number.
+
+ :type: string
+
+.. class:: CListValue(CPropValue)
+
+ This is a list like object used in the game engine internally that behaves similar to a python list in most ways.
+
+ As well as the normal index lookup (``val= clist[i]``), CListValue supports string lookups (``val= scene.objects["Cube"]``)
+
+ Other operations such as ``len(clist)``, ``list(clist)``, ``clist[0:10]`` are also supported.
+
+ .. method:: append(val)
+
+ Add an item to the list (like pythons append)
+
+ .. warning::
+
+ Appending values to the list can cause crashes when the list is used internally by the game engine.
+
+ .. method:: count(val)
+
+ Count the number of instances of a value in the list.
+
+ :return: number of instances
+ :rtype: integer
+
+ .. method:: index(val)
+
+ Return the index of a value in the list.
+
+ :return: The index of the value in the list.
+ :rtype: integer
+
+ .. method:: reverse()
+
+ Reverse the order of the list.
+
+ .. method:: get(key, default=None)
+
+ Return the value matching key, or the default value if its not found.
+
+ :return: The key value or a default.
+
+ .. method:: from_id(id)
+
+ This is a funtion especially for the game engine to return a value with a spesific id.
+
+ Since object names are not always unique, the id of an object can be used to get an object from the CValueList.
+
+ Example:
+
+ .. code-block:: python
+
+ myObID=id(gameObject)
+ ob= scene.objects.from_id(myObID)
+
+ Where ``myObID`` is an int or long from the id function.
+
+ This has the advantage that you can store the id in places you could not store a gameObject.
+
+ .. warning::
+
+ The id is derived from a memory location and will be different each time the game engine starts.
+
+.. class:: KX_BlenderMaterial(PyObjectPlus)
+
+ KX_BlenderMaterial
+
+ .. method:: getShader()
+
+ Returns the material's shader.
+
+ :return: the material's shader
+ :rtype: :class:`BL_Shader`
+
+ .. method:: setBlending(src, dest)
+
+ Set the pixel color arithmetic functions.
+
+ :arg src: Specifies how the red, green, blue, and alpha source blending factors are computed.
+ :type src: Value in...
+
+ * GL_ZERO,
+ * GL_ONE,
+ * GL_SRC_COLOR,
+ * GL_ONE_MINUS_SRC_COLOR,
+ * GL_DST_COLOR,
+ * GL_ONE_MINUS_DST_COLOR,
+ * GL_SRC_ALPHA,
+ * GL_ONE_MINUS_SRC_ALPHA,
+ * GL_DST_ALPHA,
+ * GL_ONE_MINUS_DST_ALPHA,
+ * GL_SRC_ALPHA_SATURATE
+
+ :arg dest: Specifies how the red, green, blue, and alpha destination blending factors are computed.
+ :type dest: Value in...
+
+ * GL_ZERO
+ * GL_ONE
+ * GL_SRC_COLOR
+ * GL_ONE_MINUS_SRC_COLOR
+ * GL_DST_COLOR
+ * GL_ONE_MINUS_DST_COLOR
+ * GL_SRC_ALPHA
+ * GL_ONE_MINUS_SRC_ALPHA
+ * GL_DST_ALPHA
+ * GL_ONE_MINUS_DST_ALPHA
+ * GL_SRC_ALPHA_SATURATE
+
+ .. method:: getMaterialIndex()
+
+ Returns the material's index.
+
+ :return: the material's index
+ :rtype: integer
+
+.. class:: KX_CameraActuator(SCA_IActuator)
+
+ Applies changes to a camera.
+
+ .. attribute:: min
+
+ minimum distance to the target object maintained by the actuator.
+
+ :type: float
+
+ .. attribute:: max
+
+ maximum distance to stay from the target object.
+
+ :type: float
+
+ .. attribute:: height
+
+ height to stay above the target object.
+
+ :type: float
+
+ .. attribute:: useXY
+
+ axis this actuator is tracking, True=X, False=Y.
+
+ :type: boolean
+
+ .. attribute:: object
+
+ the object this actuator tracks.
+
+ :type: :class:`KX_GameObject` or None
+
+.. class:: KX_ConstraintActuator(SCA_IActuator)
+
+ A constraint actuator limits the position, rotation, distance or orientation of an object.
+
+ .. attribute:: damp
+
+ Time constant of the constraint expressed in frame (not use by Force field constraint).
+
+ :type: integer
+
+ .. attribute:: rotDamp
+
+ Time constant for the rotation expressed in frame (only for the distance constraint), 0 = use damp for rotation as well.
+
+ :type: integer
+
+ .. attribute:: direction
+
+ The reference direction in world coordinate for the orientation constraint.
+
+ :type: 3-tuple of float: (x, y, z)
+
+ .. attribute:: option
+
+ Binary combination of :ref:`these constants <constraint-actuator-option>`
+
+ :type: integer
+
+ .. attribute:: time
+
+ activation time of the actuator. The actuator disables itself after this many frame. If set to 0, the actuator is not limited in time.
+
+ :type: integer
+
+ .. attribute:: propName
+
+ the name of the property or material for the ray detection of the distance constraint.
+
+ :type: string
+
+ .. attribute:: min
+
+ The lower bound of the constraint. For the rotation and orientation constraint, it represents radiant.
+
+ :type: float
+
+ .. attribute:: distance
+
+ the target distance of the distance constraint.
+
+ :type: float
+
+ .. attribute:: max
+
+ the upper bound of the constraint. For rotation and orientation constraints, it represents radiant.
+
+ :type: float
+
+ .. attribute:: rayLength
+
+ the length of the ray of the distance constraint.
+
+ :type: float
+
+ .. attribute:: limit
+
+ type of constraint. Use one of the :ref:`these constants <constraint-actuator-limit>`
+
+ :type: integer.
+
+
+.. class:: KX_ConstraintWrapper(PyObjectPlus)
+
+ KX_ConstraintWrapper
+
+ .. method:: getConstraintId(val)
+
+ Returns the contraint's ID
+
+ :return: the constraint's ID
+ :rtype: integer
+
+.. class:: KX_GameActuator(SCA_IActuator)
+
+ The game actuator loads a new .blend file, restarts the current .blend file or quits the game.
+
+ .. attribute:: fileName
+
+ the new .blend file to load.
+
+ :type: string
+
+ .. attribute:: mode
+
+ The mode of this actuator. Can be on of :ref:`these constants <game-actuator>`
+
+ :type: Int
+
+.. class:: KX_GameObject(SCA_IObject)
+
+ All game objects are derived from this class.
+
+ Properties assigned to game objects are accessible as attributes of this class.
+
+ .. note::
+
+ Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, if an object may have been removed since last accessing it use the :data:`invalid` attribute to check.
+
+ .. attribute:: name
+
+ The object's name. (read-only).
+
+ :type: string
+
+ .. attribute:: mass
+
+ The object's mass
+
+ :type: float
+
+ .. note::
+
+ The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0.
+
+ .. attribute:: linVelocityMin
+
+ Enforces the object keeps moving at a minimum velocity.
+
+ :type: float
+
+ .. note::
+
+ Applies to dynamic and rigid body objects only.
+
+ .. note::
+
+ A value of 0.0 disables this option.
+
+ .. note::
+
+ While objects are stationary the minimum velocity will not be applied.
+
+ .. attribute:: linVelocityMax
+
+ Clamp the maximum linear velocity to prevent objects moving beyond a set speed.
+
+ :type: float
+
+ .. note::
+
+ Applies to dynamic and rigid body objects only.
+
+ .. note::
+
+ A value of 0.0 disables this option (rather then setting it stationary).
+
+ .. attribute:: localInertia
+
+ the object's inertia vector in local coordinates. Read only.
+
+ :type: list [ix, iy, iz]
+
+ .. attribute:: parent
+
+ The object's parent object. (read-only).
+
+ :type: :class:`KX_GameObject` or None
+
+ .. attribute:: visible
+
+ visibility flag.
+
+ :type: boolean
+
+ .. note::
+
+ Game logic will still run for invisible objects.
+
+ .. attribute:: color
+
+ The object color of the object.
+
+ :type: list [r, g, b, a]
+
+ .. attribute:: occlusion
+
+ occlusion capability flag.
+
+ :type: boolean
+
+ .. attribute:: position
+
+ The object's position.
+
+ .. deprecated:: use :data:`localPosition` and :data:`worldPosition`.
+
+ :type: list [x, y, z] On write: local position, on read: world position
+
+ .. attribute:: orientation
+
+ The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector.
+
+ .. deprecated:: use :data:`localOrientation` and :data:`worldOrientation`.
+
+ :type: 3x3 Matrix [[float]] On write: local orientation, on read: world orientation
+
+ .. attribute:: scaling
+
+ The object's scaling factor. list [sx, sy, sz]
+
+ .. deprecated:: use :data:`localScale` and :data:`worldScale`.
+
+ :type: list [sx, sy, sz] On write: local scaling, on read: world scaling
+
+ .. attribute:: localOrientation
+
+ The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector.
+
+ :type: 3x3 Matrix [[float]]
+
+ .. attribute:: worldOrientation
+
+ The object's world orientation.
+
+ :type: 3x3 Matrix [[float]]
+
+ .. attribute:: localScale
+
+ The object's local scaling factor.
+
+ :type: list [sx, sy, sz]
+
+ .. attribute:: worldScale
+
+ The object's world scaling factor. Read-only.
+
+ :type: list [sx, sy, sz]
+
+ .. attribute:: localPosition
+
+ The object's local position.
+
+ :type: list [x, y, z]
+
+ .. attribute:: worldPosition
+
+ The object's world position.
+
+ :type: list [x, y, z]
+
+ .. attribute:: timeOffset
+
+ adjust the slowparent delay at runtime.
+
+ :type: float
+
+ .. attribute:: state
+
+ the game object's state bitmask, using the first 30 bits, one bit must always be set.
+
+ :type: int
+
+ .. attribute:: meshes
+
+ a list meshes for this object.
+
+ :type: list of :class:`KX_MeshProxy`
+
+ .. note::
+
+ Most objects use only 1 mesh.
+
+ .. note::
+
+ Changes to this list will not update the KX_GameObject.
+
+ .. attribute:: sensors
+
+ a sequence of :class:`SCA_ISensor` objects with string/index lookups and iterator support.
+
+ :type: list
+
+ .. note::
+
+ This attribute is experemental and may be removed (but probably wont be).
+
+ .. note::
+
+ Changes to this list will not update the KX_GameObject.
+
+ .. attribute:: controllers
+
+ a sequence of :class:`SCA_IController` objects with string/index lookups and iterator support.
+
+ :type: list of :class:`SCA_ISensor`
+
+ .. note::
+
+ This attribute is experemental and may be removed (but probably wont be).
+
+ .. note::
+
+ Changes to this list will not update the KX_GameObject.
+
+ .. attribute:: actuators
+
+ a list of :class:`SCA_IActuator` with string/index lookups and iterator support.
+
+ :type: list
+
+ .. note::
+
+ This attribute is experemental and may be removed (but probably wont be).
+
+ .. note::
+
+ Changes to this list will not update the KX_GameObject.
+
+ .. attribute:: attrDict
+
+ get the objects internal python attribute dictionary for direct (faster) access.
+
+ :type: dict
+
+ .. attribute:: children
+
+ direct children of this object, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`'s
+
+ .. attribute:: childrenRecursive
+
+ all children of this object including childrens children, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`'s
+
+ .. method:: endObject()
+
+ Delete this object, can be used in place of the EndObject Actuator.
+
+ The actual removal of the object from the scene is delayed.
+
+ .. method:: replaceMesh(mesh, useDisplayMesh=True, usePhysicsMesh=False)
+
+ Replace the mesh of this object with a new mesh. This works the same was as the actuator.
+
+ :arg mesh: mesh to replace or the meshes name.
+ :type mesh: :class:`MeshProxy` or string
+ :arg useDisplayMesh: when enabled the display mesh will be replaced (optional argument).
+ :type useDisplayMesh: boolean
+ :arg usePhysicsMesh: when enabled the physics mesh will be replaced (optional argument).
+ :type usePhysicsMesh: boolean
+
+ .. method:: setVisible(visible, recursive)
+
+ Sets the game object's visible flag.
+
+ :arg visible: the visible state to set.
+ :type visible: boolean
+ :arg recursive: optional argument to set all childrens visibility flag too.
+ :type recursive: boolean
+
+ .. method:: setOcclusion(occlusion, recursive)
+
+ Sets the game object's occlusion capability.
+
+ :arg occlusion: the state to set the occlusion to.
+ :type occlusion: boolean
+ :arg recursive: optional argument to set all childrens occlusion flag too.
+ :type recursive: boolean
+
+ .. method:: alignAxisToVect(vect, axis=2, factor=1.0)
+
+ Aligns any of the game object's axis along the given vector.
+
+
+ :arg vect: a vector to align the axis.
+ :type vect: 3D vector
+ :arg axis: The axis you want to align
+
+ * 0: X axis
+ * 1: Y axis
+ * 2: Z axis
+
+ :type axis: integer
+ :arg factor: Only rotate a feaction of the distance to the target vector (0.0 - 1.0)
+ :type factor: float
+
+ .. method:: getAxisVect(vect)
+
+ Returns the axis vector rotates by the objects worldspace orientation.
+ This is the equivalent of multiplying the vector by the orientation matrix.
+
+ :arg vect: a vector to align the axis.
+ :type vect: 3D Vector
+ :return: The vector in relation to the objects rotation.
+ :rtype: 3d vector.
+
+ .. method:: applyMovement(movement, local=False)
+
+ Sets the game object's movement.
+
+ :arg movement: movement vector.
+ :type movement: 3D Vector
+ :arg local:
+ * False: you get the "global" movement ie: relative to world orientation.
+ * True: you get the "local" movement ie: relative to object orientation.
+ :arg local: boolean
+
+ .. method:: applyRotation(rotation, local=False)
+
+ Sets the game object's rotation.
+
+ :arg rotation: rotation vector.
+ :type rotation: 3D Vector
+ :arg local:
+ * False: you get the "global" rotation ie: relative to world orientation.
+ * True: you get the "local" rotation ie: relative to object orientation.
+ :arg local: boolean
+
+ .. method:: applyForce(force, local=False)
+
+ Sets the game object's force.
+
+ This requires a dynamic object.
+
+ :arg force: force vector.
+ :type force: 3D Vector
+ :arg local:
+ * False: you get the "global" force ie: relative to world orientation.
+ * True: you get the "local" force ie: relative to object orientation.
+ :type local: boolean
+
+ .. method:: applyTorque(torque, local=False)
+
+ Sets the game object's torque.
+
+ This requires a dynamic object.
+
+ :arg torque: torque vector.
+ :type torque: 3D Vector
+ :arg local:
+ * False: you get the "global" torque ie: relative to world orientation.
+ * True: you get the "local" torque ie: relative to object orientation.
+ :type local: boolean
+
+ .. method:: getLinearVelocity(local=False)
+
+ Gets the game object's linear velocity.
+
+ This method returns the game object's velocity through it's centre of mass, ie no angular velocity component.
+
+ :arg local:
+ * False: you get the "global" velocity ie: relative to world orientation.
+ * True: you get the "local" velocity ie: relative to object orientation.
+ :type local: boolean
+ :return: the object's linear velocity.
+ :rtype: list [vx, vy, vz]
+
+ .. method:: setLinearVelocity(velocity, local=False)
+
+ Sets the game object's linear velocity.
+
+ This method sets game object's velocity through it's centre of mass,
+ ie no angular velocity component.
+
+ This requires a dynamic object.
+
+ :arg velocity: linear velocity vector.
+ :type velocity: 3D Vector
+ :arg local:
+ * False: you get the "global" velocity ie: relative to world orientation.
+ * True: you get the "local" velocity ie: relative to object orientation.
+ :type local: boolean
+
+ .. method:: getAngularVelocity(local=False)
+
+ Gets the game object's angular velocity.
+
+ :arg local:
+ * False: you get the "global" velocity ie: relative to world orientation.
+ * True: you get the "local" velocity ie: relative to object orientation.
+ :type local: boolean
+ :return: the object's angular velocity.
+ :rtype: list [vx, vy, vz]
+
+ .. method:: setAngularVelocity(velocity, local=False)
+
+ Sets the game object's angular velocity.
+
+ This requires a dynamic object.
+
+ :arg velocity: angular velocity vector.
+ :type velocity: boolean
+ :arg local:
+ * False: you get the "global" velocity ie: relative to world orientation.
+ * True: you get the "local" velocity ie: relative to object orientation.
+
+ .. method:: getVelocity(point=(0, 0, 0))
+
+ Gets the game object's velocity at the specified point.
+
+ Gets the game object's velocity at the specified point, including angular
+ components.
+
+ :arg point: optional point to return the velocity for, in local coordinates.
+ :type point: 3D Vector
+ :return: the velocity at the specified point.
+ :rtype: list [vx, vy, vz]
+
+ .. method:: getReactionForce()
+
+ Gets the game object's reaction force.
+
+ The reaction force is the force applied to this object over the last simulation timestep.
+ This also includes impulses, eg from collisions.
+
+ :return: the reaction force of this object.
+ :rtype: list [fx, fy, fz]
+
+ .. note::
+
+ This is not implimented at the moment.
+
+ .. method:: applyImpulse(point, impulse)
+
+ Applies an impulse to the game object.
+
+ This will apply the specified impulse to the game object at the specified point.
+ If point != position, applyImpulse will also change the object's angular momentum.
+ Otherwise, only linear momentum will change.
+
+ :arg point: the point to apply the impulse to (in world coordinates)
+ :type point: the point to apply the impulse to (in world coordinates)
+
+ .. method:: suspendDynamics()
+
+ Suspends physics for this object.
+
+ .. method:: restoreDynamics()
+
+ Resumes physics for this object.
+
+ .. note::
+
+ The objects linear velocity will be applied from when the dynamics were suspended.
+
+ .. method:: enableRigidBody()
+
+ Enables rigid body physics for this object.
+
+ Rigid body physics allows the object to roll on collisions.
+
+ .. note::
+
+ This is not working with bullet physics yet.
+
+ .. method:: disableRigidBody()
+
+ Disables rigid body physics for this object.
+
+ .. note::
+
+ This is not working with bullet physics yet. The angular is removed but rigid body physics can still rotate it later.
+
+ .. method:: setParent(parent, compound=True, ghost=True)
+
+ Sets this object's parent.
+ Control the shape status with the optional compound and ghost parameters:
+
+ In that case you can control if it should be ghost or not:
+
+ :arg parent: new parent object.
+ :type parent: :class:`KX_GameObject`
+ :arg compound: whether the shape should be added to the parent compound shape.
+
+ * True: the object shape should be added to the parent compound shape.
+ * False: the object should keep its individual shape.
+
+ :type compound: boolean
+ :arg ghost: whether the object should be ghost while parented.
+
+ * True: if the object should be made ghost while parented.
+ * False: if the object should be solid while parented.
+
+ :type ghost: boolean
+
+ .. note::
+
+ If the object type is sensor, it stays ghost regardless of ghost parameter
+
+ .. method:: removeParent()
+
+ Removes this objects parent.
+
+ .. method:: getPhysicsId()
+
+ Returns the user data object associated with this game object's physics controller.
+
+ .. method:: getPropertyNames()
+
+ Gets a list of all property names.
+
+ :return: All property names for this object.
+ :rtype: list
+
+ .. method:: getDistanceTo(other)
+
+ :arg other: a point or another :class:`KX_GameObject` to measure the distance to.
+ :type other: :class:`KX_GameObject` or list [x, y, z]
+ :return: distance to another object or point.
+ :rtype: float
+
+ .. method:: getVectTo(other)
+
+ Returns the vector and the distance to another object or point.
+ The vector is normalized unless the distance is 0, in which a zero length vector is returned.
+
+ :arg other: a point or another :class:`KX_GameObject` to get the vector and distance to.
+ :type other: :class:`KX_GameObject` or list [x, y, z]
+ :return: (distance, globalVector(3), localVector(3))
+ :rtype: 3-tuple (float, 3-tuple (x, y, z), 3-tuple (x, y, z))
+
+ .. method:: rayCastTo(other, dist, prop)
+
+ Look towards another point/object and find first object hit within dist that matches prop.
+
+ The ray is always casted from the center of the object, ignoring the object itself.
+ The ray is casted towards the center of another object or an explicit [x, y, z] point.
+ Use rayCast() if you need to retrieve the hit point
+
+ :arg other: [x, y, z] or object towards which the ray is casted
+ :type other: :class:`KX_GameObject` or 3-tuple
+ :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other
+ :type dist: float
+ :arg prop: property name that object must have; can be omitted => detect any object
+ :type prop: string
+ :return: the first object hit or None if no object or object does not match prop
+ :rtype: :class:`KX_GameObject`
+
+ .. method:: rayCast(objto, objfrom, dist, prop, face, xray, poly)
+
+ Look from a point/object to another point/object and find first object hit within dist that matches prop.
+ if poly is 0, returns a 3-tuple with object reference, hit point and hit normal or (None, None, None) if no hit.
+ if poly is 1, returns a 4-tuple with in addition a :class:`KX_PolyProxy` as 4th element.
+ if poly is 2, returns a 5-tuple with in addition a 2D vector with the UV mapping of the hit point as 5th element.
+
+ .. code-block:: python
+
+ # shoot along the axis gun-gunAim (gunAim should be collision-free)
+ obj, point, normal = gun.rayCast(gunAim, None, 50)
+ if obj:
+ # do something
+ pass
+
+ The face paremeter determines the orientation of the normal.
+
+ * 0 => hit normal is always oriented towards the ray origin (as if you casted the ray from outside)
+ * 1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect)
+
+ The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray.
+ The prop and xray parameters interact as follow.
+
+ * prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray.
+ * prop off, xray on : idem.
+ * prop on, xray off: return closest hit if it matches prop, no hit otherwise.
+ * prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray.
+
+ The :class:`KX_PolyProxy` 4th element of the return tuple when poly=1 allows to retrieve information on the polygon hit by the ray.
+ If there is no hit or the hit object is not a static mesh, None is returned as 4th element.
+
+ The ray ignores collision-free objects and faces that dont have the collision flag enabled, you can however use ghost objects.
+
+ :arg objto: [x, y, z] or object to which the ray is casted
+ :type objto: :class:`KX_GameObject` or 3-tuple
+ :arg objfrom: [x, y, z] or object from which the ray is casted; None or omitted => use self object center
+ :type objfrom: :class:`KX_GameObject` or 3-tuple or None
+ :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to to
+ :type dist: float
+ :arg prop: property name that object must have; can be omitted or "" => detect any object
+ :type prop: string
+ :arg face: normal option: 1=>return face normal; 0 or omitted => normal is oriented towards origin
+ :type face: integer
+ :arg xray: X-ray option: 1=>skip objects that don't match prop; 0 or omitted => stop on first object
+ :type xray: integer
+ :arg poly: polygon option: 0, 1 or 2 to return a 3-, 4- or 5-tuple with information on the face hit.
+
+ * 0 or omitted: return value is a 3-tuple (object, hitpoint, hitnormal) or (None, None, None) if no hit
+ * 1: return value is a 4-tuple and the 4th element is a :class:`KX_PolyProxy` or None if no hit or the object doesn't use a mesh collision shape.
+ * 2: return value is a 5-tuple and the 5th element is a 2-tuple (u, v) with the UV mapping of the hit point or None if no hit, or the object doesn't use a mesh collision shape, or doesn't have a UV mapping.
+
+ :type poly: integer
+ :return: (object, hitpoint, hitnormal) or (object, hitpoint, hitnormal, polygon) or (object, hitpoint, hitnormal, polygon, hituv).
+
+ * object, hitpoint and hitnormal are None if no hit.
+ * polygon is valid only if the object is valid and is a static object, a dynamic object using mesh collision shape or a soft body object, otherwise it is None
+ * hituv is valid only if polygon is valid and the object has a UV mapping, otherwise it is None
+
+ :rtype:
+
+ * 3-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz))
+ * or 4-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`)
+ * or 5-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`, 2-tuple (u, v))
+
+ .. note::
+
+ The ray ignores the object on which the method is called. It is casted from/to object center or explicit [x, y, z] points.
+
+ .. method:: setCollisionMargin(margin)
+
+ Set the objects collision margin.
+
+ :arg margin: the collision margin distance in blender units.
+ :type margin: float
+
+ .. note::
+
+ If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError.
+
+ .. method:: sendMessage(subject, body="", to="")
+
+ Sends a message.
+
+ :arg subject: The subject of the message
+ :type subject: string
+ :arg body: The body of the message (optional)
+ :type body: string
+ :arg to: The name of the object to send the message to (optional)
+ :type to: string
+
+ .. method:: reinstancePhysicsMesh(gameObject, meshObject)
+
+ Updates the physics system with the changed mesh.
+
+ If no arguments are given the physics mesh will be re-created from the first mesh assigned to the game object.
+
+ :arg gameObject: optional argument, set the physics shape from this gameObjets mesh.
+ :type gameObject: string, :class:`KX_GameObject` or None
+ :arg meshObject: optional argument, set the physics shape from this mesh.
+ :type meshObject: string, :class:`MeshProxy` or None
+
+ :return: True if reinstance succeeded, False if it failed.
+ :rtype: boolean
+
+ .. note::
+
+ If this object has instances the other instances will be updated too.
+
+ .. note::
+
+ The gameObject argument has an advantage that it can convert from a mesh with modifiers applied (such as subsurf).
+
+ .. warning::
+
+ Only triangle mesh type objects are supported currently (not convex hull)
+
+ .. warning::
+
+ If the object is a part of a combound object it will fail (parent or child)
+
+ .. warning::
+
+ Rebuilding the physics mesh can be slow, running many times per second will give a performance hit.
+
+ .. method:: get(key, default=None)
+
+ Return the value matching key, or the default value if its not found.
+ :return: The key value or a default.
+
+.. class:: KX_IpoActuator(SCA_IActuator)
+
+ IPO actuator activates an animation.
+
+ .. attribute:: frameStart
+
+ Start frame.
+
+ :type: float
+
+ .. attribute:: frameEnd
+
+ End frame.
+
+ :type: float
+
+ .. attribute:: propName
+
+ Use this property to define the Ipo position.
+
+ :type: string
+
+ .. attribute:: framePropName
+
+ Assign this property this action current frame number.
+
+ :type: string
+
+ .. attribute:: mode
+
+ Play mode for the ipo. Can be on of :ref:`these constants <ipo-actuator>`
+
+ :type: integer
+
+ .. attribute:: useIpoAsForce
+
+ Apply Ipo as a global or local force depending on the local option (dynamic objects only).
+
+ :type: boolean
+
+ .. attribute:: useIpoAdd
+
+ Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag.
+
+ :type: boolean
+
+ .. attribute:: useIpoLocal
+
+ Let the ipo acts in local coordinates, used in Force and Add mode.
+
+ :type: boolean
+
+ .. attribute:: useChildren
+
+ Update IPO on all children Objects as well.
+
+ :type: boolean
+
+.. class:: KX_LightObject(KX_GameObject)
+
+ A Light object.
+
+ .. code-block:: python
+
+ # Turn on a red alert light.
+ import bge
+
+ co = bge.logic.getCurrentController()
+ light = co.owner
+
+ light.energy = 1.0
+ light.colour = [1.0, 0.0, 0.0]
+
+ .. data:: SPOT
+
+ A spot light source. See attribute :data:`type`
+
+ .. data:: SUN
+
+ A point light source with no attenuation. See attribute :data:`type`
+
+ .. data:: NORMAL
+
+ A point light source. See attribute :data:`type`
+
+ .. attribute:: type
+
+ The type of light - must be SPOT, SUN or NORMAL
+
+ .. attribute:: layer
+
+ The layer mask that this light affects object on.
+
+ :type: bitfield
+
+ .. attribute:: energy
+
+ The brightness of this light.
+
+ :type: float
+
+ .. attribute:: distance
+
+ The maximum distance this light can illuminate. (SPOT and NORMAL lights only).
+
+ :type: float
+
+ .. attribute:: colour
+
+ The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
+
+ :type: list [r, g, b]
+
+ .. attribute:: color
+
+ Synonym for colour.
+
+ .. attribute:: lin_attenuation
+
+ The linear component of this light's attenuation. (SPOT and NORMAL lights only).
+
+ :type: float
+
+ .. attribute:: quad_attenuation
+
+ The quadratic component of this light's attenuation (SPOT and NORMAL lights only).
+
+ :type: float
+
+ .. attribute:: spotsize
+
+ The cone angle of the spot light, in degrees (SPOT lights only).
+
+ :type: float in [0 - 180].
+
+ .. attribute:: spotblend
+
+ Specifies the intensity distribution of the spot light (SPOT lights only).
+
+ :type: float in [0 - 1]
+
+ .. note::
+
+ Higher values result in a more focused light source.
+
+.. class:: KX_MeshProxy(SCA_IObject)
+
+ A mesh object.
+
+ You can only change the vertex properties of a mesh object, not the mesh topology.
+
+ To use mesh objects effectively, you should know a bit about how the game engine handles them.
+
+ #. Mesh Objects are converted from Blender at scene load.
+ #. The Converter groups polygons by Material. This means they can be sent to the renderer efficiently. A material holds:
+
+ #. The texture.
+ #. The Blender material.
+ #. The Tile properties
+ #. The face properties - (From the "Texture Face" panel)
+ #. Transparency & z sorting
+ #. Light layer
+ #. Polygon shape (triangle/quad)
+ #. Game Object
+
+ #. Verticies will be split by face if necessary. Verticies can only be shared between faces if:
+
+ #. They are at the same position
+ #. UV coordinates are the same
+ #. Their normals are the same (both polygons are "Set Smooth")
+ #. They are the same colour, for example: a cube has 24 verticies: 6 faces with 4 verticies per face.
+
+ The correct method of iterating over every :class:`KX_VertexProxy` in a game object
+
+ .. code-block:: python
+
+ import GameLogic
+
+ co = GameLogic.getCurrentController()
+ obj = co.owner
+
+ m_i = 0
+ mesh = obj.getMesh(m_i) # There can be more than one mesh...
+ while mesh != None:
+ for mat in range(mesh.getNumMaterials()):
+ for v_index in range(mesh.getVertexArrayLength(mat)):
+ vertex = mesh.getVertex(mat, v_index)
+ # Do something with vertex here...
+ # ... eg: colour the vertex red.
+ vertex.colour = [1.0, 0.0, 0.0, 1.0]
+ m_i += 1
+ mesh = obj.getMesh(m_i)
+
+ .. attribute:: materials
+
+ :type: list of :class:`KX_BlenderMaterial` or :class:`KX_PolygonMaterial` types
+
+ .. attribute:: numPolygons
+
+ :type: integer
+
+ .. attribute:: numMaterials
+
+ :type: integer
+
+ .. method:: getNumMaterials()
+
+ :return: number of materials associated with this object
+ :rtype: integer
+
+ .. method:: getMaterialName(matid)
+
+ Gets the name of the specified material.
+
+ :arg matid: the specified material.
+ :type matid: integer
+ :return: the attached material name.
+ :rtype: string
+
+ .. method:: getTextureName(matid)
+
+ Gets the name of the specified material's texture.
+
+ :arg matid: the specified material
+ :type matid: integer
+ :return: the attached material's texture name.
+ :rtype: string
+
+ .. method:: getVertexArrayLength(matid)
+
+ Gets the length of the vertex array associated with the specified material.
+
+ There is one vertex array for each material.
+
+ :arg matid: the specified material
+ :type matid: integer
+ :return: the number of verticies in the vertex array.
+ :rtype: integer
+
+ .. method:: getVertex(matid, index)
+
+ Gets the specified vertex from the mesh object.
+
+ :arg matid: the specified material
+ :type matid: integer
+ :arg index: the index into the vertex array.
+ :type index: integer
+ :return: a vertex object.
+ :rtype: :class:`KX_VertexProxy`
+
+ .. method:: getNumPolygons()
+
+ :return: The number of polygon in the mesh.
+ :rtype: integer
+
+ .. method:: getPolygon(index)
+
+ Gets the specified polygon from the mesh.
+
+ :arg index: polygon number
+ :type index: integer
+ :return: a polygon object.
+ :rtype: :class:`PolyProxy`
+
+.. class:: SCA_MouseSensor(SCA_ISensor)
+
+ Mouse Sensor logic brick.
+
+ .. attribute:: position
+
+ current [x, y] coordinates of the mouse, in frame coordinates (pixels).
+
+ :type: [integer, interger]
+
+ .. attribute:: mode
+
+ sensor mode.
+
+ :type: integer
+
+ * KX_MOUSESENSORMODE_LEFTBUTTON(1)
+ * KX_MOUSESENSORMODE_MIDDLEBUTTON(2)
+ * KX_MOUSESENSORMODE_RIGHTBUTTON(3)
+ * KX_MOUSESENSORMODE_WHEELUP(4)
+ * KX_MOUSESENSORMODE_WHEELDOWN(5)
+ * KX_MOUSESENSORMODE_MOVEMENT(6)
+
+ .. method:: getButtonStatus(button)
+
+ Get the mouse button status.
+
+ :arg button: The code that represents the key you want to get the state of, use one of :ref:`these constants<mouse-keys>`
+ :type button: int
+ :return: The state of the given key, can be one of :ref:`these constants<input-status>`
+ :rtype: int
+
+.. class:: KX_MouseFocusSensor(SCA_MouseSensor)
+
+ The mouse focus sensor detects when the mouse is over the current game object.
+
+ The mouse focus sensor works by transforming the mouse coordinates from 2d device
+ space to 3d space then raycasting away from the camera.
+
+ .. attribute:: raySource
+
+ The worldspace source of the ray (the view position).
+
+ :type: list (vector of 3 floats)
+
+ .. attribute:: rayTarget
+
+ The worldspace target of the ray.
+
+ :type: list (vector of 3 floats)
+
+ .. attribute:: rayDirection
+
+ The :data:`rayTarget` - :class:`raySource` normalized.
+
+ :type: list (normalized vector of 3 floats)
+
+ .. attribute:: hitObject
+
+ the last object the mouse was over.
+
+ :type: :class:`KX_GameObject` or None
+
+ .. attribute:: hitPosition
+
+ The worldspace position of the ray intersecton.
+
+ :type: list (vector of 3 floats)
+
+ .. attribute:: hitNormal
+
+ the worldspace normal from the face at point of intersection.
+
+ :type: list (normalized vector of 3 floats)
+
+ .. attribute:: hitUV
+
+ the UV coordinates at the point of intersection.
+
+ :type: list (vector of 2 floats)
+
+ If the object has no UV mapping, it returns [0, 0].
+
+ The UV coordinates are not normalized, they can be < 0 or > 1 depending on the UV mapping.
+
+ .. attribute:: usePulseFocus
+
+ When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set).
+
+ :type: boolean
+
+.. class:: KX_TouchSensor(SCA_ISensor)
+
+ Touch sensor detects collisions between objects.
+
+ .. attribute:: propName
+
+ The property or material to collide with.
+
+ :type: string
+
+ .. attribute:: useMaterial
+
+ Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property.
+
+ :type: boolean
+
+ .. attribute:: usePulseCollision
+
+ When enabled, changes to the set of colliding objects generate a pulse.
+
+ :type: boolean
+
+ .. attribute:: hitObject
+
+ The last collided object. (read-only).
+
+ :type: :class:`KX_GameObject` or None
+
+ .. attribute:: hitObjectList
+
+ A list of colliding objects. (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`
+
+.. class:: KX_NearSensor(KX_TouchSensor)
+
+ A near sensor is a specialised form of touch sensor.
+
+ .. attribute:: distance
+
+ The near sensor activates when an object is within this distance.
+
+ :type: float
+
+ .. attribute:: resetDistance
+
+ The near sensor deactivates when the object exceeds this distance.
+
+ :type: float
+
+.. class:: KX_NetworkMessageActuator(SCA_IActuator)
+
+ Message Actuator
+
+ .. attribute:: propName
+
+ Messages will only be sent to objects with the given property name.
+
+ :type: string
+
+ .. attribute:: subject
+
+ The subject field of the message.
+
+ :type: string
+
+ .. attribute:: body
+
+ The body of the message.
+
+ :type: string
+
+ .. attribute:: usePropBody
+
+ Send a property instead of a regular body message.
+
+ :type: boolean
+
+.. class:: KX_NetworkMessageSensor(SCA_ISensor)
+
+ The Message Sensor logic brick.
+
+ Currently only loopback (local) networks are supported.
+
+ .. attribute:: subject
+
+ The subject the sensor is looking for.
+
+ :type: string
+
+ .. attribute:: frameMessageCount
+
+ The number of messages received since the last frame. (read-only).
+
+ :type: integer
+
+ .. attribute:: subjects
+
+ The list of message subjects received. (read-only).
+
+ :type: list of strings
+
+ .. attribute:: bodies
+
+ The list of message bodies received. (read-only).
+
+ :type: list of strings
+
+.. class:: KX_ObjectActuator(SCA_IActuator)
+
+ The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement,
+ velocity, or angular velocity to an object.
+ Servo control allows to regulate force to achieve a certain speed target.
+
+ .. attribute:: force
+
+ The force applied by the actuator.
+
+ :type: list [x, y, z]
+
+ .. attribute:: useLocalForce
+
+ A flag specifying if the force is local.
+
+ :type: boolean
+
+ .. attribute:: torque
+
+ The torque applied by the actuator.
+
+ :type: list [x, y, z]
+
+ .. attribute:: useLocalTorque
+
+ A flag specifying if the torque is local.
+
+ :type: boolean
+
+ .. attribute:: dLoc
+
+ The displacement vector applied by the actuator.
+
+ :type: list [x, y, z]
+
+ .. attribute:: useLocalDLoc
+
+ A flag specifying if the dLoc is local.
+
+ :type: boolean
+
+ .. attribute:: dRot
+
+ The angular displacement vector applied by the actuator
+
+ :type: list [x, y, z]
+
+ .. note::
+
+ Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer speed.
+
+ .. attribute:: useLocalDRot
+
+ A flag specifying if the dRot is local.
+
+ :type: boolean
+
+ .. attribute:: linV
+
+ The linear velocity applied by the actuator.
+
+ :type: list [x, y, z]
+
+ .. attribute:: useLocalLinV
+
+ A flag specifying if the linear velocity is local.
+
+ :type: boolean
+
+ .. note::
+
+ This is the target speed for servo controllers.
+
+ .. attribute:: angV
+
+ The angular velocity applied by the actuator.
+
+ :type: list [x, y, z]
+
+ .. attribute:: useLocalAngV
+
+ A flag specifying if the angular velocity is local.
+
+ :type: boolean
+
+ .. attribute:: damping
+
+ The damping parameter of the servo controller.
+
+ :type: short
+
+ .. attribute:: forceLimitX
+
+ The min/max force limit along the X axis and activates or deactivates the limits in the servo controller.
+
+ :type: list [min(float), max(float), bool]
+
+ .. attribute:: forceLimitY
+
+ The min/max force limit along the Y axis and activates or deactivates the limits in the servo controller.
+
+ :type: list [min(float), max(float), bool]
+
+ .. attribute:: forceLimitZ
+
+ The min/max force limit along the Z axis and activates or deactivates the limits in the servo controller.
+
+ :type: list [min(float), max(float), bool]
+
+ .. attribute:: pid
+
+ The PID coefficients of the servo controller.
+
+ :type: list of floats [proportional, integral, derivate]
+
+ .. attribute:: reference
+
+ The object that is used as reference to compute the velocity for the servo controller.
+
+ :type: :class:`KX_GameObject` or None
+
+.. class:: KX_ParentActuator(SCA_IActuator)
+
+ The parent actuator can set or remove an objects parent object.
+
+ .. attribute:: object
+
+ the object this actuator sets the parent too.
+
+ :type: :class:`KX_GameObject` or None
+
+ .. attribute:: mode
+
+ The mode of this actuator.
+
+ :type: integer from 0 to 1.
+
+ .. attribute:: compound
+
+ Whether the object shape should be added to the parent compound shape when parenting.
+
+ Effective only if the parent is already a compound shape.
+
+ :type: boolean
+
+ .. attribute:: ghost
+
+ Whether the object should be made ghost when parenting
+ Effective only if the shape is not added to the parent compound shape.
+
+ :type: boolean
+
+.. class:: KX_PhysicsObjectWrapper(PyObjectPlus)
+
+ KX_PhysicsObjectWrapper
+
+ .. method:: setActive(active)
+
+ Set the object to be active.
+
+ :arg active: set to True to be active
+ :type active: boolean
+
+ .. method:: setAngularVelocity(x, y, z, local)
+
+ Set the angular velocity of the object.
+
+ :arg x: angular velocity for the x-axis
+ :type x: float
+
+ :arg y: angular velocity for the y-axis
+ :type y: float
+
+ :arg z: angular velocity for the z-axis
+ :type z: float
+
+ :arg local: set to True for local axis
+ :type local: boolean
+
+ .. method:: setLinearVelocity(x, y, z, local)
+
+ Set the linear velocity of the object.
+
+ :arg x: linear velocity for the x-axis
+ :type x: float
+
+ :arg y: linear velocity for the y-axis
+ :type y: float
+
+ :arg z: linear velocity for the z-axis
+ :type z: float
+
+ :arg local: set to True for local axis
+ :type local: boolean
+
+.. class:: KX_PolyProxy(SCA_IObject)
+
+ A polygon holds the index of the vertex forming the poylgon.
+
+ Note:
+ The polygon attributes are read-only, you need to retrieve the vertex proxy if you want
+ to change the vertex settings.
+
+ .. attribute:: matname
+
+ The name of polygon material, empty if no material.
+
+ :type: string
+
+ .. attribute:: material
+
+ The material of the polygon.
+
+ :type: :class:`KX_PolygonMaterial` or :class:`KX_BlenderMaterial`
+
+ .. attribute:: texture
+
+ The texture name of the polygon.
+
+ :type: string
+
+ .. attribute:: matid
+
+ The material index of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+ :type: integer
+
+ .. attribute:: v1
+
+ vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+ :type: integer
+
+ .. attribute:: v2
+
+ vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+ :type: integer
+
+ .. attribute:: v3
+
+ vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
+
+ :type: integer
+
+ .. attribute:: v4
+
+ Vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
+ Use this to retrieve vertex proxy from mesh proxy.
+
+ :type: integer
+
+ .. attribute:: visible
+
+ visible state of the polygon: 1=visible, 0=invisible.
+
+ :type: integer
+
+ .. attribute:: collide
+
+ collide state of the polygon: 1=receives collision, 0=collision free.
+
+ :type: integer
+
+ .. method:: getMaterialName()
+
+ Returns the polygon material name with MA prefix
+
+ :return: material name
+ :rtype: string
+
+ .. method:: getMaterial()
+
+ :return: The polygon material
+ :rtype: :class:`KX_PolygonMaterial` or :class:`KX_BlenderMaterial`
+
+ .. method:: getTextureName()
+
+ :return: The texture name
+ :rtype: string
+
+ .. method:: getMaterialIndex()
+
+ Returns the material bucket index of the polygon.
+ This index and the ones returned by getVertexIndex() are needed to retrieve the vertex proxy from :class:`MeshProxy`.
+
+ :return: the material index in the mesh
+ :rtype: integer
+
+ .. method:: getNumVertex()
+
+ Returns the number of vertex of the polygon.
+
+ :return: number of vertex, 3 or 4.
+ :rtype: integer
+
+ .. method:: isVisible()
+
+ Returns whether the polygon is visible or not
+
+ :return: 0=invisible, 1=visible
+ :rtype: boolean
+
+ .. method:: isCollider()
+
+ Returns whether the polygon is receives collision or not
+
+ :return: 0=collision free, 1=receives collision
+ :rtype: integer
+
+ .. method:: getVertexIndex(vertex)
+
+ Returns the mesh vertex index of a polygon vertex
+ This index and the one returned by getMaterialIndex() are needed to retrieve the vertex proxy from :class:`MeshProxy`.
+
+ :arg vertex: index of the vertex in the polygon: 0->3
+ :arg vertex: integer
+ :return: mesh vertex index
+ :rtype: integer
+
+ .. method:: getMesh()
+
+ Returns a mesh proxy
+
+ :return: mesh proxy
+ :rtype: :class:`MeshProxy`
+
+.. class:: KX_PolygonMaterial(PyObjectPlus)
+
+ This is the interface to materials in the game engine.
+
+ Materials define the render state to be applied to mesh objects.
+
+ .. warning::
+
+ Some of the methods/variables are CObjects. If you mix these up, you will crash blender.
+
+ This example requires `PyOpenGL <http://pyopengl.sourceforge.net>`_ and `GLEWPy <http://glewpy.sourceforge.net>`_
+
+ .. code-block:: python
+
+ import GameLogic
+ import OpenGL
+ from OpenGL.GL import *
+ from OpenGL.GLU import *
+ import glew
+ from glew import *
+
+ glewInit()
+
+ vertex_shader = """
+
+ void main(void)
+ {
+ gl_Position = ftransform();
+ }
+ """
+
+ fragment_shader ="""
+
+ void main(void)
+ {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+ """
+
+ class MyMaterial:
+ def __init__(self):
+ self.pass_no = 0
+ # Create a shader
+ self.m_program = glCreateProgramObjectARB()
+ # Compile the vertex shader
+ self.shader(GL_VERTEX_SHADER_ARB, (vertex_shader))
+ # Compile the fragment shader
+ self.shader(GL_FRAGMENT_SHADER_ARB, (fragment_shader))
+ # Link the shaders together
+ self.link()
+
+ def PrintInfoLog(self, tag, object):
+ """
+ PrintInfoLog prints the GLSL compiler log
+ """
+ print "Tag: def PrintGLError(self, tag = ""):
+
+ def PrintGLError(self, tag = ""):
+ """
+ Prints the current GL error status
+ """
+ if len(tag):
+ print tag
+ err = glGetError()
+ if err != GL_NO_ERROR:
+ print "GL Error: %s\\n"%(gluErrorString(err))
+
+ def shader(self, type, shaders):
+ """
+ shader compiles a GLSL shader and attaches it to the current
+ program.
+
+ type should be either GL_VERTEX_SHADER_ARB or GL_FRAGMENT_SHADER_ARB
+ shaders should be a sequence of shader source to compile.
+ """
+ # Create a shader object
+ shader_object = glCreateShaderObjectARB(type)
+
+ # Add the source code
+ glShaderSourceARB(shader_object, len(shaders), shaders)
+
+ # Compile the shader
+ glCompileShaderARB(shader_object)
+
+ # Print the compiler log
+ self.PrintInfoLog("vertex shader", shader_object)
+
+ # Check if compiled, and attach if it did
+ compiled = glGetObjectParameterivARB(shader_object, GL_OBJECT_COMPILE_STATUS_ARB)
+ if compiled:
+ glAttachObjectARB(self.m_program, shader_object)
+
+ # Delete the object (glAttachObjectARB makes a copy)
+ glDeleteObjectARB(shader_object)
+
+ # print the gl error log
+ self.PrintGLError()
+
+ def link(self):
+ """
+ Links the shaders together.
+ """
+ # clear error indicator
+ glGetError()
+
+ glLinkProgramARB(self.m_program)
+
+ self.PrintInfoLog("link", self.m_program)
+
+ linked = glGetObjectParameterivARB(self.m_program, GL_OBJECT_LINK_STATUS_ARB)
+ if not linked:
+ print "Shader failed to link"
+ return
+
+ glValidateProgramARB(self.m_program)
+ valid = glGetObjectParameterivARB(self.m_program, GL_OBJECT_VALIDATE_STATUS_ARB)
+ if not valid:
+ print "Shader failed to validate"
+ return
+
+ def activate(self, rasty, cachingInfo, mat):
+ self.pass_no+=1
+ if (self.pass_no == 1):
+ glDisable(GL_COLOR_MATERIAL)
+ glUseProgramObjectARB(self.m_program)
+ return True
+
+ glEnable(GL_COLOR_MATERIAL)
+ glUseProgramObjectARB(0)
+ self.pass_no = 0
+ return False
+
+ obj = GameLogic.getCurrentController().owner
+
+ mesh = obj.meshes[0]
+
+ for mat in mesh.materials:
+ mat.setCustomMaterial(MyMaterial())
+ print mat.texture
+
+ .. attribute:: texture
+
+ Texture name.
+
+ :type: string (read-only)
+
+ .. attribute:: gl_texture
+
+ OpenGL texture handle (eg for glBindTexture(GL_TEXTURE_2D, gl_texture).
+
+ :type: integer (read-only)
+
+ .. attribute:: material
+
+ Material name.
+
+ :type: string (read-only)
+
+ .. attribute:: tface
+
+ Texture face properties.
+
+ :type: CObject (read-only)
+
+ .. attribute:: tile
+
+ Texture is tiling.
+
+ :type: boolean
+
+ .. attribute:: tilexrep
+
+ Number of tile repetitions in x direction.
+
+ :type: integer
+
+ .. attribute:: tileyrep
+
+ Number of tile repetitions in y direction.
+
+ :type: integer
+
+ .. attribute:: drawingmode
+
+ Drawing mode for the material.
+ - 2 (drawingmode & 4) Textured
+ - 4 (drawingmode & 16) Light
+ - 14 (drawingmode & 16384) 3d Polygon Text.
+
+ :type: bitfield
+
+ .. attribute:: transparent
+
+ This material is transparent. All meshes with this
+ material will be rendered after non transparent meshes from back
+ to front.
+
+ :type: boolean
+
+ .. attribute:: zsort
+
+ Transparent polygons in meshes with this material will be sorted back to
+ front before rendering.
+ Non-Transparent polygons will be sorted front to back before rendering.
+
+ :type: boolean
+
+ .. attribute:: lightlayer
+
+ Light layers this material affects.
+
+ :type: bitfield.
+
+ .. attribute:: triangle
+
+ Mesh data with this material is triangles. It's probably not safe to change this.
+
+ :type: boolean
+
+ .. attribute:: diffuse
+
+ The diffuse colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
+
+ :type: list [r, g, b]
+
+ .. attribute:: specular
+
+ The specular colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
+
+ :type: list [r, g, b]
+
+ .. attribute:: shininess
+
+ The shininess (specular exponent) of the material. 0.0 <= shininess <= 128.0.
+
+ :type: float
+
+ .. attribute:: specularity
+
+ The amount of specular of the material. 0.0 <= specularity <= 1.0.
+
+ :type: float
+
+ .. method:: updateTexture(tface, rasty)
+
+ Updates a realtime animation.
+
+ :arg tface: Texture face (eg mat.tface)
+ :type tface: CObject
+ :arg rasty: Rasterizer
+ :type rasty: CObject
+
+ .. method:: setTexture(tface)
+
+ Sets texture render state.
+
+ :arg tface: Texture face
+ :type tface: CObject
+
+ .. code-block:: python
+
+ mat.setTexture(mat.tface)
+
+ .. method:: activate(rasty, cachingInfo)
+
+ Sets material parameters for this object for rendering.
+
+ Material Parameters set:
+
+ #. Texture
+ #. Backface culling
+ #. Line drawing
+ #. Specular Colour
+ #. Shininess
+ #. Diffuse Colour
+ #. Polygon Offset.
+
+ :arg rasty: Rasterizer instance.
+ :type rasty: CObject
+ :arg cachingInfo: Material cache instance.
+ :type cachingInfo: CObject
+
+ .. method:: setCustomMaterial(material)
+
+ Sets the material state setup object.
+
+ Using this method, you can extend or completely replace the gameengine material
+ to do your own advanced multipass effects.
+
+ Use this method to register your material class. Instead of the normal material,
+ your class's activate method will be called just before rendering the mesh.
+ This should setup the texture, material, and any other state you would like.
+ It should return True to render the mesh, or False if you are finished. You should
+ clean up any state Blender does not set before returning False.
+
+ Activate Method Definition:
+
+ .. code-block:: python
+
+ def activate(self, rasty, cachingInfo, material):
+
+ :arg material: The material object.
+ :type material: instance
+
+ .. code-block:: python
+
+ class PyMaterial:
+ def __init__(self):
+ self.pass_no = -1
+
+ def activate(self, rasty, cachingInfo, material):
+ # Activate the material here.
+ #
+ # The activate method will be called until it returns False.
+ # Every time the activate method returns True the mesh will
+ # be rendered.
+ #
+ # rasty is a CObject for passing to material.updateTexture()
+ # and material.activate()
+ # cachingInfo is a CObject for passing to material.activate()
+ # material is the KX_PolygonMaterial instance this material
+ # was added to
+
+ # default material properties:
+ self.pass_no += 1
+ if self.pass_no == 0:
+ material.activate(rasty, cachingInfo)
+ # Return True to do this pass
+ return True
+
+ # clean up and return False to finish.
+ self.pass_no = -1
+ return False
+
+ # Create a new Python Material and pass it to the renderer.
+ mat.setCustomMaterial(PyMaterial())
+
+.. class:: KX_RadarSensor(KX_NearSensor)
+
+ Radar sensor is a near sensor with a conical sensor object.
+
+ .. attribute:: coneOrigin
+
+ The origin of the cone with which to test. The origin is in the middle of the cone. (read-only).
+
+ :type: list of floats [x, y, z]
+
+ .. attribute:: coneTarget
+
+ The center of the bottom face of the cone with which to test. (read-only).
+
+ :type: list of floats [x, y, z]
+
+ .. attribute:: distance
+
+ The height of the cone with which to test.
+
+ :type: float
+
+ .. attribute:: angle
+
+ The angle of the cone (in degrees) with which to test.
+
+ :type: float from 0 to 360
+
+ .. attribute:: axis
+
+ The axis on which the radar cone is cast.
+
+ :type: integer from 0 to 5
+
+ KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z,
+ KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z
+
+ .. method:: getConeHeight()
+
+ :return: The height of the cone with which to test.
+ :rtype: float
+
+.. class:: KX_RaySensor(SCA_ISensor)
+
+ A ray sensor detects the first object in a given direction.
+
+ .. attribute:: propName
+
+ The property the ray is looking for.
+
+ :type: string
+
+ .. attribute:: range
+
+ The distance of the ray.
+
+ :type: float
+
+ .. attribute:: useMaterial
+
+ Whether or not to look for a material (false = property).
+
+ :type: boolean
+
+ .. attribute:: useXRay
+
+ Whether or not to use XRay.
+
+ :type: boolean
+
+ .. attribute:: hitObject
+
+ The game object that was hit by the ray. (read-only).
+
+ :type: :class:`KX_GameObject`
+
+ .. attribute:: hitPosition
+
+ The position (in worldcoordinates) where the object was hit by the ray. (read-only).
+
+ :type: list [x, y, z]
+
+ .. attribute:: hitNormal
+
+ The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (read-only).
+
+ :type: list [x, y, z]
+
+ .. attribute:: rayDirection
+
+ The direction from the ray (in worldcoordinates). (read-only).
+
+ :type: list [x, y, z]
+
+ .. attribute:: axis
+
+ The axis the ray is pointing on.
+
+ :type: integer from 0 to 5
+
+ * KX_RAY_AXIS_POS_X
+ * KX_RAY_AXIS_POS_Y
+ * KX_RAY_AXIS_POS_Z
+ * KX_RAY_AXIS_NEG_X
+ * KX_RAY_AXIS_NEG_Y
+ * KX_RAY_AXIS_NEG_Z
+
+.. class:: KX_SCA_AddObjectActuator(SCA_IActuator)
+
+ Edit Object Actuator (in Add Object Mode)
+
+ .. warning::
+
+ An Add Object actuator will be ignored if at game start, the linked object doesn't exist (or is empty) or the linked object is in an active layer.
+
+ .. code-block:: none
+
+ Error: GameObject 'Name' has a AddObjectActuator 'ActuatorName' without object (in 'nonactive' layer)
+
+ .. attribute:: object
+
+ the object this actuator adds.
+
+ :type: :class:`KX_GameObject` or None
+
+ .. attribute:: objectLastCreated
+
+ the last added object from this actuator (read-only).
+
+ :type: :class:`KX_GameObject` or None
+
+ .. attribute:: time
+
+ the lifetime of added objects, in frames. Set to 0 to disable automatic deletion.
+
+ :type: integer
+
+ .. attribute:: linearVelocity
+
+ the initial linear velocity of added objects.
+
+ :type: list [vx, vy, vz]
+
+ .. attribute:: angularVelocity
+
+ the initial angular velocity of added objects.
+
+ :type: list [vx, vy, vz]
+
+ .. method:: instantAddObject()
+
+ :return: The last object created by this actuator. The object can then be accessed from :data:`objectLastCreated`.
+ :rtype: None
+
+.. class:: KX_SCA_DynamicActuator(SCA_IActuator)
+
+ Dynamic Actuator.
+
+ .. attribute:: mode
+
+ :type: integer
+
+ the type of operation of the actuator, 0-4
+
+ * KX_DYN_RESTORE_DYNAMICS(0)
+ * KX_DYN_DISABLE_DYNAMICS(1)
+ * KX_DYN_ENABLE_RIGID_BODY(2)
+ * KX_DYN_DISABLE_RIGID_BODY(3)
+ * KX_DYN_SET_MASS(4)
+
+ .. attribute:: mass
+
+ the mass value for the KX_DYN_SET_MASS operation.
+
+ :type: float
+
+.. class:: KX_SCA_EndObjectActuator(SCA_IActuator)
+
+ Edit Object Actuator (in End Object mode)
+
+ This actuator has no python methods.
+
+.. class:: KX_SCA_ReplaceMeshActuator(SCA_IActuator)
+
+ Edit Object actuator, in Replace Mesh mode.
+
+ .. warning::
+
+ Replace mesh actuators will be ignored if at game start, the named mesh doesn't exist.
+
+ This will generate a warning in the console
+
+ .. code-block:: none
+
+ Error: GameObject 'Name' ReplaceMeshActuator 'ActuatorName' without object
+
+ .. code-block:: python
+
+ # Level-of-detail
+ # Switch a game object's mesh based on its depth in the camera view.
+ # +----------+ +-----------+ +-------------------------------------+
+ # | Always +-----+ Python +-----+ Edit Object (Replace Mesh) LOD.Mesh |
+ # +----------+ +-----------+ +-------------------------------------+
+ import GameLogic
+
+ # List detail meshes here
+ # Mesh (name, near, far)
+ # Meshes overlap so that they don't 'pop' when on the edge of the distance.
+ meshes = ((".Hi", 0.0, -20.0),
+ (".Med", -15.0, -50.0),
+ (".Lo", -40.0, -100.0)
+ )
+
+ co = GameLogic.getCurrentController()
+ obj = co.owner
+ act = co.actuators["LOD." + obj.name]
+ cam = GameLogic.getCurrentScene().active_camera
+
+ def Depth(pos, plane):
+ return pos[0]*plane[0] + pos[1]*plane[1] + pos[2]*plane[2] + plane[3]
+
+ # Depth is negative and decreasing further from the camera
+ depth = Depth(obj.position, cam.world_to_camera[2])
+
+ newmesh = None
+ curmesh = None
+ # Find the lowest detail mesh for depth
+ for mesh in meshes:
+ if depth < mesh[1] and depth > mesh[2]:
+ newmesh = mesh
+ if "ME" + obj.name + mesh[0] == act.getMesh():
+ curmesh = mesh
+
+ if newmesh != None and "ME" + obj.name + newmesh[0] != act.getMesh():
+ # The mesh is a different mesh - switch it.
+ # Check the current mesh is not a better fit.
+ if curmesh == None or curmesh[1] < depth or curmesh[2] > depth:
+ act.mesh = obj.getName() + newmesh[0]
+ GameLogic.addActiveActuator(act, True)
+
+ .. attribute:: mesh
+
+ :class:`MeshProxy` or the name of the mesh that will replace the current one.
+
+ Set to None to disable actuator.
+
+ :type: :class:`MeshProxy` or None if no mesh is set
+
+ .. attribute:: useDisplayMesh
+
+ when true the displayed mesh is replaced.
+
+ :type: boolean
+
+ .. attribute:: usePhysicsMesh
+
+ when true the physics mesh is replaced.
+
+ :type: boolean
+
+ .. method:: instantReplaceMesh()
+
+ Immediately replace mesh without delay.
+
+.. class:: KX_Scene(PyObjectPlus)
+
+ An active scene that gives access to objects, cameras, lights and scene attributes.
+
+ The activity culling stuff is supposed to disable logic bricks when their owner gets too far
+ from the active camera. It was taken from some code lurking at the back of KX_Scene - who knows
+ what it does!
+
+ .. code-block:: python
+
+ import GameLogic
+
+ # get the scene
+ scene = GameLogic.getCurrentScene()
+
+ # print all the objects in the scene
+ for obj in scene.objects:
+ print obj.name
+
+ # get an object named 'Cube'
+ obj = scene.objects["Cube"]
+
+ # get the first object in the scene.
+ obj = scene.objects[0]
+
+ .. code-block:: python
+
+ # Get the depth of an object in the camera view.
+ import GameLogic
+
+ obj = GameLogic.getCurrentController().owner
+ cam = GameLogic.getCurrentScene().active_camera
+
+ # Depth is negative and decreasing further from the camera
+ depth = obj.position[0]*cam.world_to_camera[2][0] + obj.position[1]*cam.world_to_camera[2][1] + obj.position[2]*cam.world_to_camera[2][2] + cam.world_to_camera[2][3]
+
+ @bug: All attributes are read only at the moment.
+
+ .. attribute:: name
+
+ The scene's name, (read-only).
+
+ :type: string
+
+ .. attribute:: objects
+
+ A list of objects in the scene, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`
+
+ .. attribute:: objectsInactive
+
+ A list of objects on background layers (used for the addObject actuator), (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`
+
+ .. attribute:: lights
+
+ A list of lights in the scene, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_LightObject`
+
+ .. attribute:: cameras
+
+ A list of cameras in the scene, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_Camera`
+
+ .. attribute:: active_camera
+
+ The current active camera.
+
+ :type: :class:`KX_Camera`
+
+ .. note::
+
+ This can be set directly from python to avoid using the :class:`KX_SceneActuator`.
+
+ .. attribute:: suspended
+
+ True if the scene is suspended, (read-only).
+
+ :type: boolean
+
+ .. attribute:: activity_culling
+
+ True if the scene is activity culling.
+
+ :type: boolean
+
+ .. attribute:: activity_culling_radius
+
+ The distance outside which to do activity culling. Measured in manhattan distance.
+
+ :type: float
+
+ .. attribute:: dbvt_culling
+
+ True when Dynamic Bounding box Volume Tree is set (read-only).
+
+ :type: boolean
+
+ .. attribute:: pre_draw
+
+ A list of callables to be run before the render step.
+
+ :type: list
+
+ .. attribute:: post_draw
+
+ A list of callables to be run after the render step.
+
+ :type: list
+
+ .. method:: addObject(object, other, time=0)
+
+ Adds an object to the scene like the Add Object Actuator would.
+
+ :arg object: The object to add
+ :type object: :class:`KX_GameObject` or string
+ :arg other: The object's center to use when adding the object
+ :type other: :class:`KX_GameObject` or string
+ :arg time: The lifetime of the added object, in frames. A time of 0 means the object will last forever.
+ :type time: integer
+ :return: The newly added object.
+ :rtype: :class:`KX_GameObject`
+
+ .. method:: end()
+
+ Removes the scene from the game.
+
+ .. method:: restart()
+
+ Restarts the scene.
+
+ .. method:: replace(scene)
+
+ Replaces this scene with another one.
+
+ :arg scene: The name of the scene to replace this scene with.
+ :type scene: string
+
+ .. method:: suspend()
+
+ Suspends this scene.
+
+ .. method:: resume()
+
+ Resume this scene.
+
+ .. method:: get(key, default=None)
+
+ Return the value matching key, or the default value if its not found.
+ :return: The key value or a default.
+
+.. class:: KX_SceneActuator(SCA_IActuator)
+
+ Scene Actuator logic brick.
+
+ .. warning::
+
+ Scene actuators that use a scene name will be ignored if at game start, the named scene doesn't exist or is empty
+
+ This will generate a warning in the console:
+
+ .. code-block:: none
+
+ Error: GameObject 'Name' has a SceneActuator 'ActuatorName' (SetScene) without scene
+
+ .. attribute:: scene
+
+ the name of the scene to change to/overlay/underlay/remove/suspend/resume.
+
+ :type: string
+
+ .. attribute:: camera
+
+ the camera to change to.
+
+ :type: :class:`KX_Camera` on read, string or :class:`KX_Camera` on write
+
+ .. note::
+
+ When setting the attribute, you can use either a :class:`KX_Camera` or the name of the camera.
+
+ .. attribute:: useRestart
+
+ Set flag to True to restart the sene.
+
+ :type: boolean
+
+ .. attribute:: mode
+
+ The mode of the actuator.
+
+ :type: integer from 0 to 5.
+
+.. class:: KX_SoundActuator(SCA_IActuator)
+
+ Sound Actuator.
+
+ The :data:`startSound`, :data:`pauseSound` and :data:`stopSound` do not requirethe actuator to be activated - they act instantly provided that the actuator has been activated once at least.
+
+ .. attribute:: fileName
+
+ The filename of the sound this actuator plays.
+
+ :type: string
+
+ .. attribute:: volume
+
+ The volume (gain) of the sound.
+
+ :type: float
+
+ .. attribute:: pitch
+
+ The pitch of the sound.
+
+ :type: float
+
+ .. attribute:: rollOffFactor
+
+ The roll off factor. Rolloff defines the rate of attenuation as the sound gets further away.
+
+ :type: float
+
+ .. attribute:: looping
+
+ The loop mode of the actuator.
+
+ :type: integer
+
+ .. attribute:: position
+
+ The position of the sound as a list: [x, y, z].
+
+ :type: float array
+
+ .. attribute:: velocity
+
+ The velocity of the emitter as a list: [x, y, z]. The relative velocity to the observer determines the pitch. List of 3 floats: [x, y, z].
+
+ :type: float array
+
+ .. attribute:: orientation
+
+ The orientation of the sound. When setting the orientation you can also use quaternion [float, float, float, float] or euler angles [float, float, float].
+
+ :type: 3x3 matrix [[float]]
+
+ .. attribute:: mode
+
+ The operation mode of the actuator. Can be one of :ref:`these constants<logic-sound-actuator>`
+
+ :type: integer
+
+.. class:: KX_StateActuator(SCA_IActuator)
+
+ State actuator changes the state mask of parent object.
+
+ .. attribute:: operation
+
+ Type of bit operation to be applied on object state mask.
+
+ You can use one of :ref:`these constants <state-actuator-operation>`
+
+ :type: integer
+
+ .. attribute:: mask
+
+ Value that defines the bits that will be modified by the operation.
+
+ The bits that are 1 in the mask will be updated in the object state.
+
+ The bits that are 0 are will be left unmodified expect for the Copy operation which copies the mask to the object state.
+
+ :type: integer
+
+.. class:: KX_TrackToActuator(SCA_IActuator)
+
+ Edit Object actuator in Track To mode.
+
+ .. warning::
+
+ Track To Actuators will be ignored if at game start, the object to track to is invalid.
+
+ This will generate a warning in the console:
+
+ .. code-block:: none
+
+ GameObject 'Name' no object in EditObjectActuator 'ActuatorName'
+
+ .. attribute:: object
+
+ the object this actuator tracks.
+
+ :type: :class:`KX_GameObject` or None
+
+ .. attribute:: time
+
+ the time in frames with which to delay the tracking motion.
+
+ :type: integer
+
+ .. attribute:: use3D
+
+ the tracking motion to use 3D.
+
+ :type: boolean
+
+.. class:: KX_VehicleWrapper(PyObjectPlus)
+
+ KX_VehicleWrapper
+
+ TODO - description
+
+ .. method:: addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering)
+
+ Add a wheel to the vehicle
+
+ :arg wheel: The object to use as a wheel.
+ :type wheel: :class:`KX_GameObject` or a KX_GameObject name
+ :arg attachPos: The position that this wheel will attach to.
+ :type attachPos: vector of 3 floats
+ :arg attachDir: The direction this wheel points.
+ :type attachDir: vector of 3 floats
+ :arg axleDir: The direction of this wheels axle.
+ :type axleDir: vector of 3 floats
+ :arg suspensionRestLength: TODO - Description
+ :type suspensionRestLength: float
+ :arg wheelRadius: The size of the wheel.
+ :type wheelRadius: float
+
+ .. method:: applyBraking(force, wheelIndex)
+
+ Apply a braking force to the specified wheel
+
+ :arg force: the brake force
+ :type force: float
+
+ :arg wheelIndex: index of the wheel where the force needs to be applied
+ :type wheelIndex: integer
+
+ .. method:: applyEngineForce(force, wheelIndex)
+
+ Apply an engine force to the specified wheel
+
+ :arg force: the engine force
+ :type force: float
+
+ :arg wheelIndex: index of the wheel where the force needs to be applied
+ :type wheelIndex: integer
+
+ .. method:: getConstraintId()
+
+ Get the constraint ID
+
+ :return: the constraint id
+ :rtype: integer
+
+ .. method:: getConstraintType()
+
+ Returns the constraint type.
+
+ :return: constraint type
+ :rtype: integer
+
+ .. method:: getNumWheels()
+
+ Returns the number of wheels.
+
+ :return: the number of wheels for this vehicle
+ :rtype: integer
+
+ .. method:: getWheelOrientationQuaternion(wheelIndex)
+
+ Returns the wheel orientation as a quaternion.
+
+ :arg wheelIndex: the wheel index
+ :type wheelIndex: integer
+
+ :return: TODO Description
+ :rtype: TODO - type should be quat as per method name but from the code it looks like a matrix
+
+ .. method:: getWheelPosition(wheelIndex)
+
+ Returns the position of the specified wheel
+
+ :arg wheelIndex: the wheel index
+ :type wheelIndex: integer
+ :return: position vector
+ :rtype: list[x, y, z]
+
+ .. method:: getWheelRotation(wheelIndex)
+
+ Returns the rotation of the specified wheel
+
+ :arg wheelIndex: the wheel index
+ :type wheelIndex: integer
+
+ :return: the wheel rotation
+ :rtype: float
+
+ .. method:: setRollInfluence(rollInfluece, wheelIndex)
+
+ Set the specified wheel's roll influence.
+ The higher the roll influence the more the vehicle will tend to roll over in corners.
+
+ :arg rollInfluece: the wheel roll influence
+ :type rollInfluece: float
+
+ :arg wheelIndex: the wheel index
+ :type wheelIndex: integer
+
+ .. method:: setSteeringValue(steering, wheelIndex)
+
+ Set the specified wheel's steering
+
+ :arg steering: the wheel steering
+ :type steering: float
+
+ :arg wheelIndex: the wheel index
+ :type wheelIndex: integer
+
+ .. method:: setSuspensionCompression(compression, wheelIndex)
+
+ Set the specified wheel's compression
+
+ :arg compression: the wheel compression
+ :type compression: float
+
+ :arg wheelIndex: the wheel index
+ :type wheelIndex: integer
+
+ .. method:: setSuspensionDamping(damping, wheelIndex)
+
+ Set the specified wheel's damping
+
+ :arg damping: the wheel damping
+ :type damping: float
+
+ :arg wheelIndex: the wheel index
+ :type wheelIndex: integer
+
+ .. method:: setSuspensionStiffness(stiffness, wheelIndex)
+
+ Set the specified wheel's stiffness
+
+ :arg stiffness: the wheel stiffness
+ :type stiffness: float
+
+ :arg wheelIndex: the wheel index
+ :type wheelIndex: integer
+
+ .. method:: setTyreFriction(friction, wheelIndex)
+
+ Set the specified wheel's tyre friction
+
+ :arg friction: the tyre friction
+ :type friction: float
+
+ :arg wheelIndex: the wheel index
+ :type wheelIndex: integer
+
+.. class:: KX_VertexProxy(SCA_IObject)
+
+ A vertex holds position, UV, colour and normal information.
+
+ Note:
+ The physics simulation is NOT currently updated - physics will not respond
+ to changes in the vertex position.
+
+ .. attribute:: XYZ
+
+ The position of the vertex.
+
+ :type: list [x, y, z]
+
+ .. attribute:: UV
+
+ The texture coordinates of the vertex.
+
+ :type: list [u, v]
+
+ .. attribute:: normal
+
+ The normal of the vertex.
+
+ :type: list [nx, ny, nz]
+
+ .. attribute:: colour
+
+ The colour of the vertex.
+
+ :type: list [r, g, b, a]
+
+ Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0]
+
+ .. attribute:: color
+
+ Synonym for colour.
+
+ .. attribute:: x
+
+ The x coordinate of the vertex.
+
+ :type: float
+
+ .. attribute:: y
+
+ The y coordinate of the vertex.
+
+ :type: float
+
+ .. attribute:: z
+
+ The z coordinate of the vertex.
+
+ :type: float
+
+ .. attribute:: u
+
+ The u texture coordinate of the vertex.
+
+ :type: float
+
+ .. attribute:: v
+
+ The v texture coordinate of the vertex.
+
+ :type: float
+
+ .. attribute:: u2
+
+ The second u texture coordinate of the vertex.
+
+ :type: float
+
+ .. attribute:: v2
+
+ The second v texture coordinate of the vertex.
+
+ :type: float
+
+ .. attribute:: r
+
+ The red component of the vertex colour. 0.0 <= r <= 1.0.
+
+ :type: float
+
+ .. attribute:: g
+
+ The green component of the vertex colour. 0.0 <= g <= 1.0.
+
+ :type: float
+
+ .. attribute:: b
+
+ The blue component of the vertex colour. 0.0 <= b <= 1.0.
+
+ :type: float
+
+ .. attribute:: a
+
+ The alpha component of the vertex colour. 0.0 <= a <= 1.0.
+
+ :type: float
+
+ .. method:: getXYZ()
+
+ Gets the position of this vertex.
+
+ :return: this vertexes position in local coordinates.
+ :rtype: list [x, y, z]
+
+ .. method:: setXYZ(pos)
+
+ Sets the position of this vertex.
+
+ :type: list [x, y, z]
+
+ :arg pos: the new position for this vertex in local coordinates.
+
+ .. method:: getUV()
+
+ Gets the UV (texture) coordinates of this vertex.
+
+ :return: this vertexes UV (texture) coordinates.
+ :rtype: list [u, v]
+
+ .. method:: setUV(uv)
+
+ Sets the UV (texture) coordinates of this vertex.
+
+ :type: list [u, v]
+
+ .. method:: getUV2()
+
+ Gets the 2nd UV (texture) coordinates of this vertex.
+
+ :return: this vertexes UV (texture) coordinates.
+ :rtype: list [u, v]
+
+ .. method:: setUV2(uv, unit)
+
+ Sets the 2nd UV (texture) coordinates of this vertex.
+
+ :type: list [u, v]
+
+ :arg unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV
+ :arg unit: integer
+
+ .. method:: getRGBA()
+
+ Gets the colour of this vertex.
+
+ The colour is represented as four bytes packed into an integer value. The colour is
+ packed as RGBA.
+
+ Since Python offers no way to get each byte without shifting, you must use the struct module to
+ access colour in an machine independent way.
+
+ Because of this, it is suggested you use the r, g, b and a attributes or the colour attribute instead.
+
+ .. code-block:: python
+
+ import struct;
+ col = struct.unpack('4B', struct.pack('I', v.getRGBA()))
+ # col = (r, g, b, a)
+ # black = ( 0, 0, 0, 255)
+ # white = (255, 255, 255, 255)
+
+ :return: packed colour. 4 byte integer with one byte per colour channel in RGBA format.
+ :rtype: integer
+
+ .. method:: setRGBA(col)
+
+ Sets the colour of this vertex.
+
+ See getRGBA() for the format of col, and its relevant problems. Use the r, g, b and a attributes
+ or the colour attribute instead.
+
+ setRGBA() also accepts a four component list as argument col. The list represents the colour as [r, g, b, a]
+ with black = [0.0, 0.0, 0.0, 1.0] and white = [1.0, 1.0, 1.0, 1.0]
+
+ .. code-block:: python
+
+ v.setRGBA(0xff0000ff) # Red
+ v.setRGBA(0xff00ff00) # Green on little endian, transparent purple on big endian
+ v.setRGBA([1.0, 0.0, 0.0, 1.0]) # Red
+ v.setRGBA([0.0, 1.0, 0.0, 1.0]) # Green on all platforms.
+
+ :arg col: the new colour of this vertex in packed RGBA format.
+ :type col: integer or list [r, g, b, a]
+
+ .. method:: getNormal()
+
+ Gets the normal vector of this vertex.
+
+ :return: normalised normal vector.
+ :rtype: list [nx, ny, nz]
+
+ .. method:: setNormal(normal)
+
+ Sets the normal vector of this vertex.
+
+ :type: sequence of floats [r, g, b]
+
+ :arg normal: the new normal of this vertex.
+
+.. class:: KX_VisibilityActuator(SCA_IActuator)
+
+ Visibility Actuator.
+
+ .. attribute:: visibility
+
+ whether the actuator makes its parent object visible or invisible.
+
+ :type: boolean
+
+ .. attribute:: useOcclusion
+
+ whether the actuator makes its parent object an occluder or not.
+
+ :type: boolean
+
+ .. attribute:: useRecursion
+
+ whether the visibility/occlusion should be propagated to all children of the object.
+
+ :type: boolean
+
+.. class:: SCA_2DFilterActuator(SCA_IActuator)
+
+ Create, enable and disable 2D filters
+
+ The following properties don't have an immediate effect.
+ You must active the actuator to get the result.
+ The actuator is not persistent: it automatically stops itself after setting up the filter
+ but the filter remains active. To stop a filter you must activate the actuator with 'type'
+ set to :data:`~bge.logic.RAS_2DFILTER_DISABLED` or :data:`~bge.logic.RAS_2DFILTER_NOFILTER`.
+
+ .. attribute:: shaderText
+
+ shader source code for custom shader.
+
+ :type: string
+
+ .. attribute:: disableMotionBlur
+
+ action on motion blur: 0=enable, 1=disable.
+
+ :type: integer
+
+ .. attribute:: mode
+
+ Type of 2D filter, use one of :ref:`these constants <Two-D-FilterActuator-mode>`
+
+ :type: integer
+
+ .. attribute:: passNumber
+
+ order number of filter in the stack of 2D filters. Filters are executed in increasing order of passNb.
+
+ Only be one filter can be defined per passNb.
+
+ :type: integer (0-100)
+
+ .. attribute:: value
+
+ argument for motion blur filter.
+
+ :type: float (0.0-100.0)
+
+.. class:: SCA_ANDController(SCA_IController)
+
+ An AND controller activates only when all linked sensors are activated.
+
+ There are no special python methods for this controller.
+
+.. class:: SCA_ActuatorSensor(SCA_ISensor)
+
+ Actuator sensor detect change in actuator state of the parent object.
+ It generates a positive pulse if the corresponding actuator is activated
+ and a negative pulse if the actuator is deactivated.
+
+ .. attribute:: actuator
+
+ the name of the actuator that the sensor is monitoring.
+
+ :type: string
+
+.. class:: SCA_AlwaysSensor(SCA_ISensor)
+
+ This sensor is always activated.
+
+.. class:: SCA_DelaySensor(SCA_ISensor)
+
+ The Delay sensor generates positive and negative triggers at precise time,
+ expressed in number of frames. The delay parameter defines the length of the initial OFF period. A positive trigger is generated at the end of this period.
+
+ The duration parameter defines the length of the ON period following the OFF period.
+ There is a negative trigger at the end of the ON period. If duration is 0, the sensor stays ON and there is no negative trigger.
+
+ The sensor runs the OFF-ON cycle once unless the repeat option is set: the OFF-ON cycle repeats indefinately (or the OFF cycle if duration is 0).
+
+ Use :class:`SCA_ISensor.reset` at any time to restart sensor.
+
+ .. attribute:: delay
+
+ length of the initial OFF period as number of frame, 0 for immediate trigger.
+
+ :type: integer.
+
+ .. attribute:: duration
+
+ length of the ON period in number of frame after the initial OFF period.
+
+ If duration is greater than 0, a negative trigger is sent at the end of the ON pulse.
+
+ :type: integer
+
+ .. attribute:: repeat
+
+ 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once.
+
+ :type: integer
+
+.. class:: SCA_JoystickSensor(SCA_ISensor)
+
+ This sensor detects player joystick events.
+
+ .. attribute:: axisValues
+
+ The state of the joysticks axis as a list of values :data:`numAxis` long. (read-only).
+
+ :type: list of ints.
+
+ Each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing.
+ The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
+
+ * left:[-32767, 0, ...]
+ * right:[32767, 0, ...]
+ * up:[0, -32767, ...]
+ * down:[0, 32767, ...]
+
+ .. attribute:: axisSingle
+
+ like :data:`axisValues` but returns a single axis value that is set by the sensor. (read-only).
+
+ :type: integer
+
+ .. note::
+
+ Only use this for "Single Axis" type sensors otherwise it will raise an error.
+
+ .. attribute:: hatValues
+
+ The state of the joysticks hats as a list of values :data:`numHats` long. (read-only).
+
+ :type: list of ints
+
+ Each spesifying the direction of the hat from 1 to 12, 0 when inactive.
+
+ Hat directions are as follows...
+
+ * 0:None
+ * 1:Up
+ * 2:Right
+ * 4:Down
+ * 8:Left
+ * 3:Up - Right
+ * 6:Down - Right
+ * 12:Down - Left
+ * 9:Up - Left
+
+ .. attribute:: hatSingle
+
+ Like :data:`hatValues` but returns a single hat direction value that is set by the sensor. (read-only).
+
+ :type: integer
+
+ .. attribute:: numAxis
+
+ The number of axes for the joystick at this index. (read-only).
+
+ :type: integer
+
+ .. attribute:: numButtons
+
+ The number of buttons for the joystick at this index. (read-only).
+
+ :type: integer
+
+ .. attribute:: numHats
+
+ The number of hats for the joystick at this index. (read-only).
+
+ :type: integer
+
+ .. attribute:: connected
+
+ True if a joystick is connected at this joysticks index. (read-only).
+
+ :type: boolean
+
+ .. attribute:: index
+
+ The joystick index to use (from 0 to 7). The first joystick is always 0.
+
+ :type: integer
+
+ .. attribute:: threshold
+
+ Axis threshold. Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive.
+
+ :type: integer
+
+ .. attribute:: button
+
+ The button index the sensor reacts to (first button = 0). When the "All Events" toggle is set, this option has no effect.
+
+ :type: integer
+
+ .. attribute:: axis
+
+ The axis this sensor reacts to, as a list of two values [axisIndex, axisDirection]
+
+ * axisIndex: the axis index to use when detecting axis movement, 1=primary directional control, 2=secondary directional control.
+ * axisDirection: 0=right, 1=up, 2=left, 3=down.
+
+ :type: [integer, integer]
+
+ .. attribute:: hat
+
+ The hat the sensor reacts to, as a list of two values: [hatIndex, hatDirection]
+
+ * hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat (4 max).
+ * hatDirection: 1-12.
+
+ :type: [integer, integer]
+
+ .. method:: getButtonActiveList()
+
+ :return: A list containing the indicies of the currently pressed buttons.
+ :rtype: list
+
+ .. method:: getButtonStatus(buttonIndex)
+
+ :arg buttonIndex: the button index, 0=first button
+ :type buttonIndex: integer
+ :return: The current pressed state of the specified button.
+ :rtype: boolean
+
+.. class:: SCA_KeyboardSensor(SCA_ISensor)
+
+ A keyboard sensor detects player key presses.
+
+ See module :mod:`bge.keys` for keycode values.
+
+ .. attribute:: key
+
+ The key code this sensor is looking for.
+
+ :type: keycode from :mod:`bge.keys` module
+
+ .. attribute:: hold1
+
+ The key code for the first modifier this sensor is looking for.
+
+ :type: keycode from :mod:`bge.keys` module
+
+ .. attribute:: hold2
+
+ The key code for the second modifier this sensor is looking for.
+
+ :type: keycode from :mod:`bge.keys` module
+
+ .. attribute:: toggleProperty
+
+ The name of the property that indicates whether or not to log keystrokes as a string.
+
+ :type: string
+
+ .. attribute:: targetProperty
+
+ The name of the property that receives keystrokes in case in case a string is logged.
+
+ :type: string
+
+ .. attribute:: useAllKeys
+
+ Flag to determine whether or not to accept all keys.
+
+ :type: boolean
+
+ .. attribute:: events
+
+ a list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only).
+
+ :type: list [[:ref:`keycode<keyboard-keys>`, :ref:`status<input-status>`], ...]
+
+ .. method:: getKeyStatus(keycode)
+
+ Get the status of a key.
+
+ :arg keycode: The code that represents the key you want to get the state of, use one of :ref:`these constants<keyboard-keys>`
+ :type keycode: integer
+ :return: The state of the given key, can be one of :ref:`these constants<input-status>`
+ :rtype: int
+
+.. class:: SCA_NANDController(SCA_IController)
+
+ An NAND controller activates when all linked sensors are not active.
+
+ There are no special python methods for this controller.
+
+.. class:: SCA_NORController(SCA_IController)
+
+ An NOR controller activates only when all linked sensors are de-activated.
+
+ There are no special python methods for this controller.
+
+.. class:: SCA_ORController(SCA_IController)
+
+ An OR controller activates when any connected sensor activates.
+
+ There are no special python methods for this controller.
+
+.. class:: SCA_PropertyActuator(SCA_IActuator)
+
+ Property Actuator
+
+ .. attribute:: propName
+
+ the property on which to operate.
+
+ :type: string
+
+ .. attribute:: value
+
+ the value with which the actuator operates.
+
+ :type: string
+
+ .. attribute:: mode
+
+ TODO - add constants to game logic dict!.
+
+ :type: integer
+
+.. class:: SCA_PropertySensor(SCA_ISensor)
+
+ Activates when the game object property matches.
+
+ .. attribute:: mode
+
+ Type of check on the property. Can be one of :ref:`these constants <logic-property-sensor>`
+
+ :type: integer.
+
+ .. attribute:: propName
+
+ the property the sensor operates.
+
+ :type: string
+
+ .. attribute:: value
+
+ the value with which the sensor compares to the value of the property.
+
+ :type: string
+
+ .. attribute:: min
+
+ the minimum value of the range used to evaluate the property when in interval mode.
+
+ :type: string
+
+ .. attribute:: max
+
+ the maximum value of the range used to evaluate the property when in interval mode.
+
+ :type: string
+
+.. class:: SCA_PythonController(SCA_IController)
+
+ A Python controller uses a Python script to activate it's actuators,
+ based on it's sensors.
+
+ .. attribute:: script
+
+ The value of this variable depends on the execution methid.
+
+ * When 'Script' execution mode is set this value contains the entire python script as a single string (not the script name as you might expect) which can be modified to run different scripts.
+ * When 'Module' execution mode is set this value will contain a single line string - module name and function "module.func" or "package.modile.func" where the module names are python textblocks or external scripts.
+
+ :type: string
+
+ .. note::
+
+ Once this is set the script name given for warnings will remain unchanged.
+
+ .. attribute:: mode
+
+ the execution mode for this controller (read-only).
+
+ * Script: 0, Execite the :data:`script` as a python code.
+ * Module: 1, Execite the :data:`script` as a module and function.
+
+ :type: integer
+
+ .. method:: activate(actuator)
+
+ Activates an actuator attached to this controller.
+
+ :arg actuator: The actuator to operate on.
+ :type actuator: actuator or the actuator name as a string
+
+ .. method:: deactivate(actuator)
+
+ Deactivates an actuator attached to this controller.
+
+ :arg actuator: The actuator to operate on.
+ :type actuator: actuator or the actuator name as a string
+
+.. class:: SCA_RandomActuator(SCA_IActuator)
+
+ Random Actuator
+
+ .. attribute:: seed
+
+ Seed of the random number generator.
+
+ :type: integer.
+
+ Equal seeds produce equal series. If the seed is 0, the generator will produce the same value on every call.
+
+ .. attribute:: para1
+
+ the first parameter of the active distribution.
+
+ :type: float, read-only.
+
+ Refer to the documentation of the generator types for the meaning of this value.
+
+ .. attribute:: para2
+
+ the second parameter of the active distribution.
+
+ :type: float, read-only
+
+ Refer to the documentation of the generator types for the meaning of this value.
+
+ .. attribute:: distribution
+
+ Distribution type. (read-only). Can be one of :ref:`these constants <logic-random-distributions>`
+
+ :type: integer
+
+ .. attribute:: propName
+
+ the name of the property to set with the random value.
+
+ :type: string
+
+ If the generator and property types do not match, the assignment is ignored.
+
+ .. method:: setBoolConst(value)
+
+ Sets this generator to produce a constant boolean value.
+
+ :arg value: The value to return.
+ :type value: boolean
+
+ .. method:: setBoolUniform()
+
+ Sets this generator to produce a uniform boolean distribution.
+
+ The generator will generate True or False with 50% chance.
+
+ .. method:: setBoolBernouilli(value)
+
+ Sets this generator to produce a Bernouilli distribution.
+
+ :arg value: Specifies the proportion of False values to produce.
+
+ * 0.0: Always generate True
+ * 1.0: Always generate False
+ :type value: float
+
+ .. method:: setIntConst(value)
+
+ Sets this generator to always produce the given value.
+
+ :arg value: the value this generator produces.
+ :type value: integer
+
+ .. method:: setIntUniform(lower_bound, upper_bound)
+
+ Sets this generator to produce a random value between the given lower and
+ upper bounds (inclusive).
+
+ :type lower_bound: integer
+ :type upper_bound: integer
+
+ .. method:: setIntPoisson(value)
+
+ Generate a Poisson-distributed number.
+
+ This performs a series of Bernouilli tests with parameter value.
+ It returns the number of tries needed to achieve succes.
+
+ :type value: float
+
+ .. method:: setFloatConst(value)
+
+ Always generate the given value.
+
+ :type value: float
+
+ .. method:: setFloatUniform(lower_bound, upper_bound)
+
+ Generates a random float between lower_bound and upper_bound with a
+ uniform distribution.
+
+ :type lower_bound: float
+ :type upper_bound: float
+
+ .. method:: setFloatNormal(mean, standard_deviation)
+
+ Generates a random float from the given normal distribution.
+
+ :arg mean: The mean (average) value of the generated numbers
+ :type mean: float
+ :arg standard_deviation: The standard deviation of the generated numbers.
+ :type standard_deviation: float
+
+ .. method:: setFloatNegativeExponential(half_life)
+
+ Generate negative-exponentially distributed numbers.
+
+ The half-life 'time' is characterized by half_life.
+
+ :type half_life: float
+
+.. class:: SCA_RandomSensor(SCA_ISensor)
+
+ This sensor activates randomly.
+
+ .. attribute:: lastDraw
+
+ The seed of the random number generator.
+
+ :type: integer
+
+ .. attribute:: seed
+
+ The seed of the random number generator.
+
+ :type: integer
+
+ .. method:: setSeed(seed)
+
+ Sets the seed of the random number generator.
+
+ If the seed is 0, the generator will produce the same value on every call.
+
+ :type seed: integer
+
+ .. method:: getSeed()
+
+ :return: The initial seed of the generator. Equal seeds produce equal random series.
+ :rtype: integer
+
+ .. method:: getLastDraw()
+
+ :return: The last random number generated.
+ :rtype: integer
+
+.. class:: SCA_XNORController(SCA_IController)
+
+ An XNOR controller activates when all linked sensors are the same (activated or inative).
+
+ There are no special python methods for this controller.
+
+.. class:: SCA_XORController(SCA_IController)
+
+ An XOR controller activates when there is the input is mixed, but not when all are on or off.
+
+ There are no special python methods for this controller.
+
+.. class:: KX_Camera(KX_GameObject)
+
+ A Camera object.
+
+ .. data:: INSIDE
+
+ See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
+
+ .. data:: INTERSECT
+
+ See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
+
+ .. data:: OUTSIDE
+
+ See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
+
+ .. attribute:: lens
+
+ The camera's lens value.
+
+ :type: float
+
+ .. attribute:: ortho_scale
+
+ The camera's view scale when in orthographic mode.
+
+ :type: float
+
+ .. attribute:: near
+
+ The camera's near clip distance.
+
+ :type: float
+
+ .. attribute:: far
+
+ The camera's far clip distance.
+
+ :type: float
+
+ .. attribute:: perspective
+
+ True if this camera has a perspective transform, False for an orthographic projection.
+
+ :type: boolean
+
+ .. attribute:: frustum_culling
+
+ True if this camera is frustum culling.
+
+ :type: boolean
+
+ .. attribute:: projection_matrix
+
+ This camera's 4x4 projection matrix.
+
+ :type: 4x4 Matrix [[float]]
+
+ .. attribute:: modelview_matrix
+
+ This camera's 4x4 model view matrix. (read-only).
+
+ :type: 4x4 Matrix [[float]]
+
+ .. note::
+
+ This matrix is regenerated every frame from the camera's position and orientation.
+
+ .. attribute:: camera_to_world
+
+ This camera's camera to world transform. (read-only).
+
+ :type: 4x4 Matrix [[float]]
+
+ .. note::
+
+ This matrix is regenerated every frame from the camera's position and orientation.
+
+ .. attribute:: world_to_camera
+
+ This camera's world to camera transform. (read-only).
+
+ :type: 4x4 Matrix [[float]]
+
+ .. note::
+
+ Regenerated every frame from the camera's position and orientation.
+
+ .. note::
+
+ This is camera_to_world inverted.
+
+ .. attribute:: useViewport
+
+ True when the camera is used as a viewport, set True to enable a viewport for this camera.
+
+ :type: boolean
+
+ .. method:: sphereInsideFrustum(centre, radius)
+
+ Tests the given sphere against the view frustum.
+
+ :arg centre: The centre of the sphere (in world coordinates.)
+ :type centre: list [x, y, z]
+ :arg radius: the radius of the sphere
+ :type radius: float
+ :return: :data:`~bge.types.KX_Camera.INSIDE`, :data:`~bge.types.KX_Camera.OUTSIDE` or :data:`~bge.types.KX_Camera.INTERSECT`
+ :rtype: integer
+
+ .. note::
+
+ When the camera is first initialized the result will be invalid because the projection matrix has not been set.
+
+ .. code-block:: python
+
+ import GameLogic
+ co = GameLogic.getCurrentController()
+ cam = co.owner
+
+ # A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0]
+ if (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE):
+ # Sphere is inside frustum !
+ # Do something useful !
+ else:
+ # Sphere is outside frustum
+
+ .. method:: boxInsideFrustum(box)
+
+ Tests the given box against the view frustum.
+
+ :arg box: Eight (8) corner points of the box (in world coordinates.)
+ :type box: list of lists
+ :return: :data:`~bge.types.KX_Camera.INSIDE`, :data:`~bge.types.KX_Camera.OUTSIDE` or :data:`~bge.types.KX_Camera.INTERSECT`
+
+ .. note::
+
+ When the camera is first initialized the result will be invalid because the projection matrix has not been set.
+
+ .. code-block:: python
+
+ import GameLogic
+ co = GameLogic.getCurrentController()
+ cam = co.owner
+
+ # Box to test...
+ box = []
+ box.append([-1.0, -1.0, -1.0])
+ box.append([-1.0, -1.0, 1.0])
+ box.append([-1.0, 1.0, -1.0])
+ box.append([-1.0, 1.0, 1.0])
+ box.append([ 1.0, -1.0, -1.0])
+ box.append([ 1.0, -1.0, 1.0])
+ box.append([ 1.0, 1.0, -1.0])
+ box.append([ 1.0, 1.0, 1.0])
+
+ if (cam.boxInsideFrustum(box) != cam.OUTSIDE):
+ # Box is inside/intersects frustum !
+ # Do something useful !
+ else:
+ # Box is outside the frustum !
+
+ .. method:: pointInsideFrustum(point)
+
+ Tests the given point against the view frustum.
+
+ :arg point: The point to test (in world coordinates.)
+ :type point: 3D Vector
+ :return: True if the given point is inside this camera's viewing frustum.
+ :rtype: boolean
+
+ .. note::
+
+ When the camera is first initialized the result will be invalid because the projection matrix has not been set.
+
+ .. code-block:: python
+
+ import GameLogic
+ co = GameLogic.getCurrentController()
+ cam = co.owner
+
+ # Test point [0.0, 0.0, 0.0]
+ if (cam.pointInsideFrustum([0.0, 0.0, 0.0])):
+ # Point is inside frustum !
+ # Do something useful !
+ else:
+ # Box is outside the frustum !
+
+ .. method:: getCameraToWorld()
+
+ Returns the camera-to-world transform.
+
+ :return: the camera-to-world transform matrix.
+ :rtype: matrix (4x4 list)
+
+ .. method:: getWorldToCamera()
+
+ Returns the world-to-camera transform.
+
+ This returns the inverse matrix of getCameraToWorld().
+
+ :return: the world-to-camera transform matrix.
+ :rtype: matrix (4x4 list)
+
+ .. method:: setOnTop()
+
+ Set this cameras viewport ontop of all other viewport.
+
+ .. method:: setViewport(left, bottom, right, top)
+
+ Sets the region of this viewport on the screen in pixels.
+
+ Use :data:`bge.render.getWindowHeight` and :data:`bge.render.getWindowWidth` to calculate values relative to the entire display.
+
+ :arg left: left pixel coordinate of this viewport
+ :type left: integer
+ :arg bottom: bottom pixel coordinate of this viewport
+ :type bottom: integer
+ :arg right: right pixel coordinate of this viewport
+ :type right: integer
+ :arg top: top pixel coordinate of this viewport
+ :type top: integer
+
+ .. method:: getScreenPosition(object)
+
+ Gets the position of an object projected on screen space.
+
+ .. code-block:: python
+
+ # For an object in the middle of the screen, coord = [0.5, 0.5]
+ coord = camera.getScreenPosition(object)
+
+ :arg object: object name or list [x, y, z]
+ :type object: :class:`KX_GameObject` or 3D Vector
+ :return: the object's position in screen coordinates.
+ :rtype: list [x, y]
+
+ .. method:: getScreenVect(x, y)
+
+ Gets the vector from the camera position in the screen coordinate direction.
+
+ :arg x: X Axis
+ :type x: float
+ :arg y: Y Axis
+ :type y: float
+ :rtype: 3D Vector
+ :return: The vector from screen coordinate.
+
+ .. code-block:: python
+
+ # Gets the vector of the camera front direction:
+ m_vect = camera.getScreenVect(0.5, 0.5)
+
+ .. method:: getScreenRay(x, y, dist=inf, property=None)
+
+ Look towards a screen coordinate (x, y) and find first object hit within dist that matches prop.
+ The ray is similar to KX_GameObject->rayCastTo.
+
+ :arg x: X Axis
+ :type x: float
+ :arg y: Y Axis
+ :type y: float
+ :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other
+ :type dist: float
+ :arg property: property name that object must have; can be omitted => detect any object
+ :type property: string
+ :rtype: :class:`KX_GameObject`
+ :return: the first object hit or None if no object or object does not match prop
+
+ .. code-block:: python
+
+ # Gets an object with a property "wall" in front of the camera within a distance of 100:
+ target = camera.getScreenRay(0.5, 0.5, 100, "wall")
+
+.. class:: BL_ArmatureObject(KX_GameObject)
+
+ An armature object.
+
+ .. attribute:: constraints
+
+ The list of armature constraint defined on this armature.
+ Elements of the list can be accessed by index or string.
+ The key format for string access is '<bone_name>:<constraint_name>'.
+
+ :type: list of :class:`BL_ArmatureConstraint`
+
+ .. attribute:: channels
+
+ The list of armature channels.
+ Elements of the list can be accessed by index or name the bone.
+
+ :type: list of :class:`BL_ArmatureChannel`
+
+ .. method:: update()
+
+ Ensures that the armature will be updated on next graphic frame.
+
+ This action is unecessary if a KX_ArmatureActuator with mode run is active
+ or if an action is playing. Use this function in other cases. It must be called
+ on each frame to ensure that the armature is updated continously.
+
+.. class:: BL_ArmatureActuator(SCA_IActuator)
+
+ Armature Actuators change constraint condition on armatures.
+
+ .. _armatureactuator-constants-type:
+
+ Constants related to :data:`~bge.types.BL_ArmatureActuator.type`
+
+ .. data:: KX_ACT_ARMATURE_RUN
+
+ Just make sure the armature will be updated on the next graphic frame. This is the only persistent mode of the actuator: it executes automatically once per frame until stopped by a controller
+
+ :value: 0
+
+ .. data:: KX_ACT_ARMATURE_ENABLE
+
+ Enable the constraint.
+
+ :value: 1
+
+ .. data:: KX_ACT_ARMATURE_DISABLE
+
+ Disable the constraint (runtime constraint values are not updated).
+
+ :value: 2
+
+ .. data:: KX_ACT_ARMATURE_SETTARGET
+
+ Change target and subtarget of constraint.
+
+ :value: 3
+
+ .. data:: KX_ACT_ARMATURE_SETWEIGHT
+
+ Change weight of (only for IK constraint).
+
+ :value: 4
+
+ .. attribute:: type
+
+ The type of action that the actuator executes when it is active.
+
+ Can be one of :ref:`these constants <armatureactuator-constants-type>`
+
+ :type: integer
+
+ .. attribute:: constraint
+
+ The constraint object this actuator is controlling.
+
+ :type: :class:`BL_ArmatureConstraint`
+
+ .. attribute:: target
+
+ The object that this actuator will set as primary target to the constraint it controls.
+
+ :type: :class:`KX_GameObject`
+
+ .. attribute:: subtarget
+
+ The object that this actuator will set as secondary target to the constraint it controls.
+
+ :type: :class:`KX_GameObject`.
+
+ .. note::
+
+ Currently, the only secondary target is the pole target for IK constraint.
+
+ .. attribute:: weight
+
+ The weight this actuator will set on the constraint it controls.
+
+ :type: float.
+
+ .. note::
+
+ Currently only the IK constraint has a weight. It must be a value between 0 and 1.
+
+ .. note::
+
+ A weight of 0 disables a constraint while still updating constraint runtime values (see :class:`BL_ArmatureConstraint`)
+
+.. class:: KX_ArmatureSensor(SCA_ISensor)
+
+ Armature sensor detect conditions on armatures.
+
+ .. _armaturesensor-type:
+
+ Constants related to :data:`type`
+
+ .. data:: KX_ARMSENSOR_STATE_CHANGED
+
+ Detect that the constraint is changing state (active/inactive)
+
+ :value: 0
+
+ .. data:: KX_ARMSENSOR_LIN_ERROR_BELOW
+
+ Detect that the constraint linear error is above a threshold
+
+ :value: 1
+
+ .. data:: KX_ARMSENSOR_LIN_ERROR_ABOVE
+
+ Detect that the constraint linear error is below a threshold
+
+ :value: 2
+
+ .. data:: KX_ARMSENSOR_ROT_ERROR_BELOW
+
+ Detect that the constraint rotation error is above a threshold
+
+ :value: 3
+
+ .. data:: KX_ARMSENSOR_ROT_ERROR_ABOVE
+
+ Detect that the constraint rotation error is below a threshold
+
+ :value: 4
+
+ .. attribute:: type
+
+ The type of measurement that the sensor make when it is active.
+
+ Can be one of :ref:`these constants <armaturesensor-type>`
+
+ :type: integer.
+
+ .. attribute:: constraint
+
+ The constraint object this sensor is watching.
+
+ :type: :class:`BL_ArmatureConstraint`
+
+ .. attribute:: value
+
+ The threshold used in the comparison with the constraint error
+ The linear error is only updated on CopyPose/Distance IK constraint with iTaSC solver
+ The rotation error is only updated on CopyPose+rotation IK constraint with iTaSC solver
+ The linear error on CopyPose is always >= 0: it is the norm of the distance between the target and the bone
+ The rotation error on CopyPose is always >= 0: it is the norm of the equivalent rotation vector between the bone and the target orientations
+ The linear error on Distance can be positive if the distance between the bone and the target is greater than the desired distance, and negative if the distance is smaller.
+
+ :type: float
+
+.. class:: BL_ArmatureConstraint(PyObjectPlus)
+
+ Proxy to Armature Constraint. Allows to change constraint on the fly.
+ Obtained through :class:`BL_ArmatureObject`.constraints.
+
+ .. note::
+
+ Not all armature constraints are supported in the GE.
+
+ .. _armatureconstraint-constants-type:
+
+ Constants related to :data:`type`
+
+ .. data:: CONSTRAINT_TYPE_TRACKTO
+ .. data:: CONSTRAINT_TYPE_KINEMATIC
+ .. data:: CONSTRAINT_TYPE_ROTLIKE
+ .. data:: CONSTRAINT_TYPE_LOCLIKE
+ .. data:: CONSTRAINT_TYPE_MINMAX
+ .. data:: CONSTRAINT_TYPE_SIZELIKE
+ .. data:: CONSTRAINT_TYPE_LOCKTRACK
+ .. data:: CONSTRAINT_TYPE_STRETCHTO
+ .. data:: CONSTRAINT_TYPE_CLAMPTO
+ .. data:: CONSTRAINT_TYPE_TRANSFORM
+ .. data:: CONSTRAINT_TYPE_DISTLIMIT
+
+ .. _armatureconstraint-constants-ik-type:
+
+ Constants related to :data:`ik_type`
+
+ .. data:: CONSTRAINT_IK_COPYPOSE
+
+ constraint is trying to match the position and eventually the rotation of the target.
+
+ :value: 0
+
+ .. data:: CONSTRAINT_IK_DISTANCE
+
+ Constraint is maintaining a certain distance to target subject to ik_mode
+
+ :value: 1
+
+ .. _armatureconstraint-constants-ik-flag:
+
+ Constants related to :data:`ik_flag`
+
+ .. data:: CONSTRAINT_IK_FLAG_TIP
+
+ Set when the constraint operates on the head of the bone and not the tail
+
+ :value: 1
+
+ .. data:: CONSTRAINT_IK_FLAG_ROT
+
+ Set when the constraint tries to match the orientation of the target
+
+ :value: 2
+
+ .. data:: CONSTRAINT_IK_FLAG_STRETCH
+
+ Set when the armature is allowed to stretch (only the bones with stretch factor > 0.0)
+
+ :value: 16
+
+ .. data:: CONSTRAINT_IK_FLAG_POS
+
+ Set when the constraint tries to match the position of the target.
+
+ :value: 32
+
+ .. _armatureconstraint-constants-ik-mode:
+
+ Constants related to :data:`ik_mode`
+
+ .. data:: CONSTRAINT_IK_MODE_INSIDE
+
+ The constraint tries to keep the bone within ik_dist of target
+
+ :value: 0
+
+ .. data:: CONSTRAINT_IK_MODE_OUTSIDE
+
+ The constraint tries to keep the bone outside ik_dist of the target
+
+ :value: 1
+
+ .. data:: CONSTRAINT_IK_MODE_ONSURFACE
+
+ The constraint tries to keep the bone exactly at ik_dist of the target.
+
+ :value: 2
+
+ .. attribute:: type
+
+ Type of constraint, (read-only).
+
+ Use one of :ref:`these constants<armatureconstraint-constants-type>`.
+
+ :type: integer, one of CONSTRAINT_TYPE_* constants
+
+ .. attribute:: name
+
+ Name of constraint constructed as <bone_name>:<constraint_name>. constraints list.
+
+ :type: string
+
+ This name is also the key subscript on :class:`BL_ArmatureObject`.
+
+ .. attribute:: enforce
+
+ fraction of constraint effect that is enforced. Between 0 and 1.
+
+ :type: float
+
+ .. attribute:: headtail
+
+ Position of target between head and tail of the target bone: 0=head, 1=tail.
+
+ :type: float.
+
+ .. note::
+
+ Only used if the target is a bone (i.e target object is an armature.
+
+ .. attribute:: lin_error
+
+ runtime linear error (in Blender units) on constraint at the current frame.
+
+ This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
+
+ :type: float
+
+ .. attribute:: rot_error
+
+ Runtime rotation error (in radiant) on constraint at the current frame.
+
+ :type: float.
+
+ This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
+
+ It is only set if the constraint has a rotation part, for example, a CopyPose+Rotation IK constraint.
+
+ .. attribute:: target
+
+ Primary target object for the constraint. The position of this object in the GE will be used as target for the constraint.
+
+ :type: :class:`KX_GameObject`.
+
+ .. attribute:: subtarget
+
+ Secondary target object for the constraint. The position of this object in the GE will be used as secondary target for the constraint.
+
+ :type: :class:`KX_GameObject`.
+
+ Currently this is only used for pole target on IK constraint.
+
+ .. attribute:: active
+
+ True if the constraint is active.
+
+ :type: boolean
+
+ .. note::
+
+ An inactive constraint does not update lin_error and rot_error.
+
+ .. attribute:: ik_weight
+
+ Weight of the IK constraint between 0 and 1.
+
+ Only defined for IK constraint.
+
+ :type: float
+
+ .. attribute:: ik_type
+
+ Type of IK constraint, (read-only).
+
+ Use one of :ref:`these constants<armatureconstraint-constants-ik-type>`.
+
+ :type: integer.
+
+ .. attribute:: ik_flag
+
+ Combination of IK constraint option flags, read-only.
+
+ Use one of :ref:`these constants<armatureconstraint-constants-ik-flag>`.
+
+ :type: integer
+
+ .. attribute:: ik_dist
+
+ Distance the constraint is trying to maintain with target, only used when ik_type=CONSTRAINT_IK_DISTANCE.
+
+ :type: float
+
+ .. attribute:: ik_mode
+
+ Use one of :ref:`these constants<armatureconstraint-constants-ik-mode>`.
+
+ Additional mode for IK constraint. Currently only used for Distance constraint:
+
+ :type: integer
+
+.. class:: BL_ArmatureChannel(PyObjectPlus)
+
+ Proxy to armature pose channel. Allows to read and set armature pose.
+ The attributes are identical to RNA attributes, but mostly in read-only mode.
+
+ See :data:`rotation_mode`
+
+ .. data:: PCHAN_ROT_QUAT
+ .. data:: PCHAN_ROT_XYZ
+ .. data:: PCHAN_ROT_XZY
+ .. data:: PCHAN_ROT_YXZ
+ .. data:: PCHAN_ROT_YZX
+ .. data:: PCHAN_ROT_ZXY
+ .. data:: PCHAN_ROT_ZYX
+
+ .. attribute:: name
+
+ channel name (=bone name), read-only.
+
+ :type: string
+
+ .. attribute:: bone
+
+ return the bone object corresponding to this pose channel, read-only.
+
+ :type: :class:`BL_ArmatureBone`
+
+ .. attribute:: parent
+
+ return the parent channel object, None if root channel, read-only.
+
+ :type: :class:`BL_ArmatureChannel`
+
+ .. attribute:: has_ik
+
+ true if the bone is part of an active IK chain, read-only.
+ This flag is not set when an IK constraint is defined but not enabled (miss target information for example).
+
+ :type: boolean
+
+ .. attribute:: ik_dof_x
+
+ true if the bone is free to rotation in the X axis, read-only.
+
+ :type: boolean
+
+ .. attribute:: ik_dof_y
+
+ true if the bone is free to rotation in the Y axis, read-only.
+
+ :type: boolean
+
+ .. attribute:: ik_dof_z
+
+ true if the bone is free to rotation in the Z axis, read-only.
+
+ :type: boolean
+
+ .. attribute:: ik_limit_x
+
+ true if a limit is imposed on X rotation, read-only.
+
+ :type: boolean
+
+ .. attribute:: ik_limit_y
+
+ true if a limit is imposed on Y rotation, read-only.
+
+ :type: boolean
+
+ .. attribute:: ik_limit_z
+
+ true if a limit is imposed on Z rotation, read-only.
+
+ :type: boolean
+
+ .. attribute:: ik_rot_control
+
+ true if channel rotation should applied as IK constraint, read-only.
+
+ :type: boolean
+
+ .. attribute:: ik_lin_control
+
+ true if channel size should applied as IK constraint, read-only.
+
+ :type: boolean
+
+ .. attribute:: location
+
+ displacement of the bone head in armature local space, read-write.
+
+ :type: vector [X, Y, Z].
+
+ .. note::
+
+ You can only move a bone if it is unconnected to its parent. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
+
+ .. note::
+
+ Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`).
+
+ .. attribute:: scale
+
+ scale of the bone relative to its parent, read-write.
+
+ :type: vector [sizeX, sizeY, sizeZ].
+
+ .. note::
+
+ An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
+
+ .. note::
+
+ Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
+
+ .. attribute:: rotation_quaternion
+
+ rotation of the bone relative to its parent expressed as a quaternion, read-write.
+
+ :type: vector [qr, qi, qj, qk].
+
+ .. note::
+
+ This field is only used if rotation_mode is 0. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
+
+ .. note::
+
+ Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
+
+ .. attribute:: rotation_euler
+
+ rotation of the bone relative to its parent expressed as a set of euler angles, read-write.
+
+ :type: vector [X, Y, Z].
+
+ .. note::
+
+ This field is only used if rotation_mode is > 0. You must always pass the angles in [X, Y, Z] order; the order of applying the angles to the bone depends on rotation_mode. An action playing on the armature may change this field. An IK chain does not update this value, see joint_rotation.
+
+ .. note::
+
+ Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
+
+ .. attribute:: rotation_mode
+
+ Method of updating the bone rotation, read-write.
+
+ :type: integer
+
+ Use the following constants (euler mode are named as in Blender UI but the actual axis order is reversed).
+
+ * PCHAN_ROT_QUAT(0) : use quaternioin in rotation attribute to update bone rotation
+ * PCHAN_ROT_XYZ(1) : use euler_rotation and apply angles on bone's Z, Y, X axis successively
+ * PCHAN_ROT_XZY(2) : use euler_rotation and apply angles on bone's Y, Z, X axis successively
+ * PCHAN_ROT_YXZ(3) : use euler_rotation and apply angles on bone's Z, X, Y axis successively
+ * PCHAN_ROT_YZX(4) : use euler_rotation and apply angles on bone's X, Z, Y axis successively
+ * PCHAN_ROT_ZXY(5) : use euler_rotation and apply angles on bone's Y, X, Z axis successively
+ * PCHAN_ROT_ZYX(6) : use euler_rotation and apply angles on bone's X, Y, Z axis successively
+
+ .. attribute:: channel_matrix
+
+ pose matrix in bone space (deformation of the bone due to action, constraint, etc), Read-only.
+ This field is updated after the graphic render, it represents the current pose.
+
+ :type: matrix [4][4]
+
+ .. attribute:: pose_matrix
+
+ pose matrix in armature space, read-only,
+ This field is updated after the graphic render, it represents the current pose.
+
+ :type: matrix [4][4]
+
+ .. attribute:: pose_head
+
+ position of bone head in armature space, read-only.
+
+ :type: vector [x, y, z]
+
+ .. attribute:: pose_tail
+
+ position of bone tail in armature space, read-only.
+
+ :type: vector [x, y, z]
+
+ .. attribute:: ik_min_x
+
+ minimum value of X rotation in degree (<= 0) when X rotation is limited (see ik_limit_x), read-only.
+
+ :type: float
+
+ .. attribute:: ik_max_x
+
+ maximum value of X rotation in degree (>= 0) when X rotation is limited (see ik_limit_x), read-only.
+
+ :type: float
+
+ .. attribute:: ik_min_y
+
+ minimum value of Y rotation in degree (<= 0) when Y rotation is limited (see ik_limit_y), read-only.
+
+ :type: float
+
+ .. attribute:: ik_max_y
+
+ maximum value of Y rotation in degree (>= 0) when Y rotation is limited (see ik_limit_y), read-only.
+
+ :type: float
+
+ .. attribute:: ik_min_z
+
+ minimum value of Z rotation in degree (<= 0) when Z rotation is limited (see ik_limit_z), read-only.
+
+ :type: float
+
+ .. attribute:: ik_max_z
+
+ maximum value of Z rotation in degree (>= 0) when Z rotation is limited (see ik_limit_z), read-only.
+
+ :type: float
+
+ .. attribute:: ik_stiffness_x
+
+ bone rotation stiffness in X axis, read-only.
+
+ :type: float between 0 and 1
+
+ .. attribute:: ik_stiffness_y
+
+ bone rotation stiffness in Y axis, read-only.
+
+ :type: float between 0 and 1
+
+ .. attribute:: ik_stiffness_z
+
+ bone rotation stiffness in Z axis, read-only.
+
+ :type: float between 0 and 1
+
+ .. attribute:: ik_stretch
+
+ ratio of scale change that is allowed, 0=bone can't change size, read-only.
+
+ :type: float
+
+ .. attribute:: ik_rot_weight
+
+ weight of rotation constraint when ik_rot_control is set, read-write.
+
+ :type: float between 0 and 1
+
+ .. attribute:: ik_lin_weight
+
+ weight of size constraint when ik_lin_control is set, read-write.
+
+ :type: float between 0 and 1
+
+ .. attribute:: joint_rotation
+
+ Control bone rotation in term of joint angle (for robotic applications), read-write.
+
+ When writing to this attribute, you pass a [x, y, z] vector and an appropriate set of euler angles or quaternion is calculated according to the rotation_mode.
+
+ When you read this attribute, the current pose matrix is converted into a [x, y, z] vector representing the joint angles.
+
+ The value and the meaning of the x, y, z depends on the ik_dof_x/ik_dof_y/ik_dof_z attributes:
+
+ * 1DoF joint X, Y or Z: the corresponding x, y, or z value is used an a joint angle in radiant
+ * 2DoF joint X+Y or Z+Y: treated as 2 successive 1DoF joints: first X or Z, then Y. The x or z value is used as a joint angle in radiant along the X or Z axis, followed by a rotation along the new Y axis of y radiants.
+ * 2DoF joint X+Z: treated as a 2DoF joint with rotation axis on the X/Z plane. The x and z values are used as the coordinates of the rotation vector in the X/Z plane.
+ * 3DoF joint X+Y+Z: treated as a revolute joint. The [x, y, z] vector represents the equivalent rotation vector to bring the joint from the rest pose to the new pose.
+
+ :type: vector [x, y, z]
+
+ .. note::
+
+ The bone must be part of an IK chain if you want to set the ik_dof_x/ik_dof_y/ik_dof_z attributes via the UI, but this will interfere with this attribute since the IK solver will overwrite the pose. You can stay in control of the armature if you create an IK constraint but do not finalize it (e.g. don't set a target) the IK solver will not run but the IK panel will show up on the UI for each bone in the chain.
+
+ .. note::
+
+ [0, 0, 0] always corresponds to the rest pose.
+
+ .. note::
+
+ You must request the armature pose to update and wait for the next graphic frame to see the effect of setting this attribute (see :data:`BL_ArmatureObject.update`).
+
+ .. note::
+
+ You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute.
+
+.. class:: BL_ArmatureBone(PyObjectPlus)
+
+ Proxy to Blender bone structure. All fields are read-only and comply to RNA names.
+ All space attribute correspond to the rest pose.
+
+ .. attribute:: name
+
+ bone name.
+
+ :type: string
+
+ .. attribute:: connected
+
+ true when the bone head is struck to the parent's tail.
+
+ :type: boolean
+
+ .. attribute:: hinge
+
+ true when bone doesn't inherit rotation or scale from parent bone.
+
+ :type: boolean
+
+ .. attribute:: inherit_scale
+
+ true when bone inherits scaling from parent bone.
+
+ :type: boolean
+
+ .. attribute:: bbone_segments
+
+ number of B-bone segments.
+
+ :type: integer
+
+ .. attribute:: roll
+
+ bone rotation around head-tail axis.
+
+ :type: float
+
+ .. attribute:: head
+
+ location of head end of the bone in parent bone space.
+
+ :type: vector [x, y, z]
+
+ .. attribute:: tail
+
+ location of head end of the bone in parent bone space.
+
+ :type: vector [x, y, z]
+
+ .. attribute:: length
+
+ bone length.
+
+ :type: float
+
+ .. attribute:: arm_head
+
+ location of head end of the bone in armature space.
+
+ :type: vector [x, y, z]
+
+ .. attribute:: arm_tail
+
+ location of tail end of the bone in armature space.
+
+ :type: vector [x, y, z]
+
+ .. attribute:: arm_mat
+
+ matrix of the bone head in armature space.
+
+ :type: matrix [4][4]
+
+ .. note::
+
+ This matrix has no scale part.
+
+ .. attribute:: bone_mat
+
+ rotation matrix of the bone in parent bone space.
+
+ :type: matrix [3][3]
+
+ .. attribute:: parent
+
+ parent bone, or None for root bone.
+
+ :type: :class:`BL_ArmatureBone`
+
+ .. attribute:: children
+
+ list of bone's children.
+
+ :type: list of :class:`BL_ArmatureBone`
diff --git a/source/gameengine/Rasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/CMakeLists.txt
index 096b1583e3e..d718bf3e507 100644
--- a/source/gameengine/Rasterizer/CMakeLists.txt
+++ b/source/gameengine/Rasterizer/CMakeLists.txt
@@ -43,4 +43,3 @@ SET(INC
ADD_DEFINITIONS(-DGLEW_STATIC)
BLENDERLIB(bf_rasterizer "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['game','player'], priority=[35,115], compileflags = cflags )
diff --git a/source/gameengine/Rasterizer/Makefile b/source/gameengine/Rasterizer/Makefile
index a12d599b60b..d800a02b181 100644
--- a/source/gameengine/Rasterizer/Makefile
+++ b/source/gameengine/Rasterizer/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
@@ -49,10 +49,6 @@ CPPFLAGS += -I../Ketsji
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-ifeq ($(OS),darwin)
- CPPFLAGS += -fpascal-strings
-endif
-
###############
SOURCEDIR = source/gameengine/Rasterizer
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
index ae74705acff..4527850a8e9 100644
--- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
@@ -51,10 +51,6 @@
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "Value.h"
RAS_2DFilterManager::RAS_2DFilterManager():
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.h b/source/gameengine/Rasterizer/RAS_2DFilterManager.h
index 7ff7cde7882..9671f914fcd 100644
--- a/source/gameengine/Rasterizer/RAS_2DFilterManager.h
+++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.h
@@ -106,7 +106,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_2DFilterManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_2DFilterManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
index 4c22f4dcfc7..32fb1e31780 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
@@ -346,13 +346,21 @@ void RAS_BucketManager::RemoveMaterial(RAS_IPolyMaterial * mat)
//#include <stdio.h>
-void RAS_BucketManager::MergeBucketManager(RAS_BucketManager *other)
+void RAS_BucketManager::MergeBucketManager(RAS_BucketManager *other, SCA_IScene *scene)
{
/* concatinate lists */
// printf("BEFORE %d %d\n", GetSolidBuckets().size(), GetAlphaBuckets().size());
+ BucketList::iterator it;
+
+ for (it = other->GetSolidBuckets().begin(); it != other->GetSolidBuckets().end(); ++it)
+ (*it)->GetPolyMaterial()->Replace_IScene(scene);
+
GetSolidBuckets().insert( GetSolidBuckets().end(), other->GetSolidBuckets().begin(), other->GetSolidBuckets().end() );
other->GetSolidBuckets().clear();
+ for (it = other->GetAlphaBuckets().begin(); it != other->GetAlphaBuckets().end(); ++it)
+ (*it)->GetPolyMaterial()->Replace_IScene(scene);
+
GetAlphaBuckets().insert( GetAlphaBuckets().end(), other->GetAlphaBuckets().begin(), other->GetAlphaBuckets().end() );
other->GetAlphaBuckets().clear();
//printf("AFTER %d %d\n", GetSolidBuckets().size(), GetAlphaBuckets().size());
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h
index 0c871a87428..487df50802c 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.h
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.h
@@ -63,7 +63,7 @@ public:
void RemoveMaterial(RAS_IPolyMaterial * mat); // freeing scenes only
/* for merging */
- void MergeBucketManager(RAS_BucketManager *other);
+ void MergeBucketManager(RAS_BucketManager *other, SCA_IScene *scene);
BucketList & GetSolidBuckets() {return m_SolidBuckets;};
BucketList & GetAlphaBuckets() {return m_AlphaBuckets;};
@@ -85,7 +85,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_BucketManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_BucketManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h
index 396b6717144..17c2cb4695e 100644
--- a/source/gameengine/Rasterizer/RAS_Deformer.h
+++ b/source/gameengine/Rasterizer/RAS_Deformer.h
@@ -89,7 +89,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Deformer"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Deformer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.cpp b/source/gameengine/Rasterizer/RAS_FramingManager.cpp
index 1d5f4e674db..61734e89236 100644
--- a/source/gameengine/Rasterizer/RAS_FramingManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_FramingManager.cpp
@@ -29,10 +29,6 @@
#include "RAS_FramingManager.h"
#include "RAS_Rect.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void
RAS_FramingManager::
ComputeDefaultFrustum(
diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.h b/source/gameengine/Rasterizer/RAS_FramingManager.h
index c058c8cd3e8..aedac230cbe 100644
--- a/source/gameengine/Rasterizer/RAS_FramingManager.h
+++ b/source/gameengine/Rasterizer/RAS_FramingManager.h
@@ -161,7 +161,7 @@ private :
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FrameSettings"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FrameSettings"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -288,7 +288,7 @@ private :
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FramingManager"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FramingManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h
index 2ab06be26e7..826fe732b94 100644
--- a/source/gameengine/Rasterizer/RAS_ICanvas.h
+++ b/source/gameengine/Rasterizer/RAS_ICanvas.h
@@ -130,6 +130,26 @@ public:
GetHeight(
) const = 0;
+ virtual
+ int
+ GetMouseX( int x
+ )=0;
+
+ virtual
+ int
+ GetMouseY( int y
+ )= 0;
+
+ virtual
+ float
+ GetMouseNormalizedX( int x
+ )=0;
+
+ virtual
+ float
+ GetMouseNormalizedY( int y
+ )= 0;
+
virtual
const RAS_Rect &
GetDisplayArea(
@@ -172,16 +192,25 @@ public:
int y
)=0;
+ virtual
+ RAS_MouseState
+ GetMouseState()
+ {
+ return m_mousestate;
+ }
+
virtual
void
MakeScreenShot(
const char* filename
)=0;
+protected:
+ RAS_MouseState m_mousestate;
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ICanvas"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ICanvas"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
index b33d1e35062..0c81d7d8274 100644
--- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
+++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
@@ -32,10 +32,6 @@
#include "DNA_image_types.h"
#include "DNA_meshdata_types.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void RAS_IPolyMaterial::Initialize(
const STR_String& texname,
const STR_String& matname,
diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
index bcc8c32e54e..e7bd78c2309 100644
--- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
+++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
@@ -176,7 +176,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IPolyMaterial"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IPolyMaterial"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index 3ffbfcd5a8a..630a43daddc 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -414,7 +414,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRasterizer"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRasterizer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.h b/source/gameengine/Rasterizer/RAS_IRenderTools.h
index 0d89cb41e3c..50de4980e1d 100644
--- a/source/gameengine/Rasterizer/RAS_IRenderTools.h
+++ b/source/gameengine/Rasterizer/RAS_IRenderTools.h
@@ -180,7 +180,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRenderTools"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRenderTools"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h
index 0f7db93049d..c9ccac8e8a7 100644
--- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h
+++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h
@@ -176,7 +176,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshSlot"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshSlot"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -193,7 +193,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshMaterial"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshMaterial"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -252,7 +252,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MaterialBucket"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MaterialBucket"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h
index 87314a104d1..5a834bf26b0 100644
--- a/source/gameengine/Rasterizer/RAS_MeshObject.h
+++ b/source/gameengine/Rasterizer/RAS_MeshObject.h
@@ -171,7 +171,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshObject"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshObject"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
index 5d6f61ebfa1..cc48952dc20 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
@@ -44,4 +44,3 @@ SET(INC
ADD_DEFINITIONS(-DGLEW_STATIC)
BLENDERLIB(bf_oglrasterizer "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['game','player'], priority=[40, 120] )
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
index 0327714dc5f..357bdf9d99b 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
@@ -51,7 +51,3 @@ CPPFLAGS += -I../../SceneGraph
CPPFLAGS += -I..
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
-ifeq ($(OS),darwin)
- CPPFLAGS += -fpascal-strings
-endif
-
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
index d3c14b4758c..28c56b92c3c 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
@@ -72,7 +72,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ListRasterizer"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ListRasterizer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
index 6bbf65f72a4..7b516cb53a0 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
@@ -292,7 +292,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_OpenGLRasterizer"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_OpenGLRasterizer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
index f33a3b6913b..622ba852934 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
@@ -25,10 +25,6 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "RAS_VAOpenGLRasterizer.h"
#include <stdlib.h>
@@ -95,8 +91,8 @@ void RAS_VAOpenGLRasterizer::SetDrawingMode(int drawingmode)
void RAS_VAOpenGLRasterizer::Exit()
{
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h
index 92833d9b17d..96f6344b403 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h
@@ -61,7 +61,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_VAOpenGLRasterizer"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_VAOpenGLRasterizer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_Polygon.h b/source/gameengine/Rasterizer/RAS_Polygon.h
index 48fa4a206f0..8dc9813f5b9 100644
--- a/source/gameengine/Rasterizer/RAS_Polygon.h
+++ b/source/gameengine/Rasterizer/RAS_Polygon.h
@@ -93,7 +93,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Polygon"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Polygon"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_Rect.h b/source/gameengine/Rasterizer/RAS_Rect.h
index 828257dcecc..7a1d21b8905 100644
--- a/source/gameengine/Rasterizer/RAS_Rect.h
+++ b/source/gameengine/Rasterizer/RAS_Rect.h
@@ -96,7 +96,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Rect"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Rect"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_TexVert.h b/source/gameengine/Rasterizer/RAS_TexVert.h
index b74cfb47152..bdf2a6487ad 100644
--- a/source/gameengine/Rasterizer/RAS_TexVert.h
+++ b/source/gameengine/Rasterizer/RAS_TexVert.h
@@ -141,7 +141,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_TexVert"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_TexVert"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/Rasterizer/RAS_texmatrix.cpp b/source/gameengine/Rasterizer/RAS_texmatrix.cpp
index daa9db2a8c9..e69601fe091 100644
--- a/source/gameengine/Rasterizer/RAS_texmatrix.cpp
+++ b/source/gameengine/Rasterizer/RAS_texmatrix.cpp
@@ -28,10 +28,6 @@
#include "RAS_TexMatrix.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void RAS_CalcTexMatrix(RAS_TexVert p[3],MT_Point3& origin,MT_Vector3& udir,MT_Vector3& vdir)
{
// precondition: 3 vertices are non-colinear
diff --git a/source/gameengine/SceneGraph/CMakeLists.txt b/source/gameengine/SceneGraph/CMakeLists.txt
index 3242ec57d94..a73130531c0 100644
--- a/source/gameengine/SceneGraph/CMakeLists.txt
+++ b/source/gameengine/SceneGraph/CMakeLists.txt
@@ -32,4 +32,3 @@ SET(INC
)
BLENDERLIB(bf_scenegraph "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['game','player'], priority=[50,130] )
diff --git a/source/gameengine/SceneGraph/Makefile b/source/gameengine/SceneGraph/Makefile
index acec1b729e8..8a797ae5a0e 100644
--- a/source/gameengine/SceneGraph/Makefile
+++ b/source/gameengine/SceneGraph/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/SceneGraph/SG_BBox.h b/source/gameengine/SceneGraph/SG_BBox.h
index cc9dfc2db4e..1a65fc7ef6f 100644
--- a/source/gameengine/SceneGraph/SG_BBox.h
+++ b/source/gameengine/SceneGraph/SG_BBox.h
@@ -135,7 +135,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_BBox"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_BBox"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/SceneGraph/SG_Controller.cpp b/source/gameengine/SceneGraph/SG_Controller.cpp
index 6cecbe4c025..d2464b22608 100644
--- a/source/gameengine/SceneGraph/SG_Controller.cpp
+++ b/source/gameengine/SceneGraph/SG_Controller.cpp
@@ -29,10 +29,6 @@
#include "SG_Controller.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void
SG_Controller::
SetObject(SG_IObject* obj)
diff --git a/source/gameengine/SceneGraph/SG_Controller.h b/source/gameengine/SceneGraph/SG_Controller.h
index 6e44e05cb0b..b4636d5fa62 100644
--- a/source/gameengine/SceneGraph/SG_Controller.h
+++ b/source/gameengine/SceneGraph/SG_Controller.h
@@ -42,7 +42,7 @@ class SG_Controller
public:
#ifdef WITH_CXX_GUARDEDALLOC
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "SG_Controller"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "SG_Controller"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h
index 24b2fd6dee6..0768eaa5021 100644
--- a/source/gameengine/SceneGraph/SG_DList.h
+++ b/source/gameengine/SceneGraph/SG_DList.h
@@ -215,7 +215,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_DList"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_DList"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/SceneGraph/SG_IObject.cpp b/source/gameengine/SceneGraph/SG_IObject.cpp
index 03032e376af..38baf6994e2 100644
--- a/source/gameengine/SceneGraph/SG_IObject.cpp
+++ b/source/gameengine/SceneGraph/SG_IObject.cpp
@@ -29,10 +29,6 @@
#include "SG_IObject.h"
#include "SG_Controller.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SG_Stage gSG_Stage = SG_STAGE_UNKNOWN;
SG_IObject::
diff --git a/source/gameengine/SceneGraph/SG_IObject.h b/source/gameengine/SceneGraph/SG_IObject.h
index 2b9fb68adf5..4c9c31e4934 100644
--- a/source/gameengine/SceneGraph/SG_IObject.h
+++ b/source/gameengine/SceneGraph/SG_IObject.h
@@ -354,7 +354,7 @@ protected :
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_IObject"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_IObject"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/SceneGraph/SG_Node.cpp b/source/gameengine/SceneGraph/SG_Node.cpp
index 706568fc3fe..1d27dfa1388 100644
--- a/source/gameengine/SceneGraph/SG_Node.cpp
+++ b/source/gameengine/SceneGraph/SG_Node.cpp
@@ -30,10 +30,6 @@
#include "SG_ParentRelation.h"
#include <algorithm>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
using namespace std;
diff --git a/source/gameengine/SceneGraph/SG_Node.h b/source/gameengine/SceneGraph/SG_Node.h
index 5d2bac2b955..30d09b5bdfd 100644
--- a/source/gameengine/SceneGraph/SG_Node.h
+++ b/source/gameengine/SceneGraph/SG_Node.h
@@ -269,7 +269,7 @@ private:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Node"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Node"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/SceneGraph/SG_ParentRelation.h b/source/gameengine/SceneGraph/SG_ParentRelation.h
index 8097fbdb6bb..0bc04245c93 100644
--- a/source/gameengine/SceneGraph/SG_ParentRelation.h
+++ b/source/gameengine/SceneGraph/SG_ParentRelation.h
@@ -131,7 +131,7 @@ protected :
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_ParentRelation"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_ParentRelation"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/SceneGraph/SG_QList.h b/source/gameengine/SceneGraph/SG_QList.h
index 9f49060b302..691ec9e1262 100644
--- a/source/gameengine/SceneGraph/SG_QList.h
+++ b/source/gameengine/SceneGraph/SG_QList.h
@@ -155,7 +155,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_QList"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_QList"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/SceneGraph/SG_Spatial.cpp b/source/gameengine/SceneGraph/SG_Spatial.cpp
index d88bb68351d..f93dbfd4ebe 100644
--- a/source/gameengine/SceneGraph/SG_Spatial.cpp
+++ b/source/gameengine/SceneGraph/SG_Spatial.cpp
@@ -32,10 +32,6 @@
#include "SG_Controller.h"
#include "SG_ParentRelation.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
SG_Spatial::
SG_Spatial(
void* clientobj,
diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h
index 372a1f6d977..b8193806ecb 100644
--- a/source/gameengine/SceneGraph/SG_Spatial.h
+++ b/source/gameengine/SceneGraph/SG_Spatial.h
@@ -286,7 +286,7 @@ protected:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Spatial"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Spatial"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/SceneGraph/SG_Tree.h b/source/gameengine/SceneGraph/SG_Tree.h
index 041f34a5bc6..fa6facde66c 100644
--- a/source/gameengine/SceneGraph/SG_Tree.h
+++ b/source/gameengine/SceneGraph/SG_Tree.h
@@ -115,7 +115,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Tree"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Tree"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -158,7 +158,7 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC
public:
- void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_TreeFactory"); }
+ void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_TreeFactory"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt
index eaee00753ff..3af514ca0de 100644
--- a/source/gameengine/VideoTexture/CMakeLists.txt
+++ b/source/gameengine/VideoTexture/CMakeLists.txt
@@ -64,4 +64,3 @@ ELSE(WITH_PYTHON)
ENDIF(WITH_PYTHON)
BLENDERLIB(bf_videotex "${SRC}" "${INC}")
-#env.BlenderLib ( 'bf_videotex', sources, Split(incs), [], libtype=['game','player'], priority=[25, 72], compileflags = cflags )
diff --git a/source/gameengine/VideoTexture/ImageBase.cpp b/source/gameengine/VideoTexture/ImageBase.cpp
index 31c634b1511..88a20fadcf7 100644
--- a/source/gameengine/VideoTexture/ImageBase.cpp
+++ b/source/gameengine/VideoTexture/ImageBase.cpp
@@ -650,7 +650,7 @@ int Image_getbuffer(PyImage *self, Py_buffer *view, int flags)
catch (Exception & exp)
{
// cannot return -1, this creates a crash in Python, for now we will just return an empty buffer
- //exp.report();
+ exp.report();
//return -1;
goto error;
}
@@ -676,7 +676,7 @@ error:
// Return a empty buffer to avoid a crash in Python 3.1
// The bug is fixed in Python SVN 77916, as soon as the python revision used by Blender is
// updated, you can simply return -1 and set the error
- static char* buf = "";
+ static char* buf = (char *)"";
ret = PyBuffer_FillInfo(view, (PyObject*)self, buf, 0, 0, flags);
if (ret >= 0)
self->m_image->m_exports++;
diff --git a/source/gameengine/VideoTexture/ImageBuff.cpp b/source/gameengine/VideoTexture/ImageBuff.cpp
index 0bb0cf59511..926468c662e 100644
--- a/source/gameengine/VideoTexture/ImageBuff.cpp
+++ b/source/gameengine/VideoTexture/ImageBuff.cpp
@@ -128,7 +128,7 @@ void ImageBuff::clear (short width, short height, unsigned char color)
memset(m_image, color, size*4);
// and change the alpha channel
p = &((unsigned char*)m_image)[3];
- for (size; size>0; size--)
+ for (; size>0; size--)
{
*p = 0xFF;
p += 4;
diff --git a/source/gameengine/VideoTexture/Makefile b/source/gameengine/VideoTexture/Makefile
index 1cb147860cd..af3417eef02 100644
--- a/source/gameengine/VideoTexture/Makefile
+++ b/source/gameengine/VideoTexture/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
index 290af8e63c5..5a80522ea7d 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
@@ -23,7 +23,9 @@ http://www.gnu.org/copyleft/lesser.txt.
#ifdef WITH_FFMPEG
// INT64_C fix for some linux machines (C99ism)
+#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
+#endif
#include <stdint.h>
@@ -937,7 +939,6 @@ AVFrame *VideoFFmpeg::grabFrame(long position)
if (position != m_curPosition + 1)
{
int64_t pos = (int64_t)((position - m_preseek) / (m_baseFrameRate*timeBase));
- int seekres;
if (pos < 0)
pos = 0;
diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp
index 01e783edc10..5cb50900c89 100644
--- a/source/gameengine/VideoTexture/blendVideoTex.cpp
+++ b/source/gameengine/VideoTexture/blendVideoTex.cpp
@@ -206,7 +206,7 @@ PyObject* initVideoTexture(void)
PyModule_AddObject(m, (char*)"Texture", (PyObject*)&TextureType);
// init last error description
- Exception::m_lastError[0] = '\0';
+ Exception::m_lastError = "";
return m;
}