Created
March 1, 2013 20:38
-
-
Save lpberg/5067603 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local getRoomToWorld = function() | |
return RelativeTo.World:getInverseMatrix() | |
end | |
--- This is a HIDEOUS HACK @todo | |
local matrixMult = function(a, b) | |
local val = osg.Matrixd(a) | |
val:preMult(b) | |
return val | |
end | |
local transformMatrixRoomToWorld = function(m) | |
return matrixMult(getRoomToWorld(), m) | |
end | |
local transformPointRoomToWorld = function(v) | |
return getRoomToWorld():preMult(v) | |
end | |
local transformDirectionRoomToWorld = function(v) | |
return getRoomToWorld():preMult(osg.Vec4d(v,0)) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment