mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-16 12:49:59 +01:00
First operational implementation of Displays View
This commit is contained in:
@@ -220,6 +220,7 @@ Handles::Handles(Type type) : Node(), type_(type)
|
||||
static Mesh *handle_menu = new Mesh("mesh/border_handles_menu.ply");
|
||||
static Mesh *handle_lock = new Mesh("mesh/border_handles_lock.ply");
|
||||
static Mesh *handle_unlock = new Mesh("mesh/border_handles_lock_open.ply");
|
||||
static Mesh *handle_eyeslash = new Mesh("mesh/icon_eye_slash.ply");
|
||||
static Mesh *handle_shadow = new Mesh("mesh/border_handles_shadow.ply", "images/soft_shadow.dds");
|
||||
|
||||
if ( type_ == Handles::ROTATE ) {
|
||||
@@ -240,6 +241,9 @@ Handles::Handles(Type type) : Node(), type_(type)
|
||||
else if ( type_ == Handles::UNLOCKED ) {
|
||||
handle_ = handle_unlock;
|
||||
}
|
||||
else if ( type_ == Handles::EYESLASHED ) {
|
||||
handle_ = handle_eyeslash;
|
||||
}
|
||||
else {
|
||||
handle_ = handle_corner;
|
||||
}
|
||||
@@ -371,7 +375,7 @@ void Handles::draw(glm::mat4 modelview, glm::mat4 projection)
|
||||
// 1. Fixed displacement by (0.12,0.12) along the rotation..
|
||||
ctm = GlmToolkit::transform(glm::vec4(0.f), rot, mirror);
|
||||
glm::vec4 pos = ctm * glm::vec4(mirror.x * 0.12f, mirror.x * 0.12f, 0.f, 1.f);
|
||||
// 2. ..from the bottom right corner (1,-1)
|
||||
// 2. ..from the bottom left corner (-1,-1)
|
||||
vec = ( modelview * glm::vec4(-1.f, -1.f, 0.f, 1.f) ) + pos;
|
||||
ctm = GlmToolkit::transform(vec, rot, mirror);
|
||||
// 3. draw
|
||||
@@ -402,6 +406,18 @@ void Handles::draw(glm::mat4 modelview, glm::mat4 projection)
|
||||
shadow_->draw( ctm, projection );
|
||||
handle_->draw( ctm, projection );
|
||||
}
|
||||
else if ( type_ == Handles::EYESLASHED ){
|
||||
// one icon in bottom right corner
|
||||
// 1. Fixed displacement by (0.12,0.12) along the rotation..
|
||||
ctm = GlmToolkit::transform(glm::vec4(0.f), rot, mirror);
|
||||
glm::vec4 pos = ctm * glm::vec4(mirror.x * 0.15f, mirror.x * 0.15f, 0.f, 1.f);
|
||||
// 2. ..from the bottom left corner (-1,-1)
|
||||
vec = ( modelview * glm::vec4(-1.f, -1.f, 0.f, 1.f) ) + pos;
|
||||
ctm = GlmToolkit::transform(vec, rot, mirror);
|
||||
// 3. draw
|
||||
shadow_->draw( ctm, projection );
|
||||
handle_->draw( ctm, projection );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,8 +475,8 @@ Symbol::Symbol(Type t, glm::vec3 pos) : Node(), type_(t)
|
||||
shadows[EYE] = shadow;
|
||||
icons[EYESLASH] = new Mesh("mesh/icon_eye_slash.ply");
|
||||
shadows[EYESLASH] = shadow;
|
||||
icons[VECTORSLASH] = new Mesh("mesh/icon_vector_square_slash.ply");
|
||||
shadows[VECTORSLASH] = shadow;
|
||||
icons[TELEVISION] = new Mesh("mesh/icon_tv.ply");
|
||||
shadows[TELEVISION] = shadow;
|
||||
icons[ARROWS] = new Mesh("mesh/icon_rightarrow.ply");
|
||||
shadows[ARROWS] = shadow;
|
||||
icons[ROTATION] = new Mesh("mesh/border_handles_rotation.ply");
|
||||
|
||||
Reference in New Issue
Block a user