Added simple Light and Physics scenes (#4)

This commit is contained in:
Rafał Mikrut
2020-11-07 17:36:23 +01:00
committed by GitHub
parent 696f3d3d3d
commit a96aed257d
31 changed files with 840 additions and 65 deletions

View File

@@ -0,0 +1,10 @@
extends Camera
var speed = 1
var curr = 0
func _process(delta):
curr += delta * speed
look_at_from_position(Vector3(cos(curr) * 3, 0, sin(curr) * 3), Vector3.ZERO, Vector3(0, 1, 0))

View File

@@ -0,0 +1,10 @@
extends DirectionalLight
var speed = 1.2
var curr = 0
func _process(delta):
curr += delta * speed
rotation = Vector3(sin(curr) * speed, cos(curr) * speed, sin(8 * curr) * speed)

View File

@@ -0,0 +1,47 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Rendering/Lights3D/Camera.gd" type="Script" id=1]
[ext_resource path="res://Rendering/Lights3D/DirectionalLight.gd" type="Script" id=2]
[ext_resource path="res://Rendering/Lights3D/OmniLight.gd" type="Script" id=3]
[ext_resource path="res://Rendering/Lights3D/SpotLight.gd" type="Script" id=4]
[node name="Lights3D" type="Spatial"]
[node name="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.87313 )
script = ExtResource( 1 )
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10.521, 0 )
light_color = Color( 0.458824, 0.690196, 0.988235, 1 )
script = ExtResource( 2 )
[node name="OmniLight" type="OmniLight" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5.0767, 0 )
light_color = Color( 0.556863, 0, 0, 1 )
script = ExtResource( 3 )
[node name="SpotLight" type="SpotLight" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 4.09376 )
light_color = Color( 0.478431, 0.266667, 1, 1 )
spot_range = 8.6
script = ExtResource( 4 )
[node name="Boxes" type="Spatial" parent="."]
[node name="CSGBox" type="CSGBox" parent="Boxes"]
width = 0.782
height = 1.07
depth = 1.12259
[node name="CSGBox2" type="CSGBox" parent="Boxes"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.437537, 0.150547, -0.302456 )
width = 0.782
height = 1.583
depth = 0.394
[node name="CSGBox3" type="CSGBox" parent="Boxes"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.699736, 0.150547, -0.302456 )
width = 0.342
height = 0.521
depth = 0.394

View File

@@ -0,0 +1,10 @@
extends OmniLight
var speed = 0.2
var curr = 0
func _process(delta):
curr += delta * speed
look_at_from_position(Vector3(cos(curr) * 3, sin(curr * curr) * 3, sin(curr) * 3), Vector3.ZERO, Vector3(0, 1, 0))

View File

@@ -0,0 +1,10 @@
extends SpotLight
var speed = 0.3
var curr = 0
func _process(delta):
curr += delta * speed
look_at_from_position(Vector3(cos(curr) * 3, sin(curr * curr) * 3, sin(curr) * 3), Vector3.ZERO, Vector3(0, 1, 0))