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:
authorNick Samarin <nicks1987@bigmir.net>2010-07-14 11:35:39 +0400
committerNick Samarin <nicks1987@bigmir.net>2010-07-14 11:35:39 +0400
commit81021db4f9ccd75f57401c030e7b18eba442b589 (patch)
tree35c295624319a1524606935d18dda75498bae545 /source/gameengine
parent852b84745c60c6b82ededbe00c4906ca8d2f5944 (diff)
parent64091ff5bd6258cd05cf4b1d96da22cb3aef6976 (diff)
synched with trunk at revision 30243
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp55
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderCanvas.h2
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h4
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h4
-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.h2
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp2
-rw-r--r--source/gameengine/Converter/BL_DeformableGameObject.h2
-rw-r--r--source/gameengine/Converter/BL_MeshDeformer.h2
-rw-r--r--source/gameengine/Converter/BL_ModifierDeformer.h2
-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.h2
-rw-r--r--source/gameengine/Converter/KX_BlenderScalarInterpolator.h4
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp9
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.h2
-rw-r--r--source/gameengine/Converter/KX_SoftBodyDeformer.h2
-rw-r--r--source/gameengine/Expressions/BoolValue.h2
-rw-r--r--source/gameengine/Expressions/ConstExpr.h2
-rw-r--r--source/gameengine/Expressions/EmptyValue.h2
-rw-r--r--source/gameengine/Expressions/ErrorValue.h2
-rw-r--r--source/gameengine/Expressions/Expression.h4
-rw-r--r--source/gameengine/Expressions/FloatValue.h2
-rw-r--r--source/gameengine/Expressions/IdentifierExpr.h2
-rw-r--r--source/gameengine/Expressions/IfExpr.h2
-rw-r--r--source/gameengine/Expressions/InputParser.h2
-rw-r--r--source/gameengine/Expressions/IntValue.h2
-rw-r--r--source/gameengine/Expressions/KX_HashedPtr.h2
-rw-r--r--source/gameengine/Expressions/Operator1Expr.h2
-rw-r--r--source/gameengine/Expressions/Operator2Expr.h2
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h13
-rw-r--r--source/gameengine/Expressions/StringValue.h2
-rw-r--r--source/gameengine/Expressions/Value.h4
-rw-r--r--source/gameengine/Expressions/VectorValue.h2
-rw-r--r--source/gameengine/Expressions/VoidValue.h2
-rw-r--r--source/gameengine/GameLogic/SCA_ActuatorEventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_AlwaysEventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_BasicEventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_EventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_ExpressionController.h2
-rw-r--r--source/gameengine/GameLogic/SCA_IActuator.h2
-rw-r--r--source/gameengine/GameLogic/SCA_IInputDevice.h4
-rw-r--r--source/gameengine/GameLogic/SCA_IScene.h2
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_LogicManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_MouseManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_PropertyEventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_PythonMouse.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_RandomEventManager.h2
-rw-r--r--source/gameengine/GameLogic/SCA_RandomNumberGenerator.h2
-rw-r--r--source/gameengine/GameLogic/SCA_TimeEventManager.h2
-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.h6
-rw-r--r--source/gameengine/Ketsji/BL_Texture.h2
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.h6
-rw-r--r--source/gameengine/Ketsji/KX_BulletPhysicsController.h2
-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_Dome.h2
-rw-r--r--source/gameengine/Ketsji/KX_EmptyObject.h2
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp7
-rw-r--r--source/gameengine/Ketsji/KX_IInterpolator.h2
-rw-r--r--source/gameengine/Ketsji/KX_IPO_SGController.h2
-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_KetsjiEngine.h2
-rw-r--r--source/gameengine/Ketsji/KX_LightIpoSGController.h2
-rw-r--r--source/gameengine/Ketsji/KX_MaterialIpoController.h2
-rw-r--r--source/gameengine/Ketsji/KX_MotionState.h2
-rw-r--r--source/gameengine/Ketsji/KX_ObColorIpoSGController.h2
-rw-r--r--source/gameengine/Ketsji/KX_ObjectActuator.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_OrientationInterpolator.h2
-rw-r--r--source/gameengine/Ketsji/KX_PolygonMaterial.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_PolygonMaterial.h1
-rw-r--r--source/gameengine/Ketsji/KX_PositionInterpolator.h2
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp43
-rw-r--r--source/gameengine/Ketsji/KX_RayCast.h4
-rw-r--r--source/gameengine/Ketsji/KX_RayEventManager.h2
-rw-r--r--source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h2
-rw-r--r--source/gameengine/Ketsji/KX_SG_NodeRelationships.h6
-rw-r--r--source/gameengine/Ketsji/KX_ScalarInterpolator.h2
-rw-r--r--source/gameengine/Ketsji/KX_ScalingInterpolator.h2
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_Scene.h4
-rw-r--r--source/gameengine/Ketsji/KX_TimeCategoryLogger.h2
-rw-r--r--source/gameengine/Ketsji/KX_TimeLogger.h2
-rw-r--r--source/gameengine/Ketsji/KX_TouchEventManager.h2
-rw-r--r--source/gameengine/Ketsji/KX_WorldInfo.h2
-rw-r--r--source/gameengine/Ketsji/KX_WorldIpoController.h2
-rw-r--r--source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.cpp5
-rw-r--r--source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.h8
-rw-r--r--source/gameengine/Network/NG_NetworkDeviceInterface.h8
-rw-r--r--source/gameengine/Network/NG_NetworkMessage.h2
-rw-r--r--source/gameengine/Network/NG_NetworkObject.h2
-rw-r--r--source/gameengine/Network/NG_NetworkScene.h2
-rw-r--r--source/gameengine/Network/TerraplayNetwork/NG_TerraplayNetworkDeviceInterface.h2
-rw-r--r--source/gameengine/Physics/Bullet/CcdGraphicController.h2
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.h6
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h2
-rw-r--r--source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h2
-rw-r--r--source/gameengine/Physics/common/PHY_IController.h2
-rw-r--r--source/gameengine/Physics/common/PHY_IGraphicController.h2
-rw-r--r--source/gameengine/Physics/common/PHY_IMotionState.h2
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsController.h2
-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/bge.events.rst69
-rw-r--r--source/gameengine/PyDoc/bge.logic.rst572
-rw-r--r--source/gameengine/PyDoc/bge.render.rst11
-rw-r--r--source/gameengine/PyDoc/bge.types.rst2511
-rw-r--r--source/gameengine/Rasterizer/Makefile4
-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.h4
-rw-r--r--source/gameengine/Rasterizer/RAS_ICanvas.h2
-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/Makefile4
-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.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/SceneGraph/SG_BBox.h2
-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.h2
-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.h2
-rw-r--r--source/gameengine/SceneGraph/SG_Tree.h4
-rw-r--r--source/gameengine/VideoTexture/ImageBase.cpp4
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.cpp3
-rw-r--r--source/gameengine/VideoTexture/blendVideoTex.cpp2
146 files changed, 2418 insertions, 1236 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index 5b7ceaa296c..a83ec7e132f 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -84,6 +84,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"
@@ -120,7 +121,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);
@@ -133,7 +134,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;
@@ -166,7 +167,9 @@ 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 */
@@ -218,12 +221,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
@@ -244,7 +247,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 {
@@ -315,22 +318,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)
@@ -359,19 +362,19 @@ 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
@@ -381,13 +384,13 @@ 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_set3DSetting(AUD_3DS_SPEED_OF_SOUND, scene->audio.speed_of_sound);
+ AUD_set3DSetting(AUD_3DS_DOPPLER_FACTOR, scene->audio.doppler_factor);
+ AUD_set3DSetting(AUD_3DS_DISTANCE_MODEL, scene->audio.distance_model);
if (sceneconverter)
{
@@ -503,8 +506,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
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
index 0d80bdee055..42f956cafcd 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
@@ -192,7 +192,7 @@ private:
#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_BlenderInputDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
index 67cd901a0e5..5bdf0ccd81d 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
@@ -234,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.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.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.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/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 0ade452fae2..832e33cb4b6 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -1551,7 +1551,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:
{
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.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.h b/source/gameengine/Converter/BL_ModifierDeformer.h
index adf537110f1..6e0ede8e62f 100644
--- a/source/gameengine/Converter/BL_ModifierDeformer.h
+++ b/source/gameengine/Converter/BL_ModifierDeformer.h
@@ -105,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_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.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/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..0575c55846b 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -752,22 +752,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();
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_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/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/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/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.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.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.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.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.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.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.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.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/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.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.h b/source/gameengine/Expressions/PyObjectPlus.h
index e19f4800ca5..7afa85c8c31 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -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
@@ -466,16 +466,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.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.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.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/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_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_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_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.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.h b/source/gameengine/GameLogic/SCA_IActuator.h
index 3d2f5189c01..2ed110ec626 100644
--- a/source/gameengine/GameLogic/SCA_IActuator.h
+++ b/source/gameengine/GameLogic/SCA_IActuator.h
@@ -158,7 +158,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_IInputDevice.h b/source/gameengine/GameLogic/SCA_IInputDevice.h
index a72c48a57e9..a13efee1316 100644
--- a/source/gameengine/GameLogic/SCA_IInputDevice.h
+++ b/source/gameengine/GameLogic/SCA_IInputDevice.h
@@ -316,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_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_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_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_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.h b/source/gameengine/GameLogic/SCA_MouseManager.h
index 0e7dfa2a284..8bf060537ca 100644
--- a/source/gameengine/GameLogic/SCA_MouseManager.h
+++ b/source/gameengine/GameLogic/SCA_MouseManager.h
@@ -67,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_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_PythonMouse.cpp b/source/gameengine/GameLogic/SCA_PythonMouse.cpp
index b2bb68f020e..041a0169879 100644
--- a/source/gameengine/GameLogic/SCA_PythonMouse.cpp
+++ b/source/gameengine/GameLogic/SCA_PythonMouse.cpp
@@ -32,8 +32,8 @@
SCA_PythonMouse::SCA_PythonMouse(SCA_IInputDevice* mouse, RAS_ICanvas* canvas)
: PyObjectPlus(),
-m_canvas(canvas),
-m_mouse(mouse)
+m_mouse(mouse),
+m_canvas(canvas)
{
}
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.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_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/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.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/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h
index c5f5e23c6e7..5bf62ff6b7c 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.h
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h
@@ -88,7 +88,11 @@ 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
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_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_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.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_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index e6a365c5729..dea85f87da8 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -1345,7 +1345,8 @@ static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype)
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;
@@ -1386,9 +1387,7 @@ static int mathutils_kxgameob_vector_set_index(BaseMathObject *bmo, int subtype,
return 0;
bmo->data[index]= f;
- mathutils_kxgameob_vector_set(bmo, subtype);
-
- return 1;
+ return mathutils_kxgameob_vector_set(bmo, subtype);
}
Mathutils_Callback mathutils_kxgameob_vector_cb = {
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.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.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_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h
index b3549c5fdab..0a461a8b63e 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.h
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h
@@ -412,7 +412,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_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.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_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_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 dff95551d70..0d0cac3c084 100644
--- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
@@ -445,9 +445,7 @@ static int mathutils_obactu_vector_set_index(BaseMathObject *bmo, int subtype, i
return 0;
bmo->data[index]= f;
- mathutils_obactu_vector_set(bmo, subtype);
-
- return 1;
+ return mathutils_obactu_vector_set(bmo, subtype);
}
Mathutils_Callback mathutils_obactu_vector_cb = {
@@ -469,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;
}
@@ -483,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.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_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
index 98544cdc925..dacc74f139f 100644
--- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
@@ -115,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);
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.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_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 4fbc63150ae..f82609d8bef 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -121,18 +121,21 @@ extern "C" {
#include "BLO_readfile.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)
{
@@ -1317,6 +1320,7 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
KX_MACRO_addTypesToDict(d, KX_PROPSENSOR_EXPRESSION, SCA_PropertySensor::KX_PROPSENSOR_EXPRESSION);
/* 3. Constraint actuator */
+ /* XXX, TODO NXBGE, move constants names from KX_ACT_CONSTRAINT_foo to KX_CONSTRAINTACT_foo */
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCX);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCY);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCZ);
@@ -1325,10 +1329,10 @@ 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);
@@ -1338,6 +1342,12 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
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_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);
/* 4. Ipo actuator, simple part */
KX_MACRO_addTypesToDict(d, KX_IPOACT_PLAY, KX_IpoActuator::KX_ACT_IPO_PLAY);
@@ -1476,6 +1486,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);
@@ -1491,7 +1502,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);
@@ -1499,18 +1511,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);
@@ -1708,7 +1714,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);
@@ -1835,7 +1841,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;
}
@@ -1990,10 +1996,7 @@ void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene* startscene, Main *
initGeometry();
initBGL();
initBLF();
-
-#ifdef WITH_FFMPEG
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'), 'events':__import__('GameKeys'), 'constraints':__import__('PhysicsConstraints'), 'types':__import__('GameTypes')}) is None][0]");
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.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_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.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.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.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 c7398e8e3ee..950b1ea793d 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1772,7 +1772,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);
diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h
index 9924262fc70..ca286b87e63 100644
--- a/source/gameengine/Ketsji/KX_Scene.h
+++ b/source/gameengine/Ketsji/KX_Scene.h
@@ -85,6 +85,10 @@ class KX_BlenderSceneConverter;
struct KX_ClientObjectInfo;
class KX_ObstacleSimulation;
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
/* for ID freeing */
#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->flag & LIB_DOIT))
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.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.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_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.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/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.cpp b/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.cpp
index 6556219413e..5ac49883e91 100644
--- a/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.cpp
+++ b/source/gameengine/Network/LoopBackNetwork/NG_LoopBackNetworkDeviceInterface.cpp
@@ -63,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/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.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.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.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/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/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.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/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/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.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.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.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.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/bge.events.rst b/source/gameengine/PyDoc/bge.events.rst
index 486844f97bf..f642291fe97 100644
--- a/source/gameengine/PyDoc/bge.events.rst
+++ b/source/gameengine/PyDoc/bge.events.rst
@@ -2,6 +2,10 @@
Game Engine bge.events module
=============================
+*****
+Intro
+*****
+
This module holds key constants for the SCA_KeyboardSensor.
.. module:: bge.events
@@ -37,6 +41,10 @@ This module holds key constants for the SCA_KeyboardSensor.
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.
@@ -55,8 +63,33 @@ This module holds key constants for the SCA_KeyboardSensor.
: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
-**Alphabet keys**
+.. _keyboard-keys:
+
+=============
+Keyboard Keys
+=============
+
+-------------
+Alphabet keys
+-------------
.. data:: AKEY
.. data:: BKEY
@@ -85,7 +118,9 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: YKEY
.. data:: ZKEY
-**Number keys**
+-----------
+Number keys
+-----------
.. data:: ZEROKEY
.. data:: ONEKEY
@@ -98,7 +133,9 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: EIGHTKEY
.. data:: NINEKEY
-**Modifiers**
+--------------
+Modifiers Keys
+--------------
.. data:: CAPSLOCKKEY
.. data:: LEFTCTRLKEY
@@ -108,14 +145,18 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: RIGHTSHIFTKEY
.. data:: LEFTSHIFTKEY
-**Arrow Keys**
+----------
+Arrow Keys
+----------
.. data:: LEFTARROWKEY
.. data:: DOWNARROWKEY
.. data:: RIGHTARROWKEY
.. data:: UPARROWKEY
-**Numberpad Keys**
+--------------
+Numberpad Keys
+--------------
.. data:: PAD0
.. data:: PAD1
@@ -134,7 +175,9 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: PADENTER
.. data:: PADPLUSKEY
-**Function Keys**
+-------------
+Function Keys
+-------------
.. data:: F1KEY
.. data:: F2KEY
@@ -156,7 +199,9 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: F18KEY
.. data:: F19KEY
-**Other Keys**
+----------
+Other Keys
+----------
.. data:: ACCENTGRAVEKEY
.. data:: BACKSLASHKEY
@@ -182,13 +227,3 @@ This module holds key constants for the SCA_KeyboardSensor.
.. data:: SLASHKEY
.. data:: SPACEKEY
.. data:: TABKEY
-
-**Mouse Events**
-
-.. data:: LEFTMOUSE
-.. data:: MIDDLEMOUSE
-.. data:: RIGHTMOUSE
-.. data:: WHEELUPMOUSE
-.. data:: WHEELDOWNMOUSE
-.. data:: MOUSEX
-.. data:: MOUSEY
diff --git a/source/gameengine/PyDoc/bge.logic.rst b/source/gameengine/PyDoc/bge.logic.rst
index 4f9b94a7340..84b480e2ab9 100644
--- a/source/gameengine/PyDoc/bge.logic.rst
+++ b/source/gameengine/PyDoc/bge.logic.rst
@@ -1,7 +1,10 @@
Game Engine bge.logic Module
============================
-
+*****
+Intro
+*****
+
Module to access logic functions, imported automatically into the python controllers namespace.
.. module:: bge.logic
@@ -14,7 +17,7 @@ Module to access logic functions, imported automatically into the python control
# 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
+: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
@@ -30,18 +33,21 @@ Module to access logic functions, imported automatically into the python control
See the sensor's reference for available methods:
-* :class:`bge.types.SCA_DelaySensor`
-* :class:`bge.types.SCA_JoystickSensor`
-* :class:`bge.types.SCA_KeyboardSensor`
-* :class:`bge.types.KX_MouseFocusSensor`
-* :class:`bge.types.SCA_MouseSensor`
-* :class:`bge.types.KX_NearSensor`
-* :class:`bge.types.KX_NetworkMessageSensor`
-* :class:`bge.types.SCA_PropertySensor`
-* :class:`bge.types.KX_RadarSensor`
-* :class:`bge.types.SCA_RandomSensor`
-* :class:`bge.types.KX_RaySensor`
-* :class:`bge.types.KX_TouchSensor`
+.. 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
@@ -56,30 +62,32 @@ You can also access actuators linked to the controller
# Activate an actuator
controller.activate(actuator)
-
See the actuator's reference for available methods
-* :class:`bge.types.SCA_2DFilterActuator`
-* :class:`bge.types.BL_ActionActuator`
-* :class:`bge.types.KX_SCA_AddObjectActuator`
-* :class:`bge.types.KX_CameraActuator`
-* :class:`bge.types.KX_ConstraintActuator`
-* :class:`bge.types.KX_SCA_DynamicActuator`
-* :class:`bge.types.KX_SCA_EndObjectActuator`
-* :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.SCA_PropertyActuator`
-* :class:`bge.types.SCA_RandomActuator`
-* :class:`bge.types.KX_SCA_ReplaceMeshActuator`
-* :class:`bge.types.KX_SceneActuator`
-* :class:`bge.types.BL_ShapeActionActuator`
-* :class:`bge.types.KX_SoundActuator`
-* :class:`bge.types.KX_StateActuator`
-* :class:`bge.types.KX_TrackToActuator`
-* :class:`bge.types.KX_VisibilityActuator`
+.. 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.
@@ -99,16 +107,28 @@ Matricies as used by the game engine are **row major**
: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 expectred.
+ .. 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
-.. data:: keyboard: The current keyboard wrapped in an SCA_PythonKeyboard object.
-.. data:: mouse: The current mouse wrapped in an SCA_PythonMouse object.
+ The current mouse wrapped in an :class:`~bge.types.SCA_PythonMouse` object.
+
+*****************
+General functions
+*****************
.. function:: getCurrentController()
@@ -258,15 +278,9 @@ Matricies as used by the game engine are **row major**
Loads bge.logic.globalDict from a file.
-
+*****************
Utility functions
-
-.. function:: getAverageFrameRate()
-
- Gets the estimated average framerate
-
- :return: The estimed average framerate in frames per second
- :rtype: float
+*****************
.. function:: expandPath(path)
@@ -283,6 +297,12 @@ Utility functions
: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 = "//")
@@ -293,20 +313,42 @@ Utility functions
: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
+*********
-.. function:: getRandomFloat()
+.. data:: KX_TRUE
- Returns a random floating point value in the range [0 - 1)
+ True value used by some modules.
-=========
-Constants
-=========
+.. data:: KX_FALSE
+
+ False value used by some modules.
-.. 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
@@ -316,42 +358,232 @@ Property Sensor
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
+ 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
-------------------
-See :class:`bge.types.KX_ConstraintActuator`
+.. _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
------------
@@ -365,6 +597,15 @@ See :class:`bge.types.KX_IpoActuator`
.. data:: KX_IPOACT_LOOPEND
.. data:: KX_IPOACT_FROM_PROP
+---------------
+Parent Actuator
+---------------
+
+.. data:: KX_PARENT_REMOVE
+.. data:: KX_PARENT_SET
+
+.. _logic-random-distributions:
+
--------------------
Random Distributions
--------------------
@@ -382,9 +623,26 @@ See :class:`bge.types.SCA_RandomActuator`
.. data:: KX_RANDOMACT_FLOAT_NORMAL
.. data:: KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL
----------------
-Action Actuator
----------------
+--------------
+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`
@@ -394,90 +652,50 @@ See :class:`bge.types.BL_ActionActuator`
.. data:: KX_ACTIONACT_LOOPEND
.. data:: KX_ACTIONACT_PROPERTY
+.. _logic-sound-actuator:
+
--------------
Sound Actuator
--------------
-
+
See :class:`bge.types.KX_SoundActuator`
.. data:: KX_SOUNDACT_PLAYSTOP
-.. data:: KX_SOUNDACT_PLAYEND
-.. data:: KX_SOUNDACT_LOOPSTOP
-.. data:: KX_SOUNDACT_LOOPEND
-.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL
-.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP
-
-------------
-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
-
-----------------
-Dynamic Actuator
-----------------
-See :class:`bge.types.KX_SCA_DynamicActuator`
+ :value: 1
+
+.. data:: KX_SOUNDACT_PLAYEND
-.. 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
+ :value: 2
+
+.. data:: KX_SOUNDACT_LOOPSTOP
--------------
-Game Actuator
--------------
+ :value: 3
+
+.. data:: KX_SOUNDACT_LOOPEND
-See :class:`bge.types.KX_GameActuator`
+ :value: 4
+
+.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL
-.. data:: KX_GAME_LOAD
-.. data:: KX_GAME_START
-.. data:: KX_GAME_RESTART
-.. data:: KX_GAME_QUIT
-.. data:: KX_GAME_SAVECFG
-.. data:: KX_GAME_LOADCFG
+ :value: 5
+
+.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP
---------------
-Scene Actuator
---------------
+ :value: 6
+
-See :class:`bge.types.KX_SceneActuator`
+=======
+Various
+=======
-.. 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
+.. _input-status:
------------
Input Status
------------
-See :class:`bge.types.SCA_MouseSensor`
+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
@@ -530,55 +748,111 @@ See :class:`bge.types.KX_StateActuator`
.. 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
-.. data:: RAS_2DFILTER_PREWITT
-.. data:: RAS_2DFILTER_SEPIA
-.. data:: RAS_2DFILTER_SHARPEN
-.. data:: RAS_2DFILTER_SOBEL
--------------------
-Constraint Actuator
--------------------
+ Disable and destroy the filter that is currently active
-.. data:: KX_ACT_CONSTRAINT_DISTANCE
-.. data:: KX_ACT_CONSTRAINT_DOROTFH
-.. data:: KX_ACT_CONSTRAINT_FHNX
-.. data:: KX_ACT_CONSTRAINT_FHNY
-.. data:: KX_ACT_CONSTRAINT_FHNZ
-.. data:: KX_ACT_CONSTRAINT_FHPX
-.. data:: KX_ACT_CONSTRAINT_FHPY
-.. data:: KX_ACT_CONSTRAINT_FHPZ
-.. data:: KX_ACT_CONSTRAINT_LOCAL
-.. data:: KX_ACT_CONSTRAINT_MATERIAL
-.. data:: KX_ACT_CONSTRAINT_NORMAL
-.. data:: KX_ACT_CONSTRAINT_PERMANENT
+ :value: 0
+
+.. data:: RAS_2DFILTER_PREWITT
----------------
-Parent Actuator
----------------
+ :value: 8
+
+.. data:: RAS_2DFILTER_SEPIA
-.. data:: KX_PARENT_REMOVE
-.. data:: KX_PARENT_SET
+ :value: 10
+
+.. data:: RAS_2DFILTER_SHARPEN
+ :value: 3
+
+.. data:: RAS_2DFILTER_SOBEL
+
+ :value: 7
+
------
Shader
------
diff --git a/source/gameengine/PyDoc/bge.render.rst b/source/gameengine/PyDoc/bge.render.rst
index 01e5a7cd387..cea84f3b506 100644
--- a/source/gameengine/PyDoc/bge.render.rst
+++ b/source/gameengine/PyDoc/bge.render.rst
@@ -2,6 +2,10 @@
Game Engine bge.render Module
=============================
+*****
+Intro
+*****
+
.. module:: bge.render
.. code-block:: python
@@ -41,6 +45,9 @@ Game Engine bge.render Module
# Centre the mouse
bge.render.setMousePosition(bge.render.getWindowWidth()/2, bge.render.getWindowHeight()/2)
+*********
+Constants
+*********
.. data:: KX_TEXFACE_MATERIAL
@@ -54,6 +61,10 @@ Game Engine bge.render Module
Materials approximating blender materials with GLSL.
+*********
+Functions
+*********
+
.. function:: getWindowWidth()
Gets the width of the window (in pixels)
diff --git a/source/gameengine/PyDoc/bge.types.rst b/source/gameengine/PyDoc/bge.types.rst
index e0119c7c4a7..935d3e7e00e 100644
--- a/source/gameengine/PyDoc/bge.types.rst
+++ b/source/gameengine/PyDoc/bge.types.rst
@@ -11,14 +11,14 @@ Game Engine bge.types Module
.. 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* bool
+ :type: boolean
.. method:: isA(game_type)
@@ -27,7 +27,7 @@ Game Engine bge.types Module
: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: bool
+ :rtype: boolean
.. class:: CValue(PyObjectPlus)
@@ -35,8 +35,10 @@ Game Engine bge.types Module
.. attribute:: name
- The name of this CValue derived object (read-only). **type** string
+ The name of this CValue derived object (read-only).
+ :type: string
+
.. class:: CPropValue(CValue)
This class has no python functions
@@ -49,15 +51,19 @@ Game Engine bge.types Module
This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first).
- *type* executePriority: int
+ :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.
+ 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
+ The name of this logic brick (read-only).
+
+ :type: string
.. class:: SCA_PythonKeyboard(PyObjectPlus)
@@ -67,14 +73,7 @@ Game Engine bge.types Module
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 :mod:`bge.keys`.
- * 'status' uses...
- * :mod:`bge.logic.KX_INPUT_NONE`
- * :mod:`bge.logic.KX_INPUT_JUST_ACTIVATED`
- * :mod:`bge.logic.KX_INPUT_ACTIVE`
- * :mod:`bge.logic.KX_INPUT_JUST_RELEASED`
-
- *type* list [[keycode, status], ...]
+ :type: list [[:ref:`keycode<keyboard-keys>`, :ref:`status<input-status>`], ...]
.. class:: SCA_PythonMouse(PyObjectPlus)
@@ -84,22 +83,19 @@ Game Engine bge.types Module
a list of pressed buttons that have either been pressed, or just released, or are active this frame. (read-only).
- * 'keycode' matches the values in :mod:`bge.keys`.
- * 'status' uses...
- * :mod:`bge.logic.KX_INPUT_NONE`
- * :mod:`bge.logic.KX_INPUT_JUST_ACTIVATED`
- * :mod:`bge.logic.KX_INPUT_ACTIVE`
- * :mod:`bge.logic.KX_INPUT_JUST_RELEASED`
-
- *type* list [[keycode, status], ...]
-
+ :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]
+ The normalized x and y position of the mouse cursor.
+
+ :type: list [x, y]
.. attribute:: visible
- The visibility of the mouse cursor. **type** boolean
+ The visibility of the mouse cursor.
+
+ :type: boolean
.. class:: SCA_IObject(CValue)
@@ -111,15 +107,21 @@ Game Engine bge.types Module
.. attribute:: usePosPulseMode
- Flag to turn positive pulse mode on and off. **type** boolean
+ Flag to turn positive pulse mode on and off.
+
+ :type: boolean
.. attribute:: useNegPulseMode
- Flag to turn negative pulse mode on and off. **type** boolean
+ Flag to turn negative pulse mode on and off.
+
+ :type: boolean
.. attribute:: frequency
- The frequency for pulse mode sensors. **type** integer
+ The frequency for pulse mode sensors.
+
+ :type: integer
.. attribute:: level
@@ -130,7 +132,7 @@ Game Engine bge.types Module
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
+ :type: boolean
.. attribute:: tap
@@ -139,30 +141,35 @@ Game Engine bge.types Module
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
+ :type: boolean
.. attribute:: invert
- Flag to set if this sensor activates on positive or negative events. **type** boolean
+ 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
+ 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
+ True if this sensor brick is in a positive state. (read-only).
+
+ :type: boolean
.. attribute:: status
- The status of the sensor. (read-only). **type** int from 0-3.
+ The status of the sensor (read-only): can be one of :ref:`these constants<sensor-status>`.
- * KX_SENSOR_INACTIVE
- * KX_SENSOR_JUST_ACTIVATED
- * KX_SENSOR_ACTIVE
- * KX_SENSOR_JUST_DEACTIVATED
+ :type: int
- .. note:: this convenient attribute combines the values of triggered and positive attributes.
+ .. note::
+
+ This convenient attribute combines the values of triggered and positive attributes.
.. method:: reset()
@@ -176,27 +183,47 @@ Game Engine bge.types Module
.. 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
+ 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.
+ 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:: 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.
+ .. 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.
+ A list of actuators linked to this controller.
+
+ :type: sequence supporting index/string lookups and iteration.
+
+ .. note::
- .. 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.
+ 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** bool
+ 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.
+ .. note::
+
+ Order of execution between high priority controllers is not guaranteed.
.. class:: SCA_IActuator(SCA_ILogicBrick)
@@ -208,51 +235,75 @@ Game Engine bge.types Module
.. attribute:: action
- The name of the action to set as the current action. **type** string
+ 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
+ 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
+ Specifies the starting frame of the animation.
+
+ :type: float
.. attribute:: frameEnd
- Specifies the ending frame of the animation. **type** float
+ 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
+ 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
+ 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
+ Sets the current frame for the animation.
+
+ :type: float
.. attribute:: propName
- Sets the property to be used in FromProp playback mode. **type** string
+ 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
+ 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. KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND. **type** integer
+ 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
+ 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
+ The name of the property that is set to the current frame number.
+
+ :type: string
.. method:: setChannel(channel, matrix)
@@ -263,7 +314,9 @@ Game Engine bge.types Module
: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.
+ .. 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)
@@ -310,7 +363,7 @@ Game Engine bge.types Module
Check if the shader is valid.
:return: True if the shader is valid
- :rtype: bool
+ :rtype: boolean
.. method:: setAttrib(enum)
@@ -459,7 +512,7 @@ Game Engine bge.types Module
: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: bool
+ :type transpose: boolean
.. method:: setUniformMatrix4(name, mat, transpose)
@@ -470,7 +523,7 @@ Game Engine bge.types Module
: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: bool
+ :type transpose: boolean
.. method:: setUniformiv(name, iList)
@@ -491,63 +544,79 @@ Game Engine bge.types Module
.. attribute:: action
- The name of the action to set as the current shape action. **type** string
+ 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
+ Specifies the starting frame of the shape animation.
+
+ :type: float
.. attribute:: frameEnd
- Specifies the ending frame of the shape animation. **type** float
+ 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
+ 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
+ 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
+ Sets the current frame for the animation.
+
+ :type: float
.. attribute:: propName
- Sets the property to be used in FromProp playback mode. **type** string
+ 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
+ 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 in [KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND] **type** integer
+ 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
+ The name of the property that is set to the current frame number.
-.. class:: CListValue(CPropValue)
+ :type: string
- CListValue
+.. 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"]``
+ 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.
+ 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.
+ .. warning::
+
+ Appending values to the list can cause crashes when the list is used internally by the game engine.
.. method:: count(val)
@@ -579,16 +648,20 @@ Game Engine bge.types Module
Since object names are not always unique, the id of an object can be used to get an object from the CValueList.
- Example.
+ Example:
- ``myObID=id(gameObject)``
- ``ob= scene.objects.from_id(myObID)``
+ .. code-block:: python
+
+ myObID=id(gameObject)
+ ob= scene.objects.from_id(myObID)
- Where myObID is an int or long from the id function.
+ 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.
+ .. warning::
+
+ The id is derived from a memory location and will be different each time the game engine starts.
.. class:: KX_BlenderMaterial(PyObjectPlus)
@@ -648,112 +721,105 @@ Game Engine bge.types Module
.. attribute:: min
- minimum distance to the target object maintained by the actuator. **type** float
+ minimum distance to the target object maintained by the actuator.
+
+ :type: float
.. attribute:: max
- maximum distance to stay from the target object. **type** float
+ maximum distance to stay from the target object.
+
+ :type: float
.. attribute:: height
- height to stay above the target object. **type** float
+ height to stay above the target object.
+
+ :type: float
.. attribute:: useXY
- axis this actuator is tracking, True=X, False=Y. **type** boolean
+ axis this actuator is tracking, True=X, False=Y.
+
+ :type: boolean
.. attribute:: object
- the object this actuator tracks. **type** :class:`KX_GameObject` or None
+ the object this actuator tracks.
- @author: snail
+ :type: :class:`KX_GameObject` or None
.. class:: KX_ConstraintActuator(SCA_IActuator)
A constraint actuator limits the position, rotation, distance or orientation of an object.
- Properties:
-
.. attribute:: damp
- Time constant of the constraint expressed in frame (not use by Force field constraint). **type** integer
+ 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
+ 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)
+ The reference direction in world coordinate for the orientation constraint.
+
+ :type: 3-tuple of float: (x, y, z)
.. attribute:: option
- Binary combination of the following values. **type** integer
+ Binary combination of :ref:`these constants <constraint-actuator-option>`
- * 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: 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ :type: float
.. attribute:: limit
- type of constraint. **type** integer.
-
- 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 of constraint. Use one of the :ref:`these constants <constraint-actuator-limit>`
+
+ :type: integer.
+
.. class:: KX_ConstraintWrapper(PyObjectPlus)
KX_ConstraintWrapper
@@ -769,22 +835,17 @@ Game Engine bge.types Module
The game actuator loads a new .blend file, restarts the current .blend file or quits the game.
- Properties:
-
.. attribute:: fileName
- the new .blend file to load **type** string.
+ the new .blend file to load.
+
+ :type: string
.. attribute:: mode
- The mode of this actuator **type** Constant in...
+ The mode of this actuator. Can be on of :ref:`these constants <game-actuator>`
- * :mod:`bge.logic.KX_GAME_LOAD`
- * :mod:`bge.logic.KX_GAME_START`
- * :mod:`bge.logic.KX_GAME_RESTART`
- * :mod:`bge.logic.KX_GAME_QUIT`
- * :mod:`bge.logic.KX_GAME_SAVECFG`
- * :mod:`bge.logic.KX_GAME_LOADCFG`
+ :type: Int
.. class:: KX_GameObject(SCA_IObject)
@@ -792,143 +853,237 @@ Game Engine bge.types Module
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.
+ .. 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.
+ The object's name. (read-only).
+
+ :type: string
.. attribute:: 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** float
+ :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.
- .. 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** float
+ :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.
- .. note:: Applies to dynamic and rigid body objects only.
- .. note:: A value of 0.0 disables this option (rather then setting it stationary). **type** float
+ :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]
+ 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
+ The object's parent object. (read-only).
+
+ :type: :class:`KX_GameObject` or None
.. attribute:: visible
visibility flag.
- .. note:: Game logic will still run for invisible objects. **type** boolean
+ :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]
+ The object color of the object.
+
+ :type: list [r, g, b, a]
.. attribute:: occlusion
- occlusion capability flag. **type** boolean
+ 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
+ .. 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
+ .. 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
+ .. 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]]
+ 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]]
+ The object's world orientation.
+
+ :type: 3x3 Matrix [[float]]
.. attribute:: localScale
- The object's local scaling factor. **type** list [sx, sy, sz]
+ 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]
+ 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]
+ The object's local position.
+
+ :type: list [x, y, z]
.. attribute:: worldPosition
- The object's world position. **type** list [x, y, z]
+ The object's world position.
+
+ :type: list [x, y, z]
.. attribute:: timeOffset
- adjust the slowparent delay at runtime. **type** float
+ 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
+ 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.
- .. note:: Most objects use only 1 mesh.
- .. note:: Changes to this list will not update the KX_GameObject. **type** list of :class:`KX_MeshProxy`
+ :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.
- .. 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** list
+ :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.
- .. 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** list of :class:`SCA_ISensor`.
+
+ :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.
- .. 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** list
+ :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
+ 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
+ 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
+ all children of this object including childrens children, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`'s
.. method:: endObject()
@@ -943,9 +1098,9 @@ Game Engine bge.types Module
: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: bool
+ :type useDisplayMesh: boolean
:arg usePhysicsMesh: when enabled the physics mesh will be replaced (optional argument).
- :type usePhysicsMesh: bool
+ :type usePhysicsMesh: boolean
.. method:: setVisible(visible, recursive)
@@ -1114,7 +1269,9 @@ Game Engine bge.types Module
:return: the reaction force of this object.
:rtype: list [fx, fy, fz]
- .. note:: This is not implimented at the moment.
+ .. note::
+
+ This is not implimented at the moment.
.. method:: applyImpulse(point, impulse)
@@ -1135,7 +1292,9 @@ Game Engine bge.types Module
Resumes physics for this object.
- .. note:: The objects linear velocity will be applied from when the dynamics were suspended.
+ .. note::
+
+ The objects linear velocity will be applied from when the dynamics were suspended.
.. method:: enableRigidBody()
@@ -1143,13 +1302,17 @@ Game Engine bge.types Module
Rigid body physics allows the object to roll on collisions.
- .. note:: This is not working with bullet physics yet.
+ .. 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.
+ .. 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)
@@ -1173,7 +1336,9 @@ Game Engine bge.types Module
:type ghost: boolean
- .. note:: if the object type is sensor, it stays ghost regardless of ghost parameter
+ .. note::
+
+ If the object type is sensor, it stays ghost regardless of ghost parameter
.. method:: removeParent()
@@ -1288,17 +1453,21 @@ Game Engine bge.types Module
* 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.
+ .. 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.
- .. note:: If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError.
-
: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.
@@ -1321,15 +1490,29 @@ Game Engine bge.types Module
:arg meshObject: optional argument, set the physics shape from this mesh.
:type meshObject: string, :class:`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.
-
: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.
@@ -1341,39 +1524,57 @@ Game Engine bge.types Module
.. attribute:: frameStart
- Start frame. **type** float
+ Start frame.
+
+ :type: float
.. attribute:: frameEnd
- End frame. **type** float
+ End frame.
+
+ :type: float
.. attribute:: propName
- Use this property to define the Ipo position **type** string
+ Use this property to define the Ipo position.
+
+ :type: string
.. attribute:: framePropName
- Assign this property this action current frame number **type** string
+ Assign this property this action current frame number.
+
+ :type: string
.. attribute:: 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** integer
+ 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** bool
+ 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** bool
+ 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** bool
+ 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** bool
+ Update IPO on all children Objects as well.
+
+ :type: boolean
.. class:: KX_LightObject(KX_GameObject)
@@ -1408,19 +1609,27 @@ Game Engine bge.types Module
.. attribute:: layer
- The layer mask that this light affects object on. **type** bitfield
+ The layer mask that this light affects object on.
+
+ :type: bitfield
.. attribute:: energy
- The brightness of this light. **type** float
+ The brightness of this light.
+
+ :type: float
.. attribute:: distance
- The maximum distance this light can illuminate. (SPOT and NORMAL lights only) **type** float
+ 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]
+ 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
@@ -1428,21 +1637,31 @@ Game Engine bge.types Module
.. attribute:: lin_attenuation
- The linear component of this light's attenuation. (SPOT and NORMAL lights only) **type** float
+ 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
+ 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].
+ 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]
+ Specifies the intensity distribution of the spot light (SPOT lights only).
- .. note:: Higher values result in a more focused light source.
+ :type: float in [0 - 1]
+
+ .. note::
+
+ Higher values result in a more focused light source.
.. class:: KX_MeshProxy(SCA_IObject)
@@ -1494,15 +1713,15 @@ Game Engine bge.types Module
.. attribute:: materials
- **type** list of :class:`KX_BlenderMaterial` or :class:`KX_PolygonMaterial` types
+ :type: list of :class:`KX_BlenderMaterial` or :class:`KX_PolygonMaterial` types
.. attribute:: numPolygons
- **type** integer
+ :type: integer
.. attribute:: numMaterials
- **type** integer
+ :type: integer
.. method:: getNumMaterials()
@@ -1567,15 +1786,17 @@ Game Engine bge.types Module
Mouse Sensor logic brick.
- Properties:
-
.. attribute:: position
- current [x, y] coordinates of the mouse, in frame coordinates (pixels) **type** [integer, interger]
+ current [x, y] coordinates of the mouse, in frame coordinates (pixels).
+
+ :type: [integer, interger]
.. attribute:: mode
- sensor mode. **type** integer
+ sensor mode.
+
+ :type: integer
* KX_MOUSESENSORMODE_LEFTBUTTON(1)
* KX_MOUSESENSORMODE_MIDDLEBUTTON(2)
@@ -1587,11 +1808,11 @@ Game Engine bge.types Module
.. method:: getButtonStatus(button)
Get the mouse button status.
-
- :arg button: value in GameLogic members KX_MOUSE_BUT_LEFT, KX_MOUSE_BUT_MIDDLE, KX_MOUSE_BUT_RIGHT
- :type button: integer
- :return: value in GameLogic members KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED
- :rtype: integer
+
+ :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)
@@ -1602,31 +1823,45 @@ Game Engine bge.types Module
.. attribute:: raySource
- The worldspace source of the ray (the view position) **type** list (vector of 3 floats)
+ 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)
+ 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)
+ 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
+ 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)
+ 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)
+ 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)
+ 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].
@@ -1634,7 +1869,9 @@ Game Engine bge.types Module
.. 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** bool
+ 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)
@@ -1642,23 +1879,33 @@ Game Engine bge.types Module
.. attribute:: propName
- The property or material to collide with. **type** string
+ 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
+ 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** bool
+ 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
+ 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`
+ A list of colliding objects. (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_GameObject`
.. class:: KX_NearSensor(KX_TouchSensor)
@@ -1666,11 +1913,15 @@ Game Engine bge.types Module
.. attribute:: distance
- The near sensor activates when an object is within this distance. **type** float
+ 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
+ The near sensor deactivates when the object exceeds this distance.
+
+ :type: float
.. class:: KX_NetworkMessageActuator(SCA_IActuator)
@@ -1678,19 +1929,27 @@ Game Engine bge.types Module
.. attribute:: propName
- Messages will only be sent to objects with the given property name. **type** string
+ Messages will only be sent to objects with the given property name.
+
+ :type: string
.. attribute:: subject
- The subject field of the message. **type** string
+ The subject field of the message.
+
+ :type: string
.. attribute:: body
- The body of the message. **type** string
+ The body of the message.
+
+ :type: string
.. attribute:: usePropBody
- Send a property instead of a regular body message. **type** boolean
+ Send a property instead of a regular body message.
+
+ :type: boolean
.. class:: KX_NetworkMessageSensor(SCA_ISensor)
@@ -1700,19 +1959,27 @@ Game Engine bge.types Module
.. attribute:: subject
- The subject the sensor is looking for. **type** string
+ The subject the sensor is looking for.
+
+ :type: string
.. attribute:: frameMessageCount
- The number of messages received since the last frame. (read-only). **type** integer
+ 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
+ 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
+ The list of message bodies received. (read-only).
+
+ :type: list of strings
.. class:: KX_ObjectActuator(SCA_IActuator)
@@ -1722,79 +1989,119 @@ Game Engine bge.types Module
.. attribute:: force
- The force applied by the actuator **type** list [x, y, z]
+ The force applied by the actuator.
+
+ :type: list [x, y, z]
.. attribute:: useLocalForce
- A flag specifying if the force is local **type** bool
+ A flag specifying if the force is local.
+
+ :type: boolean
.. attribute:: torque
- The torque applied by the actuator **type** list [x, y, z]
+ The torque applied by the actuator.
+
+ :type: list [x, y, z]
.. attribute:: useLocalTorque
- A flag specifying if the torque is local **type** bool
+ A flag specifying if the torque is local.
+
+ :type: boolean
.. attribute:: dLoc
- The displacement vector applied by the actuator **type** list [x, y, z]
+ The displacement vector applied by the actuator.
+
+ :type: list [x, y, z]
.. attribute:: useLocalDLoc
- A flag specifying if the dLoc is local **type** bool
+ A flag specifying if the dLoc is local.
+
+ :type: boolean
.. attribute:: 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** list [x, y, z]
+ :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** bool
+ A flag specifying if the dRot is local.
+
+ :type: boolean
.. attribute:: linV
- The linear velocity applied by the actuator **type** list [x, y, z]
+ The linear velocity applied by the actuator.
+
+ :type: list [x, y, z]
.. attribute:: useLocalLinV
A flag specifying if the linear velocity is local.
- .. note:: This is the target speed for servo controllers **type** bool
+ :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]
+ The angular velocity applied by the actuator.
+
+ :type: list [x, y, z]
.. attribute:: useLocalAngV
- A flag specifying if the angular velocity is local **type** bool
+ A flag specifying if the angular velocity is local.
+
+ :type: boolean
.. attribute:: damping
- The damping parameter of the servo controller **type** short
+ 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]
+ 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]
+ 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]
+ 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]
+ 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
+ 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)
@@ -1802,22 +2109,30 @@ Game Engine bge.types Module
.. attribute:: object
- the object this actuator sets the parent too. **type** :class:`KX_GameObject` or None
+ 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.
+ 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** bool
+ 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** bool
+ 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)
@@ -1828,7 +2143,7 @@ Game Engine bge.types Module
Set the object to be active.
:arg active: set to True to be active
- :type active: bool
+ :type active: boolean
.. method:: setAngularVelocity(x, y, z, local)
@@ -1844,7 +2159,7 @@ Game Engine bge.types Module
:type z: float
:arg local: set to True for local axis
- :type local: bool
+ :type local: boolean
.. method:: setLinearVelocity(x, y, z, local)
@@ -1860,7 +2175,7 @@ Game Engine bge.types Module
:type z: float
:arg local: set to True for local axis
- :type local: bool
+ :type local: boolean
.. class:: KX_PolyProxy(SCA_IObject)
@@ -1872,44 +2187,64 @@ Game Engine bge.types Module
.. attribute:: matname
- The name of polygon material, empty if no material. **type** string
+ 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`
+ The material of the polygon.
+
+ :type: :class:`KX_PolygonMaterial` or :class:`KX_BlenderMaterial`
.. attribute:: texture
- The texture name of the polygon. **type** string
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ collide state of the polygon: 1=receives collision, 0=collision free.
+
+ :type: integer
.. method:: getMaterialName()
@@ -1974,18 +2309,17 @@ Game Engine bge.types Module
:return: mesh proxy
:rtype: :class:`MeshProxy`
-.. class:: KX_PolygonMaterial
+.. 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.
+ .. warning::
- This example requires
+ Some of the methods/variables are CObjects. If you mix these up, you will crash blender.
- * PyOpenGL <http://pyopengl.sourceforge.net>
- * GLEWPy <http://glewpy.sourceforge.net>
+ This example requires `PyOpenGL <http://pyopengl.sourceforge.net>`_ and `GLEWPy <http://glewpy.sourceforge.net>`_
.. code-block:: python
@@ -2117,74 +2451,106 @@ Game Engine bge.types Module
.. attribute:: texture
- Texture name **type** string (read-only)
+ Texture name.
+
+ :type: string (read-only)
.. attribute:: gl_texture
- OpenGL texture handle (eg for glBindTexture(GL_TEXTURE_2D, gl_texture) **type** integer (read-only)
+ OpenGL texture handle (eg for glBindTexture(GL_TEXTURE_2D, gl_texture).
+
+ :type: integer (read-only)
.. attribute:: material
- Material name **type** string (read-only)
+ Material name.
+
+ :type: string (read-only)
.. attribute:: tface
- Texture face properties **type** CObject (read-only)
+ Texture face properties.
+
+ :type: CObject (read-only)
.. attribute:: tile
- Texture is tiling **type** boolean
+ Texture is tiling.
+
+ :type: boolean
.. attribute:: tilexrep
- Number of tile repetitions in x direction. **type** integer
+ Number of tile repetitions in x direction.
+
+ :type: integer
.. attribute:: tileyrep
- Number of tile repetitions in y direction. **type** integer
+ 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
+ - 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
+ 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
+ Non-Transparent polygons will be sorted front to back before rendering.
+
+ :type: boolean
.. attribute:: lightlayer
- Light layers this material affects. **type** bitfield.
+ 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
+ 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]
+ 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]
+ 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
+ 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
+ The amount of specular of the material. 0.0 <= specularity <= 1.0.
+
+ :type: float
.. method:: updateTexture(tface, rasty)
@@ -2199,26 +2565,26 @@ Game Engine bge.types Module
Sets texture render state.
- .. code-block:: python
-
- mat.setTexture(mat.tface)
-
: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.
+ #. Texture
+ #. Backface culling
+ #. Line drawing
+ #. Specular Colour
+ #. Shininess
+ #. Diffuse Colour
+ #. Polygon Offset.
:arg rasty: Rasterizer instance.
:type rasty: CObject
@@ -2238,68 +2604,81 @@ Game Engine bge.types Module
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):`
-
- .. 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())
+ 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]
+ 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]
+ 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
+ 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
+ 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
+ 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
@@ -2315,39 +2694,57 @@ Game Engine bge.types Module
.. attribute:: propName
- The property the ray is looking for. **type** string
+ The property the ray is looking for.
+
+ :type: string
.. attribute:: range
- The distance of the ray. **type** float
+ The distance of the ray.
+
+ :type: float
.. attribute:: useMaterial
- Whether or not to look for a material (false = property) **type** boolean
+ Whether or not to look for a material (false = property).
+
+ :type: boolean
.. attribute:: useXRay
- Whether or not to use XRay. **type** boolean
+ 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`
+ 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]
+ 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]
+ 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]
+ 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
+ The axis the ray is pointing on.
+
+ :type: integer from 0 to 5
* KX_RAY_AXIS_POS_X
* KX_RAY_AXIS_POS_Y
@@ -2360,32 +2757,43 @@ Game Engine bge.types Module
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
+ 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
+ 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
+ the lifetime of added objects, in frames. Set to 0 to disable automatic deletion.
- .. attribute:: linearVelocity
+ :type: integer
- the initial linear velocity of added objects. **type** list [vx, vy, vz]
+ .. attribute:: linearVelocity
- .. attribute:: angularVelocity
+ the initial linear velocity of added objects.
- the initial angular velocity of added objects. **type** list [vx, vy, vz]
+ :type: 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.
+ .. attribute:: angularVelocity
- This will genereate a warning in the console:
+ the initial angular velocity of added objects.
- ``Error: GameObject 'Name' has a AddObjectActuator 'ActuatorName' without object (in 'nonactive' layer)``
+ :type: list [vx, vy, vz]
.. method:: instantAddObject()
@@ -2398,7 +2806,7 @@ Game Engine bge.types Module
.. attribute:: mode
- **type** integer
+ :type: integer
the type of operation of the actuator, 0-4
@@ -2410,7 +2818,9 @@ Game Engine bge.types Module
.. attribute:: mass
- the mass value for the KX_DYN_SET_MASS operation **type** float
+ the mass value for the KX_DYN_SET_MASS operation.
+
+ :type: float
.. class:: KX_SCA_EndObjectActuator(SCA_IActuator)
@@ -2422,69 +2832,79 @@ Game Engine bge.types Module
Edit Object actuator, in Replace Mesh mode.
- .. code-block:: python
+ .. warning::
- # 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.
+ Replace mesh actuators will be ignored if at game start, the named mesh doesn't exist.
This will generate a warning in the console
- ``Error: GameObject 'Name' ReplaceMeshActuator 'ActuatorName' without object``
+ .. 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
+ 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
+ when true the displayed mesh is replaced.
+
+ :type: boolean
.. attribute:: usePhysicsMesh
- when true the physics mesh is replaced. **type** boolean
+ when true the physics mesh is replaced.
+
+ :type: boolean
.. method:: instantReplaceMesh()
@@ -2530,53 +2950,79 @@ Game Engine bge.types Module
.. attribute:: name
- The scene's name, (read-only). **type** string
+ 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`
+ 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`
+ 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`
+ 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`
+ A list of cameras in the scene, (read-only).
+
+ :type: :class:`CListValue` of :class:`KX_Camera`
.. attribute:: active_camera
The current active camera.
- .. note:: this can be set directly from python to avoid using the :class:`KX_SceneActuator`. **type** :class:`KX_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
+ True if the scene is suspended, (read-only).
+
+ :type: boolean
.. attribute:: activity_culling
- True if the scene is activity culling **type** boolean
+ 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
+ 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** bool
+ 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
+ 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
+ A list of callables to be run after the render step.
+
+ :type: list
.. method:: addObject(object, other, time=0)
@@ -2623,29 +3069,43 @@ Game Engine bge.types Module
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
+ .. 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:
- ``Error: GameObject 'Name' has a SceneActuator 'ActuatorName' (SetScene) without scene``
+ .. 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.
+ the name of the scene to change to/overlay/underlay/remove/suspend/resume.
+
+ :type: string
.. attribute:: camera
the camera to change to.
- .. note:: When setting the attribute, you can use either a :class:`KX_Camera` or the name of the camera. **type** :class:`KX_Camera` on read, string or :class:`KX_Camera` on write
+ :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** bool
+ Set flag to True to restart the sene.
+
+ :type: boolean
.. attribute:: mode
- The mode of the actuator **type** integer from 0 to 5.
+ The mode of the actuator.
+
+ :type: integer from 0 to 5.
.. class:: KX_SoundActuator(SCA_IActuator)
@@ -2655,94 +3115,111 @@ Game Engine bge.types Module
.. attribute:: fileName
- The filename of the sound this actuator plays. **type** string
+ The filename of the sound this actuator plays.
+
+ :type: string
.. attribute:: volume
- The volume (gain) of the sound. **type** float
+ The volume (gain) of the sound.
+
+ :type: float
.. attribute:: pitch
- The pitch of the sound. **type** float
+ 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
+ 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
+ The loop mode of the actuator.
+
+ :type: integer
.. attribute:: position
- The position of the sound as a list: [x, y, z]. **type** float array
+ 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
+ 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]]
+ 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. **type** integer
-
- 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)
+ 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.
- Property:
-
.. attribute:: operation
- type of bit operation to be applied on object state mask.
-
- You can use one of the following constant:
+ Type of bit operation to be applied on object state mask.
+
+ You can use one of :ref:`these constants <state-actuator-operation>`
- * 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** integer
+ :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
+ 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.
+ .. 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:
- ``Error: GameObject 'Name' no object in EditObjectActuator 'ActuatorName'``
+ .. code-block:: none
+
+ GameObject 'Name' no object in EditObjectActuator 'ActuatorName'
.. attribute:: object
- the object this actuator tracks. **type** :class:`KX_GameObject` or None
+ 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
+ the time in frames with which to delay the tracking motion.
+
+ :type: integer
.. attribute:: use3D
- the tracking motion to use 3D **type** boolean
+ the tracking motion to use 3D.
+
+ :type: boolean
.. class:: KX_VehicleWrapper(PyObjectPlus)
@@ -2908,19 +3385,27 @@ Game Engine bge.types Module
.. attribute:: XYZ
- The position of the vertex. **type** list [x, y, z]
+ The position of the vertex.
+
+ :type: list [x, y, z]
.. attribute:: UV
- The texture coordinates of the vertex. **type** list [u, v]
+ The texture coordinates of the vertex.
+
+ :type: list [u, v]
.. attribute:: normal
- The normal of the vertex **type** list [nx, ny, nz]
+ The normal of the vertex.
+
+ :type: list [nx, ny, nz]
.. attribute:: colour
- The colour of the vertex. **type** list [r, g, b, a]
+ 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]
@@ -2930,47 +3415,69 @@ Game Engine bge.types Module
.. attribute:: x
- The x coordinate of the vertex. **type** float
+ The x coordinate of the vertex.
+
+ :type: float
.. attribute:: y
- The y coordinate of the vertex. **type** float
+ The y coordinate of the vertex.
+
+ :type: float
.. attribute:: z
- The z coordinate of the vertex. **type** float
+ The z coordinate of the vertex.
+
+ :type: float
.. attribute:: u
- The u texture coordinate of the vertex. **type** float
+ The u texture coordinate of the vertex.
+
+ :type: float
.. attribute:: v
- The v texture coordinate of the vertex. **type** float
+ The v texture coordinate of the vertex.
+
+ :type: float
.. attribute:: u2
- The second u texture coordinate of the vertex. **type** float
+ The second u texture coordinate of the vertex.
+
+ :type: float
.. attribute:: v2
- The second v texture coordinate of the vertex. **type** float
+ 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
+ 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
+ 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
+ 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
+ The alpha component of the vertex colour. 0.0 <= a <= 1.0.
+
+ :type: float
.. method:: getXYZ()
@@ -2983,7 +3490,7 @@ Game Engine bge.types Module
Sets the position of this vertex.
- **type** list [x, y, z]
+ :type: list [x, y, z]
:arg pos: the new position for this vertex in local coordinates.
@@ -2998,7 +3505,7 @@ Game Engine bge.types Module
Sets the UV (texture) coordinates of this vertex.
- **type** list [u, v]
+ :type: list [u, v]
.. method:: getUV2()
@@ -3011,7 +3518,7 @@ Game Engine bge.types Module
Sets the 2nd UV (texture) coordinates of this vertex.
- **type** list [u, v]
+ :type: list [u, v]
:arg unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV
:arg unit: integer
@@ -3070,7 +3577,7 @@ Game Engine bge.types Module
Sets the normal vector of this vertex.
- **type** sequence of floats [r, g, b]
+ :type: sequence of floats [r, g, b]
:arg normal: the new normal of this vertex.
@@ -3080,65 +3587,63 @@ Game Engine bge.types Module
.. attribute:: visibility
- whether the actuator makes its parent object visible or invisible **type** boolean
+ 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
+ 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
+ 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
- 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.
+ 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
+ shader source code for custom shader.
+
+ :type: string
.. attribute:: disableMotionBlur
- action on motion blur: 0=enable, 1=disable **type** integer
+ action on motion blur: 0=enable, 1=disable.
+
+ :type: integer
.. attribute:: 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** integer
+ 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)
+ 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)
+ argument for motion blur filter.
+
+ :type: float (0.0-100.0)
.. class:: SCA_ANDController(SCA_IController)
@@ -3152,11 +3657,11 @@ Game Engine bge.types Module
It generates a positive pulse if the corresponding actuator is activated
and a negative pulse if the actuator is deactivated.
- Properties:
-
.. attribute:: actuator
- the name of the actuator that the sensor is monitoring. **type** string
+ the name of the actuator that the sensor is monitoring.
+
+ :type: string
.. class:: SCA_AlwaysSensor(SCA_ISensor)
@@ -3174,31 +3679,35 @@ Game Engine bge.types Module
Use :class:`SCA_ISensor.reset` at any time to restart sensor.
- Properties:
-
.. attribute:: delay
- length of the initial OFF period as number of frame, 0 for immediate trigger. **type** integer.
+ 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
+ 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
+ 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.
- Properties:
-
.. attribute:: axisValues
- The state of the joysticks axis as a list of values :data:`numAxis` long. (read-only). **type** list of ints.
+ 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.
@@ -3210,13 +3719,19 @@ Game Engine bge.types Module
.. attribute:: axisSingle
- like :data:`axisValues` but returns a single axis value that is set by the sensor. (read-only). **type** integer
+ like :data:`axisValues` but returns a single axis value that is set by the sensor. (read-only).
- .. note:: only use this for "Single Axis" type sensors otherwise it will raise an error.
+ :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
+ 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.
@@ -3234,49 +3749,69 @@ Game Engine bge.types Module
.. attribute:: hatSingle
- Like :data:`hatValues` but returns a single hat direction value that is set by the sensor. (read-only). **type** integer
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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]
+ * 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]
+ * hatDirection: 1-12.
+
+ :type: [integer, integer]
.. method:: getButtonActiveList()
@@ -3298,48 +3833,54 @@ Game Engine bge.types Module
.. attribute:: key
- The key code this sensor is looking for. **type** keycode from :mod:`bge.keys` module
+ 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
+ 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
+ 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
+ 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
+ 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
+ Flag to determine whether or not to accept all keys.
- .. attribute:: events
+ :type: boolean
- a list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only). **type** list [[keycode, status], ...]
+ .. attribute:: events
- * 'keycode' matches the values in :mod:`bge.keys`.
- * 'status' uses...
+ a list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only).
- * :mod:`bge.logic.KX_INPUT_NONE`
- * :mod:`bge.logic.KX_INPUT_JUST_ACTIVATED`
- * :mod:`bge.logic.KX_INPUT_ACTIVE`
- * :mod:`bge.logic.KX_INPUT_JUST_RELEASED`
+ :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
+ :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
- :rtype: key state :mod:`bge.logic` members (KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED)
+ :return: The state of the given key, can be one of :ref:`these constants<input-status>`
+ :rtype: int
.. class:: SCA_NANDController(SCA_IController)
@@ -3363,59 +3904,63 @@ Game Engine bge.types Module
Property Actuator
- Properties:
-
.. attribute:: propName
- the property on which to operate. **type** string
+ the property on which to operate.
+
+ :type: string
.. attribute:: value
- the value with which the actuator operates. **type** string
+ the value with which the actuator operates.
+
+ :type: string
.. attribute:: mode
- TODO - add constants to game logic dict!. **type** integer
+ TODO - add constants to game logic dict!.
+
+ :type: integer
.. class:: SCA_PropertySensor(SCA_ISensor)
Activates when the game object property matches.
- Properties:
-
.. attribute:: mode
- Type of check on the property. **type** integer
+ Type of check on the property. Can be one of :ref:`these constants <logic-property-sensor>`
- * KX_PROPSENSOR_EQUAL(1)
- * KX_PROPSENSOR_NOTEQUAL(2)
- * KX_PROPSENSOR_INTERVAL(3)
- * KX_PROPSENSOR_CHANGED(4)
- * KX_PROPSENSOR_EXPRESSION(5)
+ :type: integer.
.. attribute:: propName
- the property the sensor operates. **type** string
+ the property the sensor operates.
+
+ :type: string
.. attribute:: value
- the value with which the sensor compares to the value of the property. **type** string
+ 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
+ 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
+ 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.
- Properties:
-
.. attribute:: script
The value of this variable depends on the execution methid.
@@ -3423,14 +3968,20 @@ Game Engine bge.types Module
* 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** string
+ :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
+ * Module: 1, Execite the :data:`script` as a module and function.
+
+ :type: integer
.. method:: activate(actuator)
@@ -3450,44 +4001,41 @@ Game Engine bge.types Module
Random Actuator
- Properties:
-
.. attribute:: seed
- Seed of the random number generator. **type** integer.
+ 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.
+ 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
+ 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). **type** integer
+ Distribution type. (read-only). Can be one of :ref:`these constants <logic-random-distributions>`
- * 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: integer
.. attribute:: propName
- the name of the property to set with the random value. **type** string
+ 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.
@@ -3575,11 +4123,15 @@ Game Engine bge.types Module
.. attribute:: lastDraw
- The seed of the random number generator. **type** integer
+ The seed of the random number generator.
+
+ :type: integer
.. attribute:: seed
- The seed of the random number generator. **type** integer
+ The seed of the random number generator.
+
+ :type: integer
.. method:: setSeed(seed)
@@ -3615,64 +4167,93 @@ Game Engine bge.types Module
A Camera object.
- .. attribute:: INSIDE
+ .. data:: INSIDE
- see :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
+ See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
- .. attribute:: INTERSECT
+ .. data:: INTERSECT
- see :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
+ See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
- .. attribute:: OUTSIDE
+ .. data:: OUTSIDE
- see :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
+ See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
.. attribute:: lens
- The camera's lens value. **type** float
+ The camera's lens value.
+
+ :type: float
.. attribute:: near
- The camera's near clip distance. **type** float
+ The camera's near clip distance.
+
+ :type: float
.. attribute:: far
- The camera's far clip distance. **type** float
+ 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
+ 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
+ True if this camera is frustum culling.
+
+ :type: boolean
.. attribute:: projection_matrix
- This camera's 4x4 projection matrix. **type** 4x4 Matrix [[float]]
+ 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]]
+ 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.
+ .. 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]]
+ 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.
+ .. 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]]
+ 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:: Regenerated every frame from the camera's position and orientation.
- .. note:: This is camera_to_world inverted.
+ .. 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
+ True when the camera is used as a viewport, set True to enable a viewport for this camera.
+
+ :type: boolean
.. method:: sphereInsideFrustum(centre, radius)
@@ -3682,80 +4263,86 @@ Game Engine bge.types Module
:type centre: list [x, y, z]
:arg radius: the radius of the sphere
:type radius: float
- :return: INSIDE, OUTSIDE or INTERSECT
+ :return: :data:`~bge.types.KX_Camera.INSIDE`, :data:`~bge.types.KX_Camera.OUTSIDE` or :data:`~bge.types.KX_Camera.INTERSECT`
:rtype: integer
- .. code-block:: python
+ .. note::
+
+ When the camera is first initialized the result will be invalid because the projection matrix has not been set.
- 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
+ .. code-block:: python
- .. note:: when the camera is first initialized the result will be invalid because the projection matrix has not been set.
+ 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.
- .. 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 !
-
:arg box: Eight (8) corner points of the box (in world coordinates.)
:type box: list of lists
- :return: INSIDE, OUTSIDE or INTERSECT
+ :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.
+ .. 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.
- .. 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 !
-
: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.
+ .. 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()
@@ -3810,12 +4397,6 @@ Game Engine bge.types Module
Gets the vector from the camera position in the screen coordinate direction.
- .. code-block:: python
-
- # Gets the vector of the camera front direction:
- m_vect = camera.getScreenVect(0.5, 0.5)
-
-
:arg x: X Axis
:type x: float
:arg y: Y Axis
@@ -3823,16 +4404,16 @@ Game Engine bge.types Module
: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.
- .. 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")
-
:arg x: X Axis
:type x: float
:arg y: Y Axis
@@ -3844,6 +4425,11 @@ Game Engine bge.types Module
: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.
@@ -3852,12 +4438,16 @@ Game Engine bge.types Module
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`
+ 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`
+ Elements of the list can be accessed by index or name the bone.
+
+ :type: list of :class:`BL_ArmatureChannel`
.. method:: update()
@@ -3871,88 +4461,138 @@ Game Engine bge.types Module
Armature Actuators change constraint condition on armatures.
- .. attribute:: KX_ACT_ARMATURE_RUN
+ .. _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
- see type
+ .. data:: KX_ACT_ARMATURE_ENABLE
- .. attribute:: KX_ACT_ARMATURE_ENABLE
+ Enable the constraint.
+
+ :value: 1
- see type
+ .. data:: KX_ACT_ARMATURE_DISABLE
- .. attribute:: KX_ACT_ARMATURE_DISABLE
+ Disable the constraint (runtime constraint values are not updated).
+
+ :value: 2
- see type
+ .. data:: KX_ACT_ARMATURE_SETTARGET
- .. attribute:: KX_ACT_ARMATURE_SETTARGET
+ Change target and subtarget of constraint.
+
+ :value: 3
- see type
+ .. data:: KX_ACT_ARMATURE_SETWEIGHT
- .. attribute:: KX_ACT_ARMATURE_SETWEIGHT
+ Change weight of (only for IK constraint).
- see type
+ :value: 4
- .. attribute:: type
+ .. attribute:: 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** integer
+ 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`
+ 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`
+ 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`.
+ 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.
+ .. 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.
+ 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::
+
+ 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`)
+ .. 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.
- See :data:`type`
+ .. _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. **type** integer.
+ The type of measurement that the sensor make when it is active.
+
+ Can be one of :ref:`these constants <armaturesensor-type>`
- * 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: integer.
.. attribute:: constraint
- The constraint object this sensor is watching. **type** :class:`BL_ArmatureConstraint`
+ The constraint object this sensor is watching.
+
+ :type: :class:`BL_ArmatureConstraint`
.. attribute:: value
- **type** float
-
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
@@ -3960,15 +4600,20 @@ Game Engine bge.types Module
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.
+ .. note::
+
+ Not all armature constraints are supported in the GE.
+ .. _armatureconstraint-constants-type:
- Constants related to see :data:`type`
+ Constants related to :data:`type`
.. data:: CONSTRAINT_TYPE_TRACKTO
.. data:: CONSTRAINT_TYPE_KINEMATIC
@@ -3982,48 +4627,117 @@ Game Engine bge.types Module
.. data:: CONSTRAINT_TYPE_TRANSFORM
.. data:: CONSTRAINT_TYPE_DISTLIMIT
+ .. _armatureconstraint-constants-ik-type:
- Constants related to see :data:`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
- .. data:: CONSTRAINT_IK_MODE_INSIDE
- .. data:: CONSTRAINT_IK_MODE_OUTSIDE
- .. data:: CONSTRAINT_IK_MODE_ONSURFACE
+
+ 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) **type** integer, one of CONSTRAINT_TYPE_* constants
+ 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
+ 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
+ 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.
+ 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.
+ .. 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
+ 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.
+ 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.
@@ -4031,11 +4745,15 @@ Game Engine bge.types Module
.. 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`.
+ 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`.
+ 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.
@@ -4043,41 +4761,49 @@ Game Engine bge.types Module
True if the constraint is active.
- .. note:: an inactive constraint does not update lin_error and rot_error. **type** boolean
+ :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
+ Only defined for IK constraint.
+
+ :type: float
.. attribute:: ik_type
- Type of IK constraint, (read-only). **type** integer.
+ 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
+ Use one of :ref:`these constants<armatureconstraint-constants-ik-type>`.
+
+ :type: integer.
.. attribute:: ik_flag
- Combination of IK constraint option flags, read-only
+ Combination of IK constraint option flags, read-only.
+
+ Use one of :ref:`these constants<armatureconstraint-constants-ik-flag>`.
- * 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** integer
+ :type: integer
.. attribute:: ik_dist
- Distance the constraint is trying to maintain with target, only used when ik_type=CONSTRAINT_IK_DISTANCE **type** float
+ 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:
- * 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** integer
+ :type: integer
.. class:: BL_ArmatureChannel(PyObjectPlus)
@@ -4096,84 +4822,138 @@ Game Engine bge.types Module
.. attribute:: name
- channel name (=bone name), read-only. **type** string
+ 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`
+ 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`
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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].
+ 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:: 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`).
+ .. 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].
+ 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`)
+ .. 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
- rotation of the bone relative to its parent expressed as a quaternion, read-write. **type** vector [qr, qi, qj, qk].
+ rotation of the bone relative to its parent expressed as a quaternion, read-write.
- .. 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`)
+ :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:: euler_rotation
- rotation of the bone relative to its parent expressed as a set of euler angles, read-write. **type** vector [X, Y, Z].
+ 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`)
+ .. 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
+ 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).
@@ -4188,72 +4968,104 @@ Game Engine bge.types Module
.. 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]
+ 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]
+ 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]
+ 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]
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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. **type** vector [x, y, z]
+ 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.
@@ -4266,10 +5078,23 @@ Game Engine bge.types Module
* 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.
- .. 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.
+ :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)
@@ -4278,62 +5103,94 @@ Game Engine bge.types Module
.. attribute:: name
- bone name **type** string
+ bone name.
+
+ :type: string
.. attribute:: connected
- true when the bone head is struck to the parent's tail **type** boolean
+ 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
+ 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
+ true when bone inherits scaling from parent bone.
+
+ :type: boolean
.. attribute:: bbone_segments
- number of B-bone segments **type** integer
+ number of B-bone segments.
+
+ :type: integer
.. attribute:: roll
- bone rotation around head-tail axis **type** float
+ 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]
+ 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]
+ location of head end of the bone in parent bone space.
+
+ :type: vector [x, y, z]
.. attribute:: length
- bone length **type** float
+ bone length.
+
+ :type: float
.. attribute:: arm_head
- location of head end of the bone in armature space **type** vector [x, y, z]
+ 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]
+ 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]
+ matrix of the bone head in armature space.
- .. note:: This matrix has no scale part.
+ :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]
+ 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`
+ parent bone, or None for root bone.
+
+ :type: :class:`BL_ArmatureBone`
.. attribute:: children
- list of bone's children. **type** list of :class:`BL_ArmatureBone`
+ list of bone's children.
+
+ :type: list of :class:`BL_ArmatureBone`
diff --git a/source/gameengine/Rasterizer/Makefile b/source/gameengine/Rasterizer/Makefile
index a12d599b60b..c877e423a71 100644
--- a/source/gameengine/Rasterizer/Makefile
+++ b/source/gameengine/Rasterizer/Makefile
@@ -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.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.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 339521cb093..826fe732b94 100644
--- a/source/gameengine/Rasterizer/RAS_ICanvas.h
+++ b/source/gameengine/Rasterizer/RAS_ICanvas.h
@@ -210,7 +210,7 @@ protected:
#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.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 e9aacadece3..ebca97a806a 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -416,7 +416,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/Makefile b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
index 0327714dc5f..aedbc2705f0 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
@@ -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 fe63a854275..f2f70c68068 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.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/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.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.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.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.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/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/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;
}