Switched to Raylib vertion 4.5. Removed some functions and added others. Main changes to camera3D.
This commit is contained in:
@@ -81,7 +81,6 @@ function RL.init()
|
||||
RL.SetCamera3DPosition( camera, pos )
|
||||
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
|
||||
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
|
||||
RL.SetCameraMode( camera, RL.CAMERA_FIRST_PERSON )
|
||||
|
||||
-- for x = 0, 3 do
|
||||
-- for y = 0, 9 do
|
||||
@@ -94,9 +93,9 @@ function RL.init()
|
||||
end
|
||||
|
||||
function RL.draw()
|
||||
RL.UpdateCamera3D( camera )
|
||||
RL.UpdateCamera3D( camera, RL.CAMERA_FIRST_PERSON )
|
||||
pos = RL.GetCamera3DPosition( camera )
|
||||
|
||||
|
||||
-- RL.BeginTextureMode( framebuffer )
|
||||
RL.ClearBackground( { 100, 150, 150 } )
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ function RL.init()
|
||||
RL.SetCamera3DPosition( camera, { 0, 8, 16 } )
|
||||
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
|
||||
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
|
||||
RL.SetCameraMode( camera, RL.CAMERA_FREE )
|
||||
-- RL.SetCameraMode( camera, RL.CAMERA_FREE )
|
||||
|
||||
heigthImage = RL.LoadImage( RL.GetBasePath().."../resources/images/heightmap.png" )
|
||||
|
||||
@@ -58,7 +58,7 @@ function RL.init()
|
||||
RL.DrawTextureRec( tilesetTex, dirtBottomRec, { pos[1] * TILE_SIZE, pos[2] * TILE_SIZE }, RL.WHITE )
|
||||
else
|
||||
RL.DrawTextureRec( tilesetTex, grassRec, { pos[1] * TILE_SIZE, pos[2] * TILE_SIZE }, RL.WHITE )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -67,7 +67,7 @@ function RL.init()
|
||||
material = RL.LoadMaterialDefault()
|
||||
RL.SetTextureSource( RL.TEXTURE_SOURCE_RENDER_TEXTURE )
|
||||
-- RL.GenTextureMipmaps( groundTexture )
|
||||
-- RL.SetTextureFilter( groundTexture, TEXTURE_FILTER_TRILINEAR )
|
||||
-- RL.SetTextureFilter( groundTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetMaterialTexture( material, RL.MATERIAL_MAP_ALBEDO, groundTexture )
|
||||
RL.SetTextureSource( RL.TEXTURE_SOURCE_TEXTURE )
|
||||
|
||||
@@ -76,8 +76,8 @@ end
|
||||
|
||||
function RL.draw()
|
||||
RL.ClearBackground( { 100, 150, 100 } )
|
||||
RL.UpdateCamera3D( camera )
|
||||
|
||||
RL.UpdateCamera3D( camera, RL.CAMERA_FIRST_PERSON )
|
||||
|
||||
RL.BeginMode3D( camera )
|
||||
RL.DrawMesh( mesh, material, matrix )
|
||||
RL.EndMode3D()
|
||||
|
||||
@@ -36,7 +36,6 @@ function RL.init()
|
||||
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
|
||||
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
|
||||
RL.SetCamera3DFovy( camera, 45 )
|
||||
RL.SetCameraMode( camera, RL.CAMERA_ORBITAL )
|
||||
|
||||
-- Define mesh to be instanced
|
||||
cube = RL.GenMeshCube( { 1, 1, 1 } )
|
||||
@@ -84,7 +83,7 @@ function RL.init()
|
||||
end
|
||||
|
||||
function RL.process( delta )
|
||||
RL.UpdateCamera3D( camera )
|
||||
RL.UpdateCamera3D( camera, RL.CAMERA_ORBITAL )
|
||||
|
||||
-- Update the light shader with the camera view position
|
||||
local loc = RL.GetShaderLocationIndex( shader, RL.SHADER_LOC_VECTOR_VIEW )
|
||||
|
||||
@@ -23,7 +23,6 @@ function RL.init()
|
||||
RL.SetCamera3DPosition( camera, { 0, 2, 4 } )
|
||||
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
|
||||
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
|
||||
RL.SetCameraMode( camera, RL.CAMERA_FREE )
|
||||
|
||||
material = RL.CreateMaterial( {
|
||||
maps = {
|
||||
@@ -74,7 +73,7 @@ end
|
||||
|
||||
function RL.draw()
|
||||
RL.ClearBackground( { 100, 150, 100 } )
|
||||
RL.UpdateCamera3D( camera )
|
||||
RL.UpdateCamera3D( camera, RL.CAMERA_FIRST_PERSON )
|
||||
|
||||
RL.BeginMode3D( camera )
|
||||
RL.DrawGrid( 8, 1 )
|
||||
|
||||
@@ -19,7 +19,7 @@ local point = {
|
||||
pos = Vec3:new( 0.2, 0.3, 0.2 ),
|
||||
radius = 0.05,
|
||||
lineLen = 0.5,
|
||||
color = RED,
|
||||
color = RL.RED,
|
||||
}
|
||||
|
||||
local debugText = ""
|
||||
@@ -41,7 +41,6 @@ function RL.init()
|
||||
RL.SetCamera3DPosition( camera, { 0, 1, 2 } )
|
||||
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
|
||||
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
|
||||
RL.SetCameraMode( camera, RL.CAMERA_FREE )
|
||||
|
||||
calcNormal( tri )
|
||||
end
|
||||
@@ -103,7 +102,6 @@ end
|
||||
|
||||
function RL.draw()
|
||||
RL.ClearBackground( { 100, 150, 100 } )
|
||||
RL.UpdateCamera3D( camera )
|
||||
|
||||
RL.BeginMode3D( camera )
|
||||
RL.DrawGrid( 8, 1 )
|
||||
|
||||
@@ -31,7 +31,6 @@ function RL.init()
|
||||
RL.SetCamera3DPosition( camera, { 0, 2, 4 } )
|
||||
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
|
||||
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
|
||||
RL.SetCameraMode( camera, RL.CAMERA_FREE )
|
||||
|
||||
sphereMesh = RL.GenMeshSphere( 1.0, 8, 10 )
|
||||
|
||||
@@ -47,7 +46,7 @@ end
|
||||
|
||||
function RL.draw()
|
||||
RL.ClearBackground( { 100, 150, 100 } )
|
||||
RL.UpdateCamera3D( camera )
|
||||
RL.UpdateCamera3D( camera, RL.CAMERA_FIRST_PERSON )
|
||||
|
||||
RL.BeginMode3D( camera )
|
||||
RL.DrawGrid( 8, 1 )
|
||||
|
||||
Reference in New Issue
Block a user