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:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-04-06 22:30:52 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2008-04-06 22:30:52 +0400
commite7384c9dd2d93e3814e8df51eea64f1dc687c338 (patch)
tree44fb5c808bb3af0783c675886e029e9e4bdb1a21 /source/blender/makesdna
parent711306c2ba1c4ea0d0027087ce53746cde4be0ed (diff)
Commit patch #8799: Realtime SetParent function in the BGE
This patch consists in new KX_GameObject::SetParent() and KX_GameObject::RemoveParent() functions to create and destroy parent relation during game. These functions are accessible through python and through a new actuator KX_ParentActuator. Function documentation in PyDoc. The object keeps its orientation, position and scale when it is parented but will further rotate, move and scale with its parent from that point on. When the parent relation is broken, the object keeps the orientation, position and scale it had at that time. The function has no effect if any of the X/Y/Z scale of the object or its new parent are below Epsilon.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_actuator_types.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h
index 0d324b7d5d3..3aa563338d6 100644
--- a/source/blender/makesdna/DNA_actuator_types.h
+++ b/source/blender/makesdna/DNA_actuator_types.h
@@ -205,6 +205,12 @@ typedef struct bTwoDFilterActuator{
struct Text *text;
}bTwoDFilterActuator;
+typedef struct bParentActuator {
+ char pad[4];
+ int type;
+ struct Object *ob;
+} bParentActuator;
+
typedef struct bActuator {
struct bActuator *next, *prev, *mynew;
short type;
@@ -274,6 +280,7 @@ typedef struct FreeCamera {
#define ACT_GAME 17
#define ACT_VISIBILITY 18
#define ACT_2DFILTER 19
+#define ACT_PARENT 20
/* actuator flag */
#define ACT_SHOW 1
@@ -423,6 +430,10 @@ typedef struct FreeCamera {
#define ACT_2DFILTER_INVERT 11
#define ACT_2DFILTER_CUSTOMFILTER 12
#define ACT_2DFILTER_NUMBER_OF_FILTERS 13
+
+/* parentactuator->type */
+#define ACT_PARENT_SET 0
+#define ACT_PARENT_REMOVE 1
#endif