mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 18:11:01 -05:00
Update camera to use double precition.
This commit is contained in:
@@ -73,9 +73,9 @@ namespace openspace {
|
||||
// now working with float precision. To be changed to double later.
|
||||
// The reason double does not work yet is because of the setUniform function
|
||||
// in ghoul::opengl
|
||||
typedef glm::quat Quat;
|
||||
typedef glm::mat4 Mat4;
|
||||
typedef glm::vec3 Vec3;
|
||||
typedef glm::dquat Quat;
|
||||
typedef glm::dmat4 Mat4;
|
||||
typedef glm::dvec3 Vec3;
|
||||
|
||||
// Static constants
|
||||
static const Vec3 _VIEW_DIRECTION_CAMERA_SPACE;
|
||||
@@ -100,7 +100,6 @@ namespace openspace {
|
||||
const Vec3& positionVec3() const;
|
||||
const Vec3& unsynchedPositionVec3() const;
|
||||
const Vec3& focusPositionVec3() const;
|
||||
// Should return const refs
|
||||
const Vec3& viewDirectionWorldSpace() const;
|
||||
const Vec3& lookUpVectorCameraSpace() const;
|
||||
const Vec3& lookUpVectorWorldSpace() const;
|
||||
|
||||
@@ -154,7 +154,7 @@ void RenderablePath::render(const RenderData& data) {
|
||||
|
||||
_programObject->activate();
|
||||
psc currentPosition = data.position;
|
||||
glm::mat4 camrot = data.camera.viewRotationMatrix();
|
||||
glm::mat4 camrot = glm::mat4(data.camera.viewRotationMatrix());
|
||||
glm::mat4 transform = glm::mat4(1);
|
||||
|
||||
// setup the data to the shader
|
||||
|
||||
@@ -187,7 +187,7 @@ bool RenderablePlane::deinitialize() {
|
||||
void RenderablePlane::render(const RenderData& data) {
|
||||
glm::mat4 transform = glm::mat4(1.0);
|
||||
if (_billboard)
|
||||
transform = glm::inverse(data.camera.viewRotationMatrix());
|
||||
transform = glm::inverse(glm::mat4(data.camera.viewRotationMatrix()));
|
||||
|
||||
// Activate shader
|
||||
_shader->activate();
|
||||
|
||||
@@ -148,7 +148,7 @@ void RenderableTrail::render(const RenderData& data) {
|
||||
_programObject->activate();
|
||||
psc currentPosition = data.position;
|
||||
psc campos = data.camera.position();
|
||||
glm::mat4 camrot = data.camera.viewRotationMatrix();
|
||||
glm::mat4 camrot = glm::mat4(data.camera.viewRotationMatrix());
|
||||
|
||||
glm::mat4 transform = glm::mat4(1);
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ bool RenderableDebugPlane::deinitialize() {
|
||||
void RenderableDebugPlane::render(const RenderData& data) {
|
||||
glm::mat4 transform = glm::mat4(1.0);
|
||||
if (_billboard)
|
||||
transform = glm::inverse(data.camera.viewRotationMatrix());
|
||||
transform = glm::inverse(glm::mat4(data.camera.viewRotationMatrix()));
|
||||
|
||||
// Activate shader
|
||||
_shader->activate();
|
||||
|
||||
@@ -124,7 +124,7 @@ void RenderableCrawlingLine::render(const RenderData& data) {
|
||||
// fetch data
|
||||
psc currentPosition = data.position;
|
||||
psc campos = data.camera.position();
|
||||
glm::mat4 camrot = data.camera.viewRotationMatrix();
|
||||
glm::mat4 camrot = glm::mat4(data.camera.viewRotationMatrix());
|
||||
|
||||
glm::mat4 transform = glm::mat4(1);
|
||||
|
||||
|
||||
@@ -1036,7 +1036,7 @@ void ParallelConnection::broadcast(){
|
||||
//create a keyframe with current position and orientation of camera
|
||||
network::datamessagestructures::PositionKeyframe kf;
|
||||
kf._position = OsEng.interactionHandler().camera()->position();
|
||||
kf._viewRotationQuat = glm::quat_cast(OsEng.interactionHandler().camera()->viewRotationMatrix());
|
||||
kf._viewRotationQuat = glm::quat_cast(glm::mat4(OsEng.interactionHandler().camera()->viewRotationMatrix()));
|
||||
|
||||
//timestamp as current runtime of OpenSpace instance
|
||||
kf._timeStamp = OsEng.runTime();
|
||||
|
||||
@@ -128,7 +128,7 @@ void Renderable::setPscUniforms(
|
||||
{
|
||||
program.setUniform("campos", camera.position().vec4());
|
||||
program.setUniform("objpos", position.vec4());
|
||||
program.setUniform("camrot", camera.viewRotationMatrix());
|
||||
program.setUniform("camrot", glm::mat4(camera.viewRotationMatrix()));
|
||||
program.setUniform("scaling", camera.scaling());
|
||||
}
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ bool SceneGraphNode::sphereInsideFrustum(const psc& s_pos, const PowerScaledScal
|
||||
const Camera* camera)
|
||||
{
|
||||
// direction the camera is looking at in power scale
|
||||
psc psc_camdir = psc(camera->viewDirectionWorldSpace());
|
||||
psc psc_camdir = psc(glm::vec3(camera->viewDirectionWorldSpace()));
|
||||
|
||||
// the position of the camera, moved backwards in the view direction to encapsulate
|
||||
// the sphere radius
|
||||
|
||||
Reference in New Issue
Block a user