diff --git a/Decorations.cpp b/Decorations.cpp index 12d2a31..83d0a2b 100644 --- a/Decorations.cpp +++ b/Decorations.cpp @@ -350,7 +350,10 @@ Symbol::Symbol(Type t, glm::vec3 pos) : Node(), type_(t) icons[EMPTY] = new Mesh("mesh/icon_empty.ply"); } + static Mesh *shadow= new Mesh("mesh/border_handles_shadow.ply", "images/soft_shadow.dds"); + symbol_ = icons[type_]; + shadow_ = shadow; translation_ = pos; color = glm::vec4( 1.f, 1.f, 1.f, 1.f); } @@ -365,6 +368,8 @@ void Symbol::draw(glm::mat4 modelview, glm::mat4 projection) if ( !initialized() ) { if(symbol_ && !symbol_->initialized()) symbol_->init(); + if(shadow_ && !shadow_->initialized()) + shadow_->init(); init(); } @@ -391,6 +396,7 @@ void Symbol::draw(glm::mat4 modelview, glm::mat4 projection) // generate matrix ctm = GlmToolkit::transform(tran, rot, sca); + shadow_->draw( ctm, projection ); symbol_->draw( ctm, projection); } } diff --git a/Decorations.h b/Decorations.h index e789b58..d3dadad 100644 --- a/Decorations.h +++ b/Decorations.h @@ -51,8 +51,8 @@ public: glm::vec4 color; protected: - Primitive *handle_; - Primitive *shadow_; + Mesh *handle_; + Mesh *shadow_; glm::vec2 corner_; Type type_; @@ -74,6 +74,7 @@ public: protected: Mesh *symbol_; + Mesh *shadow_; Type type_; }; diff --git a/rsc/mesh/border_handles_shadow.ply b/rsc/mesh/border_handles_shadow.ply index bdb1eac..b784e89 100644 --- a/rsc/mesh/border_handles_shadow.ply +++ b/rsc/mesh/border_handles_shadow.ply @@ -14,9 +14,9 @@ property uchar alpha element face 2 property list uchar uint vertex_indices end_header -0.1500000 -0.1500000 0.000000 1.000000 0.000000 255 255 255 45 --0.1500000 0.1500000 0.000000 0.000000 1.000000 255 255 255 45 --0.1500000 -0.1500000 0.000000 0.000000 0.000000 255 255 255 45 -0.1500000 0.1500000 0.000000 1.000000 1.000000 255 255 255 45 +0.1500000 -0.1500000 0.000000 1.000000 0.000000 255 255 255 65 +-0.1500000 0.1500000 0.000000 0.000000 1.000000 255 255 255 65 +-0.1500000 -0.1500000 0.000000 0.000000 0.000000 255 255 255 65 +0.1500000 0.1500000 0.000000 1.000000 1.000000 255 255 255 65 3 0 1 2 3 0 3 1