What I have thus far
Camera panning still needs work.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#include "PhysicalInstance.h"
|
||||
|
||||
bool canCollide = true;
|
||||
bool anchored = false;
|
||||
Vector3 size;
|
||||
@@ -8,6 +7,8 @@ Vector3 velocity;
|
||||
Vector3 rotVelocity;
|
||||
CoordinateFrame cFrame;
|
||||
Color3 color;
|
||||
bool changed = true;
|
||||
Box itemBox = Box();
|
||||
|
||||
PhysicalInstance::PhysicalInstance(void)
|
||||
{
|
||||
@@ -31,6 +32,7 @@ void PhysicalInstance::setPosition(Vector3 pos)
|
||||
{
|
||||
position = pos;
|
||||
cFrame = CoordinateFrame(pos);
|
||||
changed = true;
|
||||
}
|
||||
CoordinateFrame PhysicalInstance::getCFrame()
|
||||
{
|
||||
@@ -40,8 +42,24 @@ void PhysicalInstance::setCFrame(CoordinateFrame coordinateFrame)
|
||||
{
|
||||
cFrame = coordinateFrame;
|
||||
position = coordinateFrame.translation;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
CoordinateFrame PhysicalInstance::getCFrameRenderBased()
|
||||
{
|
||||
return CoordinateFrame(getCFrame().rotation,Vector3(getCFrame().translation.x/2, getCFrame().translation.y/2, getCFrame().translation.z/2));
|
||||
}
|
||||
|
||||
Box PhysicalInstance::getBox()
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user