mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Initial implementation of handles on sources to manipulate in geometry
view (only resize implemented so far)
This commit is contained in:
19
Scene.cpp
19
Scene.cpp
@@ -5,7 +5,7 @@
|
||||
#include "Visitor.h"
|
||||
#include "GarbageVisitor.h"
|
||||
#include "Log.h"
|
||||
|
||||
#include "GlmToolkit.h"
|
||||
#include "SessionVisitor.h"
|
||||
|
||||
#include <glad/glad.h>
|
||||
@@ -20,18 +20,6 @@
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
//Group *Scene::limbo = new Group;
|
||||
|
||||
glm::mat4 transform(glm::vec3 translation, glm::vec3 rotation, glm::vec3 scale)
|
||||
{
|
||||
glm::mat4 View = glm::translate(glm::identity<glm::mat4>(), translation);
|
||||
View = glm::rotate(View, rotation.x, glm::vec3(1.f, 0.f, 0.f));
|
||||
View = glm::rotate(View, rotation.y, glm::vec3(0.f, 1.f, 0.f));
|
||||
View = glm::rotate(View, rotation.z, glm::vec3(0.f, 0.f, 1.f));
|
||||
glm::mat4 Model = glm::scale(glm::identity<glm::mat4>(), scale);
|
||||
return View * Model;
|
||||
}
|
||||
|
||||
// Node
|
||||
Node::Node() : initialized_(false), visible_(true), refcount_(0)
|
||||
{
|
||||
@@ -63,7 +51,7 @@ void Node::copyTransform(Node *other)
|
||||
void Node::update( float )
|
||||
{
|
||||
// update transform matrix from attributes
|
||||
transform_ = transform(translation_, rotation_, scale_);
|
||||
transform_ = GlmToolkit::transform(translation_, rotation_, scale_);
|
||||
|
||||
}
|
||||
|
||||
@@ -137,6 +125,9 @@ void Primitive::init()
|
||||
if ( elementBuffer_ )
|
||||
glDeleteBuffers ( 1, &elementBuffer_);
|
||||
|
||||
// compute AxisAlignedBoundingBox
|
||||
bbox_.extend(points_);
|
||||
|
||||
// arrays of vertices are not needed anymore (STATIC DRAW of vertex object)
|
||||
points_.clear();
|
||||
colors_.clear();
|
||||
|
||||
Reference in New Issue
Block a user