"Delete" key also deletes

This commit is contained in:
andreja6
2018-04-27 15:27:02 -07:00
parent fcb1ad05fd
commit a99f58b62f
2 changed files with 33 additions and 14 deletions

View File

@@ -8,6 +8,8 @@ Vector3 velocity;
Vector3 rotVelocity;
CoordinateFrame cFrame;
Color3 color;
bool changed = true;
Box itemBox = Box();
PhysicalInstance::PhysicalInstance(void)
{
@@ -31,6 +33,7 @@ void PhysicalInstance::setPosition(Vector3 pos)
{
position = pos;
cFrame = CoordinateFrame(pos);
changed = true;
}
CoordinateFrame PhysicalInstance::getCFrame()
{
@@ -40,6 +43,7 @@ void PhysicalInstance::setCFrame(CoordinateFrame coordinateFrame)
{
cFrame = coordinateFrame;
position = coordinateFrame.translation;
changed = true;
}
CoordinateFrame PhysicalInstance::getCFrameRenderBased()
@@ -49,9 +53,13 @@ CoordinateFrame PhysicalInstance::getCFrameRenderBased()
Box PhysicalInstance::getBox()
{
Box box = Box(Vector3(0+size.x/4, 0+size.y/4, 0+size.z/4) ,Vector3(0-size.x/4,0-size.y/4,0-size.z/4));
CoordinateFrame c = getCFrameRenderBased();
return c.toWorldSpace(box);
if(changed)
{
Box box = Box(Vector3(0+size.x/4, 0+size.y/4, 0+size.z/4) ,Vector3(0-size.x/4,0-size.y/4,0-size.z/4));
CoordinateFrame c = getCFrameRenderBased();
itemBox = c.toWorldSpace(box);
}
return itemBox;
}
PhysicalInstance::~PhysicalInstance(void)