Update for more recent Godot

master
Marc Gilleron 2018-02-04 14:34:22 +01:00
parent 83e50483e7
commit 74f73b50c7
7 changed files with 37 additions and 5 deletions

View File

@ -28,7 +28,7 @@ func get_pointed_voxel():
return hit
func _fixed_process(delta):
func _physics_process(delta):
if _terrain == null:
return
@ -65,7 +65,7 @@ func _fixed_process(delta):
func can_place_voxel_at(pos):
var space_state = get_viewport().get_world().get_direct_space_state()
var params = PhysicsShapeQueryParameters.new()
params.set_collision_layer(COLLISION_LAYER_AVATAR)
params.collision_mask = COLLISION_LAYER_AVATAR
params.set_transform(Transform(Basis(), pos + Vector3(1,1,1)*0.5))
var shape = BoxShape.new()
var ex = 0.5

View File

@ -118,4 +118,4 @@ static func calculate_y_offset(box, other, motion_y):
static func box_from_center_extents(center, extents):
return Rect3(center - extents, 2.0*extents)
return AABB(center - extents, 2.0*extents)

View File

@ -35,7 +35,7 @@ func _input(event):
print("Vsync: ", OS.is_vsync_enabled())
func _fixed_process(delta):
func _physics_process(delta):
var forward = _head.get_transform().basis.z.normalized()
forward = Plane(Vector3(0, 1, 0), 0).project(forward)
@ -121,7 +121,7 @@ func move_with_box_physics(motion):
var voxel_type = voxels.get_voxel(x,y,z, 0)
if voxel_type != 0:
var voxel_box = Rect3(Vector3(x,y,z), Vector3(1,1,1))
var voxel_box = AABB(Vector3(x,y,z), Vector3(1,1,1))
potential_boxes.append(voxel_box)
#debug3d.draw_wire_box(voxel_box)

View File

@ -4,6 +4,14 @@ importer="texture"
type="StreamTexture"
path="res://.import/crosshair.png-b7f9cb2e0fc32a087972fec001d3421e.stex"
[deps]
source_file="res://crosshair.png"
source_md5="e0e5e462c5fbccc9a82ae4c611ec4a18"
dest_files=[ "res://.import/crosshair.png-b7f9cb2e0fc32a087972fec001d3421e.stex" ]
dest_md5="14f65ad2b588350a186af38f3106c4d7"
[params]
compress/mode=0

View File

@ -4,6 +4,14 @@ importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
[deps]
source_file="res://icon.png"
source_md5="86aa1d9e8afaf5ec9cabb7e89945c7a8"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
dest_md5="3364e3cd572841d7e22cf649a135919e"
[params]
compress/mode=0

View File

@ -4,6 +4,14 @@ importer="texture"
type="StreamTexture"
path="res://.import/noise_distorted.png-a3823ac1452b83d7bf69c4608544df15.stex"
[deps]
source_file="res://noise_distorted.png"
source_md5="3048d4e9921396cabc83128c53b31c8e"
dest_files=[ "res://.import/noise_distorted.png-a3823ac1452b83d7bf69c4608544df15.stex" ]
dest_md5="37ac926c28fa539457d8a3d41bea0357"
[params]
compress/mode=0

View File

@ -4,6 +4,14 @@ importer="texture"
type="StreamTexture"
path="res://.import/terrain.png-84a626877af7de08ecf24965bda52835.stex"
[deps]
source_file="res://terrain.png"
source_md5="39c65439c4dd046f804d104884dc02e8"
dest_files=[ "res://.import/terrain.png-84a626877af7de08ecf24965bda52835.stex" ]
dest_md5="02912d20c7908992b9d61bb06c3a9f25"
[params]
compress/mode=3