summaryrefslogtreecommitdiff
path: root/extractor/rsw_format.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-01-14 14:38:52 +0100
committerDaniel Weipert <git@mail.dweipert.de>2025-01-14 14:38:52 +0100
commite8f03c4d6a94aa16b3587bdce525cf0cf7c6c6c3 (patch)
treed8d5a78a0872b86c3b40089e465120883669542b /extractor/rsw_format.gd
parentb75cc72c4e10bd652330b6d2bd99f3fd9129a3b3 (diff)
next commit
Diffstat (limited to 'extractor/rsw_format.gd')
-rw-r--r--extractor/rsw_format.gd46
1 files changed, 7 insertions, 39 deletions
diff --git a/extractor/rsw_format.gd b/extractor/rsw_format.gd
index e38dad9..1066168 100644
--- a/extractor/rsw_format.gd
+++ b/extractor/rsw_format.gd
@@ -127,9 +127,9 @@ func convert(name: String, data_path: String) -> Node3D:
var model_root := Node3D.new()
model_root.name = resource.name
model_root.position = resource.get_position() * Vector3(-1, 1, 1)
- model_root.rotate_x(resource.get_rotation().x)
- model_root.rotate_y(resource.get_rotation().y)
- model_root.rotate_z(resource.get_rotation().z)
+ model_root.rotate_x(deg_to_rad(resource.get_rotation().x))
+ model_root.rotate_y(deg_to_rad(resource.get_rotation().y))
+ model_root.rotate_z(deg_to_rad(resource.get_rotation().z))
model_root.scale = resource.get_scale()
node.add_child(model_root)
@@ -177,43 +177,8 @@ func convert(name: String, data_path: String) -> Node3D:
node.add_child(particles, true)
particles.owner = node
- #var ground := MeshInstance3D.new()
- #var mesh := ArrayMesh.new()
- #var surface_tool := SurfaceTool.new()
- #surface_tool.begin(Mesh.PRIMITIVE_TRIANGLES)
- #for surface_idx in gnd.surfaces.size():
- #if surface_idx < 1:
- #continue
- #
- #var surface: GNDFormat.Surface = gnd.surfaces[surface_idx]
- #
- #surface_tool.add_triangle_fan(
- #PackedVector3Array([Vector3(-0.5, -0.5, 0), Vector3(0.5, -0.5, 0), Vector3(-0.5, -0.5, -0.5)]),
- #PackedVector2Array([surface.get_uvs()[Vector2(0, 0)], surface.get_uvs()[Vector2(1, 0)], surface.get_uvs()[Vector2(0, 1)]]),
- #PackedColorArray([surface.get_vertex_color(),surface.get_vertex_color(),surface.get_vertex_color()])
- #)
- #surface_tool.add_triangle_fan(
- #PackedVector3Array([Vector3(0.5, -0.5, 0), Vector3(0.5, -0.5, -0.5), Vector3(-0.5, -0.5, -0.5)]),
- #PackedVector2Array([surface.get_uvs()[Vector2(1, 0)], surface.get_uvs()[Vector2(1, 1)], surface.get_uvs()[Vector2(0, 1)]]),
- #PackedColorArray([surface.get_vertex_color(),surface.get_vertex_color(),surface.get_vertex_color()])
- #)
- #surface_tool.commit(mesh)
- #var material := StandardMaterial3D.new()
- #material.albedo_texture = load("%s/data/texture/%s" % [data_path, gnd.texture_paths[surface.texture_index]])
- #mesh.surface_set_material(0, material)
- #print(surface.get_uvs())
- #break
-
-
- #grid_map.owner = node
-
- #ground.mesh = mesh
- #
- #node.add_child(ground)
- #ground.owner = node
-
var grid_map := gnd.convert(data_path)
- grid_map.name = gnd_file_path.get_basename()
+ grid_map.name = "Ground"
node.add_child(grid_map)
grid_map.owner = node
@@ -393,14 +358,17 @@ class Animated3DModel extends MapResource:
## Byte Type: f32 [br]
## Byte Length: 4
+ ## Type: Degrees
var rotation_x: float
## Byte Type: f32 [br]
## Byte Length: 4
+ ## Type: Degrees
var rotation_y: float
## Byte Type: f32 [br]
## Byte Length: 4
+ ## Type: Degrees
var rotation_z: float
## Byte Type: f32 [br]