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:
authorCampbell Barton <ideasman42@gmail.com>2016-04-21 04:29:32 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-04-22 09:36:53 +0300
commit19e5540ff7712a45ab4ced4a4a02b12ce02637a9 (patch)
treeb43be4638a05372d802dc71580099e53f54545bc /source/blender/editors/transform/transform.h
parent8dcdde52b17228601c95fed04f5bca03484d27ac (diff)
Transform Snap: initial snap context refactor
This introduces a snap-context that can be re-used for casting rays into the scene (by operators such as walk-mode, ruler and transform code). This can be used to cache data between calls too.
Diffstat (limited to 'source/blender/editors/transform/transform.h')
-rw-r--r--source/blender/editors/transform/transform.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index c156e9ecec0..5858210cd4f 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -101,6 +101,11 @@ typedef struct TransSnap {
* where the smallest absolute value defines whats closest.
*/
float (*distance)(struct TransInfo *, const float p1[3], const float p2[3]);
+
+ /**
+ * Re-usable snap context data.
+ */
+ SnapObjectContext *object_context;
} TransSnap;
typedef struct TransCon {
@@ -677,6 +682,7 @@ bool activeSnap(TransInfo *t);
bool validSnap(TransInfo *t);
void initSnapping(struct TransInfo *t, struct wmOperator *op);
+void freeSnapping(struct TransInfo *t);
void applyProject(TransInfo *t);
void applyGridAbsolute(TransInfo *t);
void applySnapping(TransInfo *t, float *vec);
@@ -786,4 +792,8 @@ void projectVertSlideData(TransInfo *t, bool is_final);
/* TODO. transform_queries.c */
bool checkUseAxisMatrix(TransInfo *t);
+#define TRANSFORM_DIST_MAX_PX 1000.0f
+#define TRANSFORM_SNAP_MAX_PX 100.0f
+#define TRANSFORM_DIST_INVALID -FLT_MAX
+
#endif