Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PyryM committed May 10, 2016
1 parent 2662a6a commit beae1ce
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
9 changes: 9 additions & 0 deletions dist/scripts/geometry/pointcloud.t
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ function PointCloudObject:init(hres, vres)
self.mat = self.material
end

function PointCloudObject:setDepthLimits(near, far)
local params = self.mat.depthParams
local a = (far*near) / (far-near)
local b = -near / (far-near)
params.elem.x = a
params.elem.y = b
log.debug("a: " .. a .. ", b: " .. b)
end

function PointCloudObject:setPlaneSize(w,h)
local params = self.mat.pointParams
params.elem.z = w
Expand Down
8 changes: 4 additions & 4 deletions dist/scripts/gfx/texture.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function MemTexture:init(w,h)
self.datasize = w*h*4

local bc = bgfx_const
local flags = 0
-- local flags = bc.BGFX_TEXTURE_MIN_POINT +
-- bc.BGFX_TEXTURE_MAG_POINT +
-- bc.BGFX_TEXTURE_MIP_POINT
--local flags = 0
local flags = bc.BGFX_TEXTURE_MIN_POINT +
bc.BGFX_TEXTURE_MAG_POINT +
bc.BGFX_TEXTURE_MIP_POINT

-- Note that we pass in nil as the data to allow us to update this texture
-- later
Expand Down
6 changes: 4 additions & 2 deletions dist/scripts/utils/stringutils.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ function m.splitLines(str)
end

-- base64 conversion
local b64lut_ = nil
function m.createB64LUT_()
if b64lut_ ~= nil then return b64lut_ end

local letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
local ret = terralib.new(uint8[128])
for i = 0,127 do
Expand All @@ -52,9 +55,8 @@ function m.createB64LUT_()
end
return ret
end
local b64lut_ = nil

terra m.b64decode_terra(src: &int8, srclen: uint32,
terra m.b64decode_terra(src: &uint8, srclen: uint32,
dest: &uint8, destlen: uint32,
lut: &uint8) : uint32
var i: uint32 = 0
Expand Down

0 comments on commit beae1ce

Please sign in to comment.