mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-13 14:22:33 -06:00
SurfaceCtrl: quick update
git-svn-id: svn://ultimatepp.org/upp/trunk@14813 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
22c000b9da
commit
e4e8db586a
3 changed files with 16 additions and 2 deletions
|
|
@ -68,7 +68,7 @@ class BoundingBox {
|
|||
loaded = copy.loaded;
|
||||
min = copy.min;
|
||||
max = copy.max;
|
||||
BoundingBoxVertices.Append(copy.BoundingBoxVertices); //This line make all things crash
|
||||
BoundingBoxVertices.Append(copy.BoundingBoxVertices); //This line make the program crash during (clone() function)
|
||||
BoundingBoxVAO = copy.BoundingBoxVAO;
|
||||
BoundingBoxVBO = copy.BoundingBoxVBO;
|
||||
return *this;
|
||||
|
|
|
|||
|
|
@ -186,7 +186,8 @@ namespace Upp{
|
|||
|
||||
MagicCamera& CenterFocus(const Vector<Object3D*>& selectedObj){
|
||||
if(selectedObj.GetCount() > 0){
|
||||
glm::vec3 center = selectedObj[0]->GetBoundingBoxTransformed().GetCenter(); // The crash is occuring here, During copy operator, the Append function on vector make things crash
|
||||
glm::vec3 center = selectedObj[0]->GetBoundingBoxTransformed().GetCenter(); // The crash is occuring here, During copy operator,
|
||||
//the Append function on vector make things crash
|
||||
if(selectedObj.GetCount() > 1){
|
||||
for(int e = 1; e < selectedObj.GetCount(); e++){
|
||||
glm::vec3 center2 = selectedObj[e]->GetBoundingBoxTransformed().GetCenter();
|
||||
|
|
@ -194,6 +195,8 @@ namespace Upp{
|
|||
}
|
||||
}
|
||||
focus = center;
|
||||
}else{
|
||||
focus = glm::vec3(0.0f,0.0f,0.0f);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,18 +120,22 @@ bool SurfaceCtrl::Key(dword key,int count){
|
|||
if( key == K_Z){
|
||||
for(Object3D* obj : SelectedObject)
|
||||
obj->GetTransform().Move(obj->GetTransform().GetUp());
|
||||
camera.CenterFocus(SelectedObject);
|
||||
}
|
||||
if( key == K_S){
|
||||
for(Object3D* obj : SelectedObject)
|
||||
obj->GetTransform().Move(-(obj->GetTransform().GetUp()));
|
||||
camera.CenterFocus(SelectedObject);
|
||||
}
|
||||
if( key == K_Q){
|
||||
for(Object3D* obj : SelectedObject)
|
||||
obj->GetTransform().Move(-(obj->GetTransform().GetRight()));
|
||||
camera.CenterFocus(SelectedObject);
|
||||
}
|
||||
if( key == K_D){
|
||||
for(Object3D* obj : SelectedObject)
|
||||
obj->GetTransform().Move(obj->GetTransform().GetRight());
|
||||
camera.CenterFocus(SelectedObject);
|
||||
}
|
||||
if( key == K_R){
|
||||
/* float data[] = { 230.0f/255.0f, 140.0f/255.0f, 30.0f/255.0f};
|
||||
|
|
@ -269,7 +273,14 @@ void SurfaceCtrl::LeftDown(Point p, dword){
|
|||
SelectedObject.Add(obj);
|
||||
}
|
||||
camera.CenterFocus(SelectedObject);
|
||||
}else{
|
||||
for(Object3D* obj : SelectedObject){
|
||||
obj->ShowBoundingBox(false);
|
||||
}
|
||||
SelectedObject.Clear();
|
||||
camera.ResetFocus();
|
||||
}
|
||||
|
||||
Refresh();
|
||||
}
|
||||
void SurfaceCtrl::LeftUp(Point p, dword){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue