diff options
author | Jorge Bernal <jbernalmartinez@gmail.com> | 2014-06-26 02:47:30 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2014-06-26 02:47:37 +0400 |
commit | 7d99a4ded9d3d24c24ea2d5bcc488469cf60fa4a (patch) | |
tree | f56a5cb74013a4e0520e668570e9fe9f6d1d4a6a /source/blender/makesdna | |
parent | 11d1fea2850dd4071268034b133c924ce6396df9 (diff) |
BGE: New Mouse Actuator
Disclaimer: The author of this patch is Geoffrey Gollmer (gomer). I only updated the patch to the current git master status, reworked several parts to fit well with current coding style and applied several fixes.
This actuator allows users to show/hide the mouse cursor using logic bricks, as well as control object rotation with a mouse in the BGE.
The mouse rotation is flexible enough to allow any type of mouse look, as well as banking for flight controls.
{F94520}
{F91859}
Blend file for testing Mouse actuator (with default parameters and crosshair): {F94920}
Reviewers: moguri
Reviewed By: moguri
CC: gomer, lordodin
Differential Revision: https://developer.blender.org/D559
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_actuator_types.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index 99f0c999a29..5ab799a75e5 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -245,6 +245,18 @@ typedef struct bSteeringActuator { struct Object *navmesh; } bSteeringActuator; +typedef struct bMouseActuator { + short type; /* 0=Visibility, 1=Look */ + short flag; + + int object_axis[2]; + float threshold[2]; + float sensitivity[2]; + float limit_x[2]; + float limit_y[2]; +} bMouseActuator; + + typedef struct bActuator { struct bActuator *next, *prev, *mynew; short type; @@ -314,6 +326,7 @@ typedef struct bActuator { #define ACT_STATE 22 #define ACT_ARMATURE 23 #define ACT_STEERING 24 +#define ACT_MOUSE 25 /* actuator flag */ #define ACT_SHOW 1 @@ -542,4 +555,22 @@ typedef struct bActuator { #define ACT_STEERING_AUTOMATICFACING 4 #define ACT_STEERING_NORMALUP 8 +/* mouseactuator->type */ +#define ACT_MOUSE_VISIBILITY 0 +#define ACT_MOUSE_LOOK 1 + +/* mouseactuator->flag */ +#define ACT_MOUSE_VISIBLE (1 << 0) +#define ACT_MOUSE_USE_AXIS_X (1 << 1) +#define ACT_MOUSE_USE_AXIS_Y (1 << 2) +#define ACT_MOUSE_RESET_X (1 << 3) +#define ACT_MOUSE_RESET_Y (1 << 4) +#define ACT_MOUSE_LOCAL_X (1 << 5) +#define ACT_MOUSE_LOCAL_Y (1 << 6) + +/* mouseactuator->object_axis */ +#define ACT_MOUSE_OBJECT_AXIS_X 0 +#define ACT_MOUSE_OBJECT_AXIS_Y 1 +#define ACT_MOUSE_OBJECT_AXIS_Z 2 + #endif /* __DNA_ACTUATOR_TYPES_H__ */ |