Update RenderableFov to inherit transform in model matrix

This commit is contained in:
Kalle Bladin
2016-08-19 21:12:12 -04:00
parent d042f6c4be
commit 6d9d2b5127
5 changed files with 33 additions and 35 deletions

View File

@@ -96,10 +96,6 @@ return {
Type = "simple",
Color = "textures/NHTexture.jpg",
},
Rotation = {
Source = "NH_SPACECRAFT",
Destination = "GALACTIC"
},
Shading = {
PerformShading = true,
Fadeable = false,
@@ -126,6 +122,11 @@ return {
Observer = "SUN",
Kernels = NewHorizonsKernels
},
Rotation = {
Type = "SpiceRotation",
SourceFrame = "NH_SPACECRAFT",
DestinationFrame = "GALACTIC",
},
},
GuiName = "/Solar/NewHorizons"
},

View File

@@ -6,7 +6,7 @@ return {
Renderable = {
Type = "RenderableFov",
Body = "NEW HORIZONS",
Frame = "GALACTIC",
Frame = "NH_SPACECRAFT",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",
@@ -33,7 +33,7 @@ return {
Renderable = {
Type = "RenderableFov",
Body = "NEW HORIZONS",
Frame = "GALACTIC",
Frame = "NH_SPACECRAFT",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",
@@ -61,7 +61,7 @@ return {
Renderable = {
Type = "RenderableFov",
Body = "NEW HORIZONS",
Frame = "GALACTIC",
Frame = "NH_SPACECRAFT",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",
@@ -88,7 +88,7 @@ return {
Renderable = {
Type = "RenderableFov",
Body = "NEW HORIZONS",
Frame = "GALACTIC",
Frame = "NH_SPACECRAFT",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",
@@ -116,7 +116,7 @@ return {
Renderable = {
Type = "RenderableFov",
Body = "NEW HORIZONS",
Frame = "GALACTIC",
Frame = "NH_SPACECRAFT",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",
@@ -144,7 +144,7 @@ return {
Renderable = {
Type = "RenderableFov",
Body = "NEW HORIZONS",
Frame = "GALACTIC",
Frame = "NH_SPACECRAFT",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",
@@ -171,7 +171,7 @@ return {
Renderable = {
Type = "RenderableFov",
Body = "NEW HORIZONS",
Frame = "GALACTIC",
Frame = "NH_SPACECRAFT",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",
@@ -198,7 +198,7 @@ return {
Renderable = {
Type = "RenderableFov",
Body = "NEW HORIZONS",
Frame = "GALACTIC",
Frame = "NH_SPACECRAFT",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",
@@ -225,7 +225,7 @@ return {
Renderable = {
Type = "RenderableFov",
Body = "NEW HORIZONS",
Frame = "GALACTIC",
Frame = "NH_SPACECRAFT",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",
@@ -252,7 +252,7 @@ return {
Renderable = {
Type = "RenderableFov",
Body = "NEW HORIZONS",
Frame = "GALACTIC",
Frame = "NH_SPACECRAFT",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",
@@ -279,7 +279,7 @@ return {
Renderable = {
Type = "RenderableFov",
Body = "NEW HORIZONS",
Frame = "GALACTIC",
Frame = "NH_SPACECRAFT",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",

View File

@@ -37,14 +37,9 @@ return {
SourceFrame = "ORX_SPACECRAFT",
DestinationFrame = "GALACTIC",
},
Scale = {
Type = "StaticScale",
Scale = 1,
},
},
GuiName = "/Solar/OsirisRex"
},
{
Name = "ORX_OCAMS_POLYCAM",
Parent = "OsirisRex",
@@ -66,7 +61,6 @@ return {
Ghosting = false,
},
},
Transform = {
Translation = {
Type = "StaticEphemeris",
@@ -77,10 +71,6 @@ return {
SourceFrame = "ORX_OCAMS_POLYCAM",
DestinationFrame = "ORX_SPACECRAFT",
},
Scale = {
Type = "StaticScale",
Scale = 1,
},
},
GuiName = "/Solar/ORX_OCAMS_POLYCAM"
},
@@ -115,12 +105,7 @@ return {
Type = "SpiceRotation",
SourceFrame = "ORX_REXIS",
DestinationFrame = "ORX_SPACECRAFT",
},
Scale = {
Type = "StaticScale",
Scale = 1,
},
},
}, },
GuiName = "/Solar/ORX_REXIS"
},

View File

@@ -133,13 +133,25 @@ return {
},
GuiName = "RosettaCometTrail"
},
{
{
Name = "NAVCAM",
Parent = "Rosetta",
Transform = {
Rotation = {
Type = "SpiceRotation",
SourceFrame = "NAVCAM",
DestinationFrame = "ROS_SPACECRAFT",
},
},
GuiName = "/Solar/Rosetta_navcam"
},
{
Name = "NAVCAM FOV",
Parent = "NAVCAM",
Renderable = {
Type = "RenderableFov",
Body = "ROSETTA",
Frame = "GALACTIC",
Frame = "ROS_NAVCAM-A",
RGB = { 0.8, 0.7, 0.7 },
Textures = {
Type = "simple",

View File

@@ -559,10 +559,10 @@ void RenderableFov::render(const RenderData& data) {
// setup the data to the shader
// Model transform and view transform needs to be in double precision
glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation); /* * // Translation
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation
glm::dmat4(data.modelTransform.rotation) *
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale));
*/
glm::mat4 modelViewProjectionTransform =
data.camera.projectionMatrix() *
glm::mat4(data.camera.combinedViewMatrix() *