Skip to content

Commit

Permalink
Set up wheel rotation axes
Browse files Browse the repository at this point in the history
  • Loading branch information
manforowicz committed Apr 25, 2023
1 parent 3e75320 commit 637d35a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions cube_sat.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@

[node name="base" parent="." instance=ExtResource("1_jxnbk")]

[node name="wheel1_s" type="Node3D" parent="."]
[node name="wheel1" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.848048, -0.529919, 0, 0.529919, 0.848048, -1.2615, 1.4606, 0.319901)
script = ExtResource("3_k8xaf")

[node name="wheel1" parent="wheel1_s" instance=ExtResource("2_7bbpg")]
[node name="wheel1_model" parent="wheel1" instance=ExtResource("2_7bbpg")]
transform = Transform3D(1, 0, 0, 0, 0.848048, 0.529919, 0, -0.529919, 0.848048, 1.2615, -1.40818, 0.502707)

[node name="wheel2_s" type="Node3D" parent="."]
[node name="wheel2" type="Node3D" parent="."]
transform = Transform3D(-4.37114e-08, 0.529919, 0.848048, 0, 0.848048, -0.529919, -1, -2.31635e-08, -3.70694e-08, 0.31072, 1.46108, 1.26162)
script = ExtResource("3_k8xaf")

[node name="wheel2" parent="wheel2_s" instance=ExtResource("3_i4bun")]
[node name="wheel2_model" parent="wheel2" instance=ExtResource("3_i4bun")]
transform = Transform3D(-4.37114e-08, 0, -1, 0.529919, 0.848048, -2.31635e-08, 0.848048, -0.529919, -3.70694e-08, 1.26162, -1.40373, 0.51075)

[node name="wheel3_s" type="Node3D" parent="."]
[node name="wheel3" type="Node3D" parent="."]
transform = Transform3D(-1, 4.6327e-08, 7.41387e-08, 0, 0.848048, -0.529919, -8.74228e-08, -0.529919, -0.848048, 1.2626, 1.45715, -0.320415)
script = ExtResource("3_k8xaf")

[node name="wheel3" parent="wheel3_s" instance=ExtResource("4_fogof")]
[node name="wheel3_model" parent="wheel3" instance=ExtResource("4_fogof")]
transform = Transform3D(-1, 0, -8.74228e-08, 4.6327e-08, 0.848048, -0.529919, 7.41387e-08, -0.529919, -0.848048, 1.2626, -1.40553, 0.500446)

[node name="wheel4_s" type="Node3D" parent="."]
[node name="wheel4" type="Node3D" parent="."]
transform = Transform3D(-4.37114e-08, -0.529919, -0.848048, 0, 0.848048, -0.529919, 1, -2.31635e-08, -3.70694e-08, -0.324512, 1.4571, -1.25987)
script = ExtResource("3_k8xaf")

[node name="wheel4" parent="wheel4_s" instance=ExtResource("5_s3a6f")]
[node name="wheel4_model" parent="wheel4" instance=ExtResource("5_s3a6f")]
transform = Transform3D(-4.37114e-08, 0, 1, -0.529919, 0.848048, -2.31635e-08, -0.848048, -0.529919, -3.70694e-08, 1.25987, -1.40766, 0.496943)
10 changes: 5 additions & 5 deletions wheel.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends Node3D

@export var axis: Vector3
const angle: float = deg_to_rad(32)
@export var rpm: float = 1.0
const inertia: float = 1.0

# Called when the node enters the scene tree for the first time.
func _ready():
Expand All @@ -10,8 +10,8 @@ func _ready():

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
animate()
animate(delta)


func animate():
rotate_object_local(Vector3(0, 0, 1), 0.05)
func animate(delta):
rotate_object_local(Vector3(0, 0, 1), rpm * delta)
6 changes: 3 additions & 3 deletions world.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ environment = SubResource("Environment_crkvp")
transform = Transform3D(1, 0, 0, 0, 0.861594, 0.507599, 0, -0.507599, 0.861594, 0, 2.73016, 4.33441)
current = true

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Camera3D"]
transform = Transform3D(1, 0, 0, 0, 0.997819, -0.0660129, 0, 0.0660129, 0.997819, 0, -0.0163116, 0.120244)

[node name="CubeSat" parent="." instance=ExtResource("2_w2af2")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.0125639)

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5.83022, 0)

0 comments on commit 637d35a

Please sign in to comment.