Somewhat working camera

This commit is contained in:
Dynamitos
2022-03-19 22:45:30 +01:00
parent 84049a762c
commit cd28e433cc
41 changed files with 602 additions and 496 deletions
+35 -23
View File
@@ -74,23 +74,23 @@ void Actor::detachChild(PActor child)
child->setParent(nullptr);
child->notifySceneAttach(nullptr);
}
void Actor::setWorldLocation(Vector location)
{
rootComponent->setWorldLocation(location);
}
void Actor::setWorldRotation(Quaternion rotation)
{
rootComponent->setWorldRotation(rotation);
}
void Actor::setWorldRotation(Vector rotation)
{
rootComponent->setWorldRotation(rotation);
}
void Actor::setWorldScale(Vector scale)
{
rootComponent->setWorldScale(scale);
}
//void Actor::setAbsoluteLocation(Vector location)
//{
// rootComponent->setWorldLocation(location);
//}
//
//void Actor::setAbsoluteRotation(Quaternion rotation)
//{
// rootComponent->setAbsoluteRotation(rotation);
//}
//void Actor::setAbsoluteRotation(Vector rotation)
//{
// rootComponent->setAbsoluteRotation(rotation);
//}
//void Actor::setWorldScale(Vector scale)
//{
// rootComponent->setWorldScale(scale);
//}
void Actor::setRelativeLocation(Vector location)
{
rootComponent->setRelativeLocation(location);
@@ -107,17 +107,29 @@ void Actor::setRelativeScale(Vector scale)
{
rootComponent->setRelativeScale(scale);
}
void Actor::addWorldTranslation(Vector translation)
//void Actor::addAbsoluteTranslation(Vector translation)
//{
// rootComponent->addAbsoluteTranslation(translation);
//}
//void Actor::addAbsoluteRotation(Quaternion rotation)
//{
// rootComponent->addAbsoluteRotation(rotation);
//}
//void Actor::addAbsoluteRotation(Vector rotation)
//{
// rootComponent->addAbsoluteRotation(rotation);
//}
void Actor::addRelativeLocation(Vector translation)
{
rootComponent->addWorldTranslation(translation);
rootComponent->addRelativeLocation(translation);
}
void Actor::addWorldRotation(Quaternion rotation)
void Actor::addRelativeRotation(Quaternion rotation)
{
rootComponent->addWorldRotation(rotation);
rootComponent->addRelativeRotation(rotation);
}
void Actor::addWorldRotation(Vector rotation)
void Actor::addRelativeRotation(Vector rotation)
{
rootComponent->addWorldRotation(rotation);
rootComponent->addRelativeRotation(rotation);
}
PComponent Actor::getRootComponent()
{
+11 -7
View File
@@ -26,19 +26,23 @@ public:
void addChild(PActor child);
void detachChild(PActor child);
Array<PActor> getChildren();
void setWorldLocation(Vector location);
void setWorldRotation(Quaternion rotation);
void setWorldRotation(Vector rotation);
void setWorldScale(Vector scale);
//void setAbsoluteLocation(Vector location);
//void setAbsoluteRotation(Quaternion rotation);
//void setAbsoluteRotation(Vector rotation);
//void setWorldScale(Vector scale);
void setRelativeLocation(Vector location);
void setRelativeRotation(Quaternion rotation);
void setRelativeRotation(Vector rotation);
void setRelativeScale(Vector scale);
void addWorldTranslation(Vector translation);
void addWorldRotation(Quaternion rotation);
void addWorldRotation(Vector rotation);
//void addAbsoluteTranslation(Vector translation);
//void addAbsoluteRotation(Quaternion rotation);
//void addAbsoluteRotation(Vector rotation);
void addRelativeLocation(Vector translation);
void addRelativeRotation(Quaternion rotation);
void addRelativeRotation(Vector rotation);
PComponent getRootComponent();
void setRootComponent(PComponent newRoot);
-2
View File
@@ -14,8 +14,6 @@ CameraActor::CameraActor()
cameraComponent->aspectRatio = 1.777778f;
cameraComponent->setParent(sceneComponent);
cameraComponent->setOwner(this);
addWorldTranslation(Vector(0, 0, 50));
addWorldRotation(Vector(0, -100, 0));
}
CameraActor::~CameraActor()