From e38a0b3748683a35601c256053f716ad8b57002f Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sun, 8 Jul 2018 13:47:26 +0300 Subject: Shrinkwrap Constraint: implement projection features from the modifier. Allow raycasting in two directions and culling front or back faces. Also implement a new Invert Cull option in both constraint and modifier that can be used to aim for faces aligned with the project axis direction when raycasting both ways. Reviewers: mont29 Differential Revision: https://developer.blender.org/D3737 --- source/blender/makesdna/DNA_constraint_types.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna/DNA_constraint_types.h') diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index e7d9e1fa7dd..a92899deaa8 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -429,7 +429,8 @@ typedef struct bShrinkwrapConstraint { char projAxisSpace; /* space to project axis in */ float projLimit; /* distance to search */ char shrinkMode; /* inside/outside/on surface (see MOD shrinkwrap) */ - char pad[3]; + char flag; /* options */ + char pad[2]; } bShrinkwrapConstraint; /* Follow Track constraints */ @@ -635,6 +636,21 @@ typedef enum eTrackToAxis_Modes { TRACK_nZ = 5 } eTrackToAxis_Modes; +/* Shrinkwrap flags */ +typedef enum eShrinkwrap_Flags { + /* Also raycast in the opposite direction. */ + CON_SHRINKWRAP_PROJECT_OPPOSITE = (1 << 0), + /* Invert the cull mode when projecting opposite. */ + CON_SHRINKWRAP_PROJECT_INVERT_CULL = (1 << 1), + + /* Ignore front faces in project; same value as MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE */ + CON_SHRINKWRAP_PROJECT_CULL_FRONTFACE = (1 << 3), + /* Ignore back faces in project; same value as MOD_SHRINKWRAP_CULL_TARGET_BACKFACE */ + CON_SHRINKWRAP_PROJECT_CULL_BACKFACE = (1 << 4), +} eShrinkwrap_Flags; + +#define CON_SHRINKWRAP_PROJECT_CULL_MASK (CON_SHRINKWRAP_PROJECT_CULL_FRONTFACE | CON_SHRINKWRAP_PROJECT_CULL_BACKFACE) + /* FollowPath flags */ typedef enum eFollowPath_Flags { FOLLOWPATH_FOLLOW = (1<<0), -- cgit v1.2.3