diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-10-01 23:16:13 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-10-01 23:16:13 +0400 |
commit | 8550c2b594fb1a2544b77b7f3abec84b29b1745d (patch) | |
tree | cf54081e1efe46327c6125297da4e829cabe283b /source/gameengine/Ketsji/KX_ConstraintActuator.h | |
parent | 611b4b383ab56c92a3d09e670773cb66a7b61ad6 (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/Ketsji/KX_ConstraintActuator.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_ConstraintActuator.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h index b2ef0dae553..28b9b1e6a0b 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.h +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h @@ -38,6 +38,7 @@ #include "KX_ClientObjectInfo.h" class KX_RayCast; +class KX_GameObject; class KX_ConstraintActuator : public SCA_IActuator { @@ -65,6 +66,8 @@ protected: int m_option; // property to check char m_property[32]; + // hit object + KX_GameObject* m_hitObject; /** * Clamp <var> to <min>, <max>. Borders are included (in as far as @@ -92,6 +95,12 @@ protected: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ, + KX_ACT_CONSTRAINT_FHPX, + KX_ACT_CONSTRAINT_FHPY, + KX_ACT_CONSTRAINT_FHPZ, + KX_ACT_CONSTRAINT_FHNX, + KX_ACT_CONSTRAINT_FHNY, + KX_ACT_CONSTRAINT_FHNZ, KX_ACT_CONSTRAINT_MAX }; // match ACT_CONST_... values from BIF_interface.h @@ -100,7 +109,8 @@ protected: KX_ACT_CONSTRAINT_MATERIAL = 128, KX_ACT_CONSTRAINT_PERMANENT = 256, KX_ACT_CONSTRAINT_DISTANCE = 512, - KX_ACT_CONSTRAINT_LOCAL = 1024 + KX_ACT_CONSTRAINT_LOCAL = 1024, + KX_ACT_CONSTRAINT_DOROTFH = 2048 }; bool IsValidMode(KX_CONSTRAINTTYPE m); bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data); |