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-10-01 23:16:13 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2008-10-01 23:16:13 +0400
commit8550c2b594fb1a2544b77b7f3abec84b29b1745d (patch)
treecf54081e1efe46327c6125297da4e829cabe283b /source/gameengine/Converter/KX_ConvertActuators.cpp
parent611b4b383ab56c92a3d09e670773cb66a7b61ad6 (diff)
BGE patch: new force field constraint actuator
A new type of constraint actuator is available: Force field. It provides a very similar service to the Fh material feature but with some specificities: - It is defined at the object level: each object can have different settings and you don't need to use material. - It can be applied in all 6 directions and not just -Z. - It can be enabled/disabled easily (it's an actuator). - You can have multiple force fields active at the same time on the same object in different direction (think of a space ship in a tunnel with a repulsive force field on each wall). - You can have a different damping for the rotation. Besides that it provides the same dynamic behavior and the parameters are self explanatory. It works by adapting the linear and angular velocity: the dynamic is independent of the mass. It is compatible with all other motion actuators. Note: linear and anysotropic friction is not yet implemented, the only friction will come from the object damping parameters. Support for friction will be added in a future revision.
Diffstat (limited to 'source/gameengine/Converter/KX_ConvertActuators.cpp')
-rw-r--r--source/gameengine/Converter/KX_ConvertActuators.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp
index 78791c53d7c..b739e3b2094 100644
--- a/source/gameengine/Converter/KX_ConvertActuators.cpp
+++ b/source/gameengine/Converter/KX_ConvertActuators.cpp
@@ -719,6 +719,40 @@ void BL_ConvertActuators(char* maggiename,
break;
}
prop = conact->matprop;
+ } else if (conact->type == ACT_CONST_TYPE_FH) {
+ switch (conact->mode) {
+ case ACT_CONST_DIRPX:
+ locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPX;
+ min = conact->minloc[0];
+ max = conact->maxloc[0];
+ break;
+ case ACT_CONST_DIRPY:
+ locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPY;
+ min = conact->minloc[1];
+ max = conact->maxloc[1];
+ break;
+ case ACT_CONST_DIRPZ:
+ locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHPZ;
+ min = conact->minloc[2];
+ max = conact->maxloc[2];
+ break;
+ case ACT_CONST_DIRNX:
+ locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNX;
+ min = conact->minloc[0];
+ max = conact->maxloc[0];
+ break;
+ case ACT_CONST_DIRNY:
+ locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNY;
+ min = conact->minloc[1];
+ max = conact->maxloc[1];
+ break;
+ case ACT_CONST_DIRNZ:
+ locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_FHNZ;
+ min = conact->minloc[2];
+ max = conact->maxloc[2];
+ break;
+ }
+ prop = conact->matprop;
} else {
switch (conact->flag) {
case ACT_CONST_LOCX: