diff options
author | Matt Ebb <matt@mke3.net> | 2006-10-12 11:54:32 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2006-10-12 11:54:32 +0400 |
commit | 1be92c8b19cf63890bae3e409a4ede563bae7200 (patch) | |
tree | bc6aa4886d815e93a3f4e273662097ab6e17a76e | |
parent | 14a94607557a2436cd187b6e7d89ee418a3eedf0 (diff) |
* Added a new empty draw type - single arrow. This can be useful in situations
where you just need a direction, like a wind or vortex force field for example.
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 1 | ||||
-rw-r--r-- | source/blender/src/buttons_editing.c | 4 | ||||
-rw-r--r-- | source/blender/src/drawobject.c | 36 |
3 files changed, 39 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 9cdb5054493..ef43ab72dfc 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -323,6 +323,7 @@ extern Object workob; #define OB_ARROWS 1 #define OB_PLAINAXES 2 #define OB_CIRCLE 3 +#define OB_SINGLE_ARROW 4 /* boundtype */ #define OB_BOUND_BOX 0 diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 3e03b3deaba..d3169168305 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -3826,8 +3826,8 @@ static void editing_panel_links(Object *ob) xco, 154, 130,20, 0, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); - uiDefButC(block, MENU, REDRAWVIEW3D, "Empty Drawtype%t|Arrows%x1|Plain Axes%x2", - xco, 128, 140, 20, &ob->empty_drawtype, 0, 0, 0, 0, "Selects the Empty display type"); + uiDefButC(block, MENU, REDRAWVIEW3D, "Empty Drawtype%t|Arrows%x1|Single Arrow%x4|Plain Axes%x2", + xco, 128, 140, 20, &ob->empty_drawtype, 0, 0, 0, 0, "The Empty 3D View display style"); uiDefButF(block, NUM, REDRAWVIEW3D, "Size:", xco, 108, 140, 21, &ob->empty_drawsize, 0.01, 10.0, 1, 0, "The size to display the Empty"); uiBlockEndAlign(block); diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index dd82be68af4..2df2e771696 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -256,6 +256,9 @@ static float cube[8][3] = { void drawaxes(float size, int flag, char drawtype) { int axis; + float v1[3]= {0.0, 0.0, 0.0}; + float v2[3]= {0.0, 0.0, 0.0}; + float v3[3]= {0.0, 0.0, 0.0}; switch(drawtype) { @@ -274,6 +277,39 @@ void drawaxes(float size, int flag, char drawtype) glEnd(); } break; + case OB_SINGLE_ARROW: + + glBegin(GL_LINES); + /* in positive z direction only */ + v1[2]= size; + glVertex3fv(v1); + glVertex3fv(v2); + glEnd(); + + /* square pyramid */ + glBegin(GL_TRIANGLES); + + v2[0]= size*0.035; v2[1] = size*0.035; + v3[0]= size*-0.035; v3[1] = size*0.035; + v2[2]= v3[2]= size*0.75; + + for (axis=0; axis<4; axis++) { + if (axis % 2 == 1) { + v2[0] *= -1; + v3[1] *= -1; + } else { + v2[1] *= -1; + v3[0] *= -1; + } + + glVertex3fv(v1); + glVertex3fv(v2); + glVertex3fv(v3); + + } + glEnd(); + + break; case OB_ARROWS: default: for (axis=0; axis<3; axis++) { |