diff --git a/README.md b/README.md index 30d7878..7dc8bb7 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,12 @@ This repository is used by the [Open Metaverse Interoperability Group](https://o Extensions implemented in this repository: -| Extension name | Import | Export | Godot version | Link | -| ----------------------- | ------ | ------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| **OMI_physics_joint** | Yes | Yes | 4.1+ | [OMI_physics_joint extension spec](https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_physics_joint) | -| **OMI_seat** | Yes | Yes | 4.0+ | [OMI_seat extension spec](https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_seat) | -| **OMI_spawn_point** | Yes | No | 4.0+ | [OMI_spawn_point extension spec](https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_spawn_point) | +| Extension name | Import | Export | Godot version | Link | +| ------------------------------ | ------ | ------ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| **OMI_physics_gravity** | Yes | Yes | 4.4+ | [OMI_physics_gravity extension spec](https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_physics_gravity) | +| **OMI_physics_joint** | Yes | Yes | 4.1+ | [OMI_physics_joint extension spec](https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_physics_joint) | +| **OMI_seat** | Yes | Yes | 4.0+ | [OMI_seat extension spec](https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_seat) | +| **OMI_spawn_point** | Yes | No | 4.0+ | [OMI_spawn_point extension spec](https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_spawn_point) | Extensions implemented upstream in Godot Engine: diff --git a/addons/omi_extensions/omi_extensions_plugin.gd b/addons/omi_extensions/omi_extensions_plugin.gd index 676e1bd..53d4e33 100644 --- a/addons/omi_extensions/omi_extensions_plugin.gd +++ b/addons/omi_extensions/omi_extensions_plugin.gd @@ -13,6 +13,8 @@ func _enter_tree() -> void: GLTFDocument.register_gltf_document_extension(ext, true) ext = GLTFDocumentExtensionOMISpawnPoint.new() GLTFDocument.register_gltf_document_extension(ext) + ext = GLTFDocumentExtensionOMIPhysicsGravity.new() + GLTFDocument.register_gltf_document_extension(ext, true) ext = GLTFDocumentExtensionOMIPhysicsJoint.new() GLTFDocument.register_gltf_document_extension(ext) add_node_3d_gizmo_plugin(seat_gizmo_plugin) diff --git a/addons/omi_extensions/physics_gravity/custom_gravity_area.gd b/addons/omi_extensions/physics_gravity/custom_gravity_area.gd new file mode 100644 index 0000000..130ccc5 --- /dev/null +++ b/addons/omi_extensions/physics_gravity/custom_gravity_area.gd @@ -0,0 +1,312 @@ +@tool +class_name CustomGravityArea3D +extends Area3D + + +enum CustomGravityType { + DIRECTIONAL, ## Gravity in a direction in local space. + POINT, ## Gravity towards the local origin point. + DISC, ## Gravity towards a filled circle on the local XZ plane. + TORUS, ## Gravity towards a hollow circle on the local XZ plane. + LINE, ## Gravity towards a line defined by points in local space. + SHAPED, ## Gravity towards a shape in local space. +} + +@export var custom_gravity_type: CustomGravityType: + set(value): + custom_gravity_type = value + notify_property_list_changed() + +var direction := Vector3.DOWN +var radius: float = 1.0 +var line_points: PackedVector3Array +var shape: Shape3D + + +func _ready() -> void: + if gravity_space_override == SPACE_OVERRIDE_DISABLED: + push_warning("CustomGravityArea3D has its Area3D gravity override disabled, this node will not have gravity.") + if gravity_type != GRAVITY_TYPE_TARGET: + push_warning("CustomGravityArea3D has its Area3D gravity type not set to target. The CustomGravityArea3D gravity logic will not be used.") + + +func _calculate_gravity_target(local_position: Vector3) -> Vector3: + match custom_gravity_type: + CustomGravityType.DIRECTIONAL: + return local_position + direction + CustomGravityType.POINT: + return Vector3.ZERO + CustomGravityType.DISC: + var flat_position = Vector3(local_position.x, 0.0, local_position.z) + return flat_position.limit_length(radius) + CustomGravityType.TORUS: + var flat_position = Vector3(local_position.x, 0.0, local_position.z) + return flat_position.normalized() * radius + CustomGravityType.LINE: + var closest_point := Vector3.ZERO + var closest_distance_sq: float = INF + for i in range(line_points.size() - 1): + var a: Vector3 = line_points[i] + var b: Vector3 = line_points[i + 1] + var closest: Vector3 = Geometry3D.get_closest_point_to_segment(local_position, a, b) + var distance_sq: float = local_position.distance_squared_to(closest) + if distance_sq < closest_distance_sq: + closest_point = closest + closest_distance_sq = distance_sq + return closest_point + CustomGravityType.SHAPED: + return _get_closest_point_on_shape(shape, local_position) + return Vector3() + + +static func _project_point_onto_triangle(point: Vector3, a: Vector3, b: Vector3, c: Vector3) -> Vector3: + var plane: Plane = Plane(a, b, c) + var projected: Vector3 = plane.project(point) + var bary: Vector3 = Geometry3D.get_triangle_barycentric_coords(projected, a, b, c) + if 0.0 < bary.x and bary.x < 1.0 and 0.0 < bary.y and bary.y < 1.0 and 0.0 < bary.z and bary.z < 1.0: + return projected # If all barycentric coordinates are between 0 and 1, this is on the triangle. + # Else, find which two barycentric coordinates are the greatest, and project onto that line segment. + if bary.x < bary.y and bary.x < bary.z: + return Geometry3D.get_closest_point_to_segment(projected, b, c) + if bary.y < bary.x and bary.y < bary.z: + return Geometry3D.get_closest_point_to_segment(projected, a, c) + return Geometry3D.get_closest_point_to_segment(projected, a, b) + + +static func _get_closest_point_on_shape(shape: Shape3D, point: Vector3) -> Vector3: + if shape is BoxShape3D: + var extents = shape.size * 0.5 + return point.clamp(-extents, extents) + if shape is SphereShape3D: + return point.limit_length(shape.radius) + if shape is CapsuleShape3D: + var mid_extent: float = (shape.height - shape.radius * 2.0) * 0.5 + var projected: Vector3 = Geometry3D.get_closest_point_to_segment(point, Vector3(0.0, -mid_extent, 0.0), Vector3(0.0, mid_extent, 0.0)) + var difference: Vector3 = (point - projected).limit_length(shape.radius) + return projected + difference + if shape is CylinderShape3D: + var extent: float = shape.height * 0.5 + var projected: Vector3 = Geometry3D.get_closest_point_to_segment(point, Vector3(0.0, -extent, 0.0), Vector3(0.0, extent, 0.0)) + var flat_location = Vector3(point.x, 0.0, point.z) + return projected + flat_location.limit_length(shape.radius) + if shape is ConcavePolygonShape3D: + var closest_point := Vector3.ZERO + var closest_distance_sq: float = INF + var faces: PackedVector3Array = shape.get_faces() + for i in range(0, faces.size(), 3): + var on_triangle: Vector3 = _project_point_onto_triangle(point, faces[i], faces[i + 1], faces[i + 2]) + var distance_sq: float = point.distance_squared_to(on_triangle) + if distance_sq < closest_distance_sq: + closest_point = on_triangle + closest_distance_sq = distance_sq + return closest_point + printerr("Unsupported shape: ", shape) + return point + + +func _get_property_list() -> Array[Dictionary]: + var properties: Array[Dictionary] = [] + match custom_gravity_type: + CustomGravityType.DIRECTIONAL: + properties.append({ + "name": "direction", + "type": TYPE_VECTOR3, + "usage": PROPERTY_USAGE_DEFAULT, + }) + CustomGravityType.DISC, CustomGravityType.TORUS: + properties.append({ + "name": "radius", + "type": TYPE_FLOAT, + "usage": PROPERTY_USAGE_DEFAULT, + }) + CustomGravityType.LINE: + properties.append({ + "name": "line_points", + "type": TYPE_PACKED_VECTOR3_ARRAY, + "usage": PROPERTY_USAGE_DEFAULT, + }) + CustomGravityType.SHAPED: + properties.append({ + "name": "shape", + "type": TYPE_OBJECT, + "usage": PROPERTY_USAGE_DEFAULT, + "hint": PROPERTY_HINT_RESOURCE_TYPE, + "hint_string": "Shape3D" + }) + return properties + + +# Everything below this point is for GLTF serialization. +func _get_or_create_state_shapes_in_state(gltf_state: GLTFState) -> Array: + var state_extensions: Dictionary = gltf_state.json.get_or_add("extensions", {}) + if not state_extensions.has("OMI_physics_shape"): + state_extensions["OMI_physics_shape"] = {} + gltf_state.add_used_extension("OMI_physics_shape", false) + var omi_physics_shape_ext: Dictionary = state_extensions["OMI_physics_shape"] + var state_shapes: Array = omi_physics_shape_ext.get_or_add("shapes", []) + return state_shapes + + +func to_dictionary(gltf_state: GLTFState) -> Dictionary: + var ret: Dictionary = area_gravity_to_dictionary(self) + if gravity_type != Area3D.GravityType.GRAVITY_TYPE_TARGET: + return ret + var type_string: String = _gravity_type_enum_to_string(custom_gravity_type) + ret["type"] = type_string + var sub_dict: Dictionary = {} + if custom_gravity_type == CustomGravityType.DIRECTIONAL: + if not direction.is_equal_approx(Vector3.DOWN): + sub_dict = { "direction": [direction.x, direction.y, direction.z] } + else: + if gravity_point_unit_distance != 0.0: + sub_dict = { "unitDistance": gravity_point_unit_distance } + match custom_gravity_type: + CustomGravityType.DISC, CustomGravityType.TORUS: + if radius != 1.0: + sub_dict["radius"] = radius + CustomGravityType.LINE: + var point_numbers: Array = [] + for line_point in line_points: + point_numbers.append(line_point.x) + point_numbers.append(line_point.y) + point_numbers.append(line_point.z) + sub_dict["points"] = point_numbers + CustomGravityType.SHAPED: + var state_shapes: Array = _get_or_create_state_shapes_in_state(gltf_state) + var gltf_shape := GLTFPhysicsShape.from_resource(shape) + sub_dict["shape"] = state_shapes.size() + state_shapes.append(gltf_shape.to_dictionary()) + if not sub_dict.is_empty(): + ret[type_string] = sub_dict + return ret + + +## Functionality common to all Godot Area3D nodes including non-CustomGravityArea3D nodes. +static func area_gravity_to_dictionary(area: Area3D) -> Dictionary: + var ret: Dictionary = {} + var space_override: Area3D.SpaceOverride = area.gravity_space_override + if space_override == Area3D.SpaceOverride.SPACE_OVERRIDE_DISABLED: + return ret + ret["gravity"] = area.gravity + if area.priority != 0: + ret["priority"] = area.priority + if space_override == Area3D.SpaceOverride.SPACE_OVERRIDE_REPLACE: + ret["replace"] = true + ret["stop"] = true + elif space_override == Area3D.SpaceOverride.SPACE_OVERRIDE_COMBINE_REPLACE: + ret["stop"] = true + elif space_override == Area3D.SpaceOverride.SPACE_OVERRIDE_REPLACE_COMBINE: + ret["replace"] = true + if area.gravity_type == Area3D.GravityType.GRAVITY_TYPE_DIRECTIONAL: + var dir: Vector3 = area.gravity_direction * area.global_basis.orthonormalized() + if not dir.is_equal_approx(Vector3.DOWN): + ret["directional"] = { "direction": [dir.x, dir.y, dir.z] } + ret["type"] = "directional" + elif area.gravity_type == Area3D.GravityType.GRAVITY_TYPE_POINT: + var unit_dist: float = area.gravity_point_unit_distance + if unit_dist != 0.0: + ret["point"] = { "unitDistance": unit_dist } + ret["type"] = "point" + return ret + + +static func from_dictionary(dict: Dictionary, gltf_state: GLTFState) -> CustomGravityArea3D: + if "type" not in dict: + printerr('GLTF gravity import: Missing required field "type", expected "directional", "point", "disc", "torus", "line", or "shaped".') + return null + if "gravity" not in dict: + printerr('GLTF gravity import: Missing required field "gravity", expected a number in meters per second squared.') + return null + var type_string = dict.get("type") + if type_string not in ["directional", "point", "disc", "torus", "line", "shaped"]: + printerr("GLTF gravity import: Invalid gravity type, found: ", dict.get("type"), ' but expected "directional", "point", "disc", "torus", "line", or "shaped".') + return null + var gravity_amount = dict.get("gravity") + if not gravity_amount is float: # All JSON numbers are floats. + printerr("GLTF gravity import: Invalid gravity, found: ", dict.get("gravity"), ' but expected a number.') + return null + var ret: CustomGravityArea3D = CustomGravityArea3D.new() + ret.gravity_type = Area3D.GRAVITY_TYPE_TARGET + ret.custom_gravity_type = _gravity_type_string_to_enum(type_string) + ret.gravity = gravity_amount + var priority = dict.get("priority") + if priority is float: # All JSON numbers are floats. + ret.priority = priority + var replace: bool = dict.get("replace", false) + var stop: bool = dict.get("stop", false) + if replace and stop: + ret.gravity_space_override = Area3D.SpaceOverride.SPACE_OVERRIDE_REPLACE + elif stop: + ret.gravity_space_override = Area3D.SpaceOverride.SPACE_OVERRIDE_COMBINE_REPLACE + elif replace: + ret.gravity_space_override = Area3D.SpaceOverride.SPACE_OVERRIDE_REPLACE_COMBINE + else: + ret.gravity_space_override = Area3D.SpaceOverride.SPACE_OVERRIDE_COMBINE + var sub_dict = dict.get(type_string) + if not sub_dict is Dictionary: + return ret + var direction = sub_dict.get("direction") + if direction is Array: + ret.direction = Vector3(direction[0], direction[1], direction[2]) + var unit_distance = sub_dict.get("unitDistance") + if unit_distance is float: + ret.gravity_point_unit_distance = unit_distance + var radius = sub_dict.get("radius") + if radius is float: + ret.radius = radius + var points = sub_dict.get("points") + if points is Array: + var packed_points := PackedVector3Array() + for i in range(0, points.size(), 3): + packed_points.append(Vector3(points[i], points[i + 1], points[i + 2])) + ret.line_points = packed_points + var shape = sub_dict.get("shape") + if shape is float: # Integer but all JSON numbers are floats. + var shape_index: int = shape + if shape_index < 0: + printerr("GLTF gravity import: Invalid shape index, found: ", shape, " but expected a non-negative integer.") + return ret + var state_shapes: Array = gltf_state.get_additional_data(&"GLTFPhysicsShapes") + if shape_index >= state_shapes.size(): + printerr("GLTF gravity import: Shape index ", shape_index, " is out of bounds (size=", state_shapes.size(), ").") + return ret + var gltf_shape: GLTFPhysicsShape = state_shapes[shape_index] + ret.shape = gltf_shape.to_resource(true) + return ret + + +static func _gravity_type_enum_to_string(type: CustomGravityType) -> String: + # The type value may be set to `"directional"`, `"point"`, `"disc"`, `"torus"`, `"line"`, or `"shaped"`. + match type: + CustomGravityType.DIRECTIONAL: + return "directional" + CustomGravityType.POINT: + return "point" + CustomGravityType.DISC: + return "disc" + CustomGravityType.TORUS: + return "torus" + CustomGravityType.LINE: + return "line" + CustomGravityType.SHAPED: + return "shaped" + assert(false, "GLTF gravity export: Invalid gravity type.") + return "" + + +static func _gravity_type_string_to_enum(type: String) -> CustomGravityType: + match type: + "directional": + return CustomGravityType.DIRECTIONAL + "point": + return CustomGravityType.POINT + "disc": + return CustomGravityType.DISC + "torus": + return CustomGravityType.TORUS + "line": + return CustomGravityType.LINE + "shaped": + return CustomGravityType.SHAPED + printerr("GLTF gravity import: Unknown gravity type: ", type) + return CustomGravityType.DIRECTIONAL diff --git a/addons/omi_extensions/physics_gravity/global_gravity_setter.gd b/addons/omi_extensions/physics_gravity/global_gravity_setter.gd new file mode 100644 index 0000000..83ba2f9 --- /dev/null +++ b/addons/omi_extensions/physics_gravity/global_gravity_setter.gd @@ -0,0 +1,13 @@ +class_name GlobalGravitySetter +extends Node + + +@export var gravity: float = 9.80665 +@export var direction: Vector3 = Vector3.DOWN + + +func _ready() -> void: + var world_space_rid: RID = get_viewport().find_world_3d().space + PhysicsServer3D.area_set_param(world_space_rid, PhysicsServer3D.AREA_PARAM_GRAVITY, gravity) + PhysicsServer3D.area_set_param(world_space_rid, PhysicsServer3D.AREA_PARAM_GRAVITY_VECTOR, direction) + queue_free() diff --git a/addons/omi_extensions/physics_gravity/omi_physics_gravity_doc_ext.gd b/addons/omi_extensions/physics_gravity/omi_physics_gravity_doc_ext.gd new file mode 100644 index 0000000..3d79ff6 --- /dev/null +++ b/addons/omi_extensions/physics_gravity/omi_physics_gravity_doc_ext.gd @@ -0,0 +1,122 @@ +@tool +class_name GLTFDocumentExtensionOMIPhysicsGravity +extends GLTFDocumentExtension + + +## Writes the project's global gravity into the document-level glTF extension. +@export var write_global_gravity: bool = false: + set(value): + write_global_gravity = value + notify_property_list_changed() + +var global_gravity_direction := Vector3.DOWN +var global_gravity_amount: float = 9.80665 + + +# Import process. +func _import_preflight(gltf_state: GLTFState, extensions: PackedStringArray) -> Error: + if not extensions.has("OMI_physics_gravity"): + return ERR_SKIP + var state_json = gltf_state.get_json() + if not state_json.has("extensions"): + return OK + var state_extensions: Dictionary = state_json["extensions"] + if not state_extensions.has("OMI_physics_gravity"): + return OK + # If this point is reached, the gravity extension is defined on + # the document-level, which means the GLTF defines global gravity. + var omi_physics_gravity_doc_ext: Dictionary = state_extensions["OMI_physics_gravity"] + gltf_state.set_additional_data("GLTFPhysicsGlobalGravity", omi_physics_gravity_doc_ext) + return OK + + +func _get_supported_extensions() -> PackedStringArray: + return PackedStringArray(["OMI_physics_gravity"]) + + +func _parse_node_extensions(gltf_state: GLTFState, gltf_node: GLTFNode, extensions: Dictionary) -> Error: + if extensions.has("OMI_physics_gravity"): + var omi_gravity_ext = extensions["OMI_physics_gravity"] + gltf_node.set_additional_data("GLTFPhysicsGravity", omi_gravity_ext) + return OK + + +func _generate_scene_node(gltf_state: GLTFState, gltf_node: GLTFNode, scene_parent: Node) -> Node3D: + var gravity_dict = gltf_node.get_additional_data("GLTFPhysicsGravity") + if gravity_dict is Dictionary and not gravity_dict.is_empty(): + var custom_grav := CustomGravityArea3D.from_dictionary(gravity_dict, gltf_state) + if custom_grav != null: + var trigger_shape = gltf_node.get_additional_data("GLTFPhysicsTriggerShape") + if trigger_shape is GLTFPhysicsShape: + var shape_node: CollisionShape3D = trigger_shape.to_node(true) + shape_node.name = gltf_node.get_name() + "Shape" + custom_grav.add_child(shape_node) + return custom_grav + return null + + +func _import_post(gltf_state: GLTFState, root: Node) -> Error: + var global_gravity_dict = gltf_state.get_additional_data("GLTFPhysicsGlobalGravity") + if global_gravity_dict is Dictionary: + var setter_node := GlobalGravitySetter.new() + var direction = global_gravity_dict.get("direction") + if direction is Array: + setter_node.direction = Vector3(direction[0], direction[1], direction[2]) + var gravity = global_gravity_dict.get("gravity") + if gravity is float: + setter_node.gravity = gravity + setter_node.name = &"GlobalGravitySetter" + root.add_child(setter_node) + setter_node.owner = root + return OK + + +# Export process. +func _get_property_list() -> Array[Dictionary]: + var properties: Array[Dictionary] = [] + if write_global_gravity: + properties.append({ + "name": "global_gravity_direction", + "type": TYPE_VECTOR3, + "usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_SCRIPT_VARIABLE, + }) + properties.append({ + "name": "global_gravity_amount", + "type": TYPE_FLOAT, + "usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_SCRIPT_VARIABLE, + }) + return properties + + +func _export_preflight(gltf_state: GLTFState, root: Node) -> Error: + if not write_global_gravity: + return OK + var extensions: Dictionary = gltf_state.json.get_or_add("extensions", {}) + var world_space_rid: RID = root.get_viewport().find_world_3d().space + var omi_gravity_doc_ext: Dictionary = {} + if not global_gravity_direction.is_equal_approx(Vector3.DOWN): + omi_gravity_doc_ext["direction"] = [global_gravity_direction.x, global_gravity_direction.y, global_gravity_direction.z] + omi_gravity_doc_ext["gravity"] = global_gravity_amount + extensions["OMI_physics_gravity"] = omi_gravity_doc_ext + gltf_state.add_used_extension("OMI_physics_gravity", false) + return OK + + +func _convert_scene_node(gltf_state: GLTFState, gltf_node: GLTFNode, scene_node: Node) -> void: + if scene_node is CustomGravityArea3D: + var dict: Dictionary = scene_node.to_dictionary(gltf_state) + if not dict.is_empty(): + gltf_node.set_additional_data("GLTFPhysicsGravity", dict) + elif scene_node is Area3D and scene_node.gravity_space_override != Area3D.SPACE_OVERRIDE_DISABLED: + var dict: Dictionary = CustomGravityArea3D.area_gravity_to_dictionary(scene_node) + if not dict.is_empty(): + gltf_node.set_additional_data("GLTFPhysicsGravity", dict) + + +func _export_node(gltf_state: GLTFState, gltf_node: GLTFNode, json: Dictionary, node: Node) -> Error: + var gravity_dict = gltf_node.get_additional_data("GLTFPhysicsGravity") + if gravity_dict is Dictionary: + var ext: Dictionary = json.get_or_add("extensions", {}) + ext["OMI_physics_gravity"] = gravity_dict + gltf_state.add_used_extension("OMI_physics_gravity", false) + return OK diff --git a/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale.glb b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale.glb new file mode 100644 index 0000000..e8f1b9c Binary files /dev/null and b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale.glb differ diff --git a/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale.glb.import b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale.glb.import new file mode 100644 index 0000000..a16c223 --- /dev/null +++ b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale.glb.import @@ -0,0 +1,39 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://bwsc7ufo68ttr" +path="res://.godot/imported/earth_millionth_scale.glb-39be623523357d4533b8f8ec0dd0ae2e.scn" + +[deps] + +source_file="res://examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale.glb" +dest_files=["res://.godot/imported/earth_millionth_scale.glb-39be623523357d4533b8f8ec0dd0ae2e.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +fbx/importer=0 +fbx/allow_geometry_helper_nodes=false +fbx/embedded_image_handling=1 +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_color_4096.jpg b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_color_4096.jpg new file mode 100644 index 0000000..04320f3 Binary files /dev/null and b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_color_4096.jpg differ diff --git a/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_color_4096.jpg.import b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_color_4096.jpg.import new file mode 100644 index 0000000..8877f75 --- /dev/null +++ b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_color_4096.jpg.import @@ -0,0 +1,38 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cgd8cbv2e270p" +path.s3tc="res://.godot/imported/earth_millionth_scale_earth_color_4096.jpg-0531f74ec6505d08ae94bffd5340d4c4.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "2b3bddb71d8c4e41be86d79ca8eba90a" +} + +[deps] + +source_file="res://examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_color_4096.jpg" +dest_files=["res://.godot/imported/earth_millionth_scale_earth_color_4096.jpg-0531f74ec6505d08ae94bffd5340d4c4.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_roughness.png b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_roughness.png new file mode 100644 index 0000000..13a76dc Binary files /dev/null and b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_roughness.png differ diff --git a/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_roughness.png.import b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_roughness.png.import new file mode 100644 index 0000000..1cdc7d8 --- /dev/null +++ b/examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_roughness.png.import @@ -0,0 +1,38 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://esjgthm5oa1o" +path.s3tc="res://.godot/imported/earth_millionth_scale_earth_roughness.png-6f40668b0e99acc19accd013c8c6da1f.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "e12450bc02dea0824db01350e2d5957c" +} + +[deps] + +source_file="res://examples/omi_physics_gravity/glb/earth_millionth_scale/earth_millionth_scale_earth_roughness.png" +dest_files=["res://.godot/imported/earth_millionth_scale_earth_roughness.png-6f40668b0e99acc19accd013c8c6da1f.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater.glb b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater.glb new file mode 100644 index 0000000..cdb14ad Binary files /dev/null and b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater.glb differ diff --git a/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater.glb.import b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater.glb.import new file mode 100644 index 0000000..cce9215 --- /dev/null +++ b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater.glb.import @@ -0,0 +1,39 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://siw8af6ermlg" +path="res://.godot/imported/moon_petavius_crater.glb-e95c9618fea06612bf56af842941c77a.scn" + +[deps] + +source_file="res://examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater.glb" +dest_files=["res://.godot/imported/moon_petavius_crater.glb-e95c9618fea06612bf56af842941c77a.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +fbx/importer=0 +fbx/allow_geometry_helper_nodes=false +fbx/embedded_image_handling=1 +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_0.jpg b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_0.jpg new file mode 100644 index 0000000..dc39b65 Binary files /dev/null and b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_0.jpg differ diff --git a/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_0.jpg.import b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_0.jpg.import new file mode 100644 index 0000000..b0100f4 --- /dev/null +++ b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_0.jpg.import @@ -0,0 +1,38 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ceg8phvgswniw" +path.s3tc="res://.godot/imported/moon_petavius_crater_0.jpg-8a06d212700535468cfbfc686850981a.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "453485595fd89f8247dae7062ae998bb" +} + +[deps] + +source_file="res://examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_0.jpg" +dest_files=["res://.godot/imported/moon_petavius_crater_0.jpg-8a06d212700535468cfbfc686850981a.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_1.jpg b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_1.jpg new file mode 100644 index 0000000..7d08d7b Binary files /dev/null and b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_1.jpg differ diff --git a/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_1.jpg.import b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_1.jpg.import new file mode 100644 index 0000000..0435983 --- /dev/null +++ b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_1.jpg.import @@ -0,0 +1,38 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c1feitdny5wa" +path.s3tc="res://.godot/imported/moon_petavius_crater_1.jpg-a72ef47d38c47b9a1f388f3d43baac6f.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "659189a517166a97b5843955b7b23d02" +} + +[deps] + +source_file="res://examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_1.jpg" +dest_files=["res://.godot/imported/moon_petavius_crater_1.jpg-a72ef47d38c47b9a1f388f3d43baac6f.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=8 +roughness/src_normal="res://examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_2.jpg" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_2.jpg b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_2.jpg new file mode 100644 index 0000000..160df5e Binary files /dev/null and b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_2.jpg differ diff --git a/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_2.jpg.import b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_2.jpg.import new file mode 100644 index 0000000..e0157f1 --- /dev/null +++ b/examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_2.jpg.import @@ -0,0 +1,38 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dq8q4h76c5xbl" +path.s3tc="res://.godot/imported/moon_petavius_crater_2.jpg-c98dcae02cdb2c9223be54b040e0fa42.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "9409ffc3445f37ef91197344063538c3" +} + +[deps] + +source_file="res://examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_2.jpg" +dest_files=["res://.godot/imported/moon_petavius_crater_2.jpg-c98dcae02cdb2c9223be54b040e0fa42.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=1 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=1 +roughness/src_normal="res://examples/omi_physics_gravity/glb/moon_petavius_crater/moon_petavius_crater_2.jpg" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/examples/omi_physics_gravity/glb/ramp_gravity.glb b/examples/omi_physics_gravity/glb/ramp_gravity.glb new file mode 100644 index 0000000..d2f80e4 Binary files /dev/null and b/examples/omi_physics_gravity/glb/ramp_gravity.glb differ diff --git a/examples/omi_physics_gravity/glb/ramp_gravity.glb.import b/examples/omi_physics_gravity/glb/ramp_gravity.glb.import new file mode 100644 index 0000000..722e7bf --- /dev/null +++ b/examples/omi_physics_gravity/glb/ramp_gravity.glb.import @@ -0,0 +1,39 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://xpswa2ushsx1" +path="res://.godot/imported/ramp_gravity.glb-20fd7e1dfc02944eaafab8b0e77487ea.scn" + +[deps] + +source_file="res://examples/omi_physics_gravity/glb/ramp_gravity.glb" +dest_files=["res://.godot/imported/ramp_gravity.glb-20fd7e1dfc02944eaafab8b0e77487ea.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +fbx/importer=0 +fbx/allow_geometry_helper_nodes=false +fbx/embedded_image_handling=1 +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/examples/omi_physics_gravity/glb/rounded_cube.glb b/examples/omi_physics_gravity/glb/rounded_cube.glb new file mode 100644 index 0000000..5dc2acb Binary files /dev/null and b/examples/omi_physics_gravity/glb/rounded_cube.glb differ diff --git a/examples/omi_physics_gravity/glb/rounded_cube.glb.import b/examples/omi_physics_gravity/glb/rounded_cube.glb.import new file mode 100644 index 0000000..77ed528 --- /dev/null +++ b/examples/omi_physics_gravity/glb/rounded_cube.glb.import @@ -0,0 +1,39 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://brvfk6x5egqj2" +path="res://.godot/imported/rounded_cube.glb-dda03e80df1827dfd69df9d274027ccb.scn" + +[deps] + +source_file="res://examples/omi_physics_gravity/glb/rounded_cube.glb" +dest_files=["res://.godot/imported/rounded_cube.glb-dda03e80df1827dfd69df9d274027ccb.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +fbx/importer=0 +fbx/allow_geometry_helper_nodes=false +fbx/embedded_image_handling=1 +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_color_4096.jpg b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_color_4096.jpg new file mode 100644 index 0000000..04320f3 Binary files /dev/null and b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_color_4096.jpg differ diff --git a/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_color_4096.jpg.import b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_color_4096.jpg.import new file mode 100644 index 0000000..a0c1058 --- /dev/null +++ b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_color_4096.jpg.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b831xqu3yk34p" +path.s3tc="res://.godot/imported/earth_color_4096.jpg-3fdc9ab03929a459f22600fdb6ef8521.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_color_4096.jpg" +dest_files=["res://.godot/imported/earth_color_4096.jpg-3fdc9ab03929a459f22600fdb6ef8521.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_millionth_scale.bin b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_millionth_scale.bin new file mode 100644 index 0000000..c8b0d80 Binary files /dev/null and b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_millionth_scale.bin differ diff --git a/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_millionth_scale.gltf b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_millionth_scale.gltf new file mode 100644 index 0000000..ccb690f --- /dev/null +++ b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_millionth_scale.gltf @@ -0,0 +1,216 @@ +{ + "asset": { + "extensions": { "KHR_xmp_json_ld": { "packet": 0 } }, + "generator": "Godot Engine v4.3.dev.custom_build", + "version": "2.0" + }, + "extensionsUsed": [ + "GODOT_single_root", + "KHR_xmp_json_ld", + "OMI_physics_body", + "OMI_physics_gravity", + "OMI_physics_shape" + ], + "extensions": { + "KHR_xmp_json_ld": { + "packets": [ + { + "@context": { "dc": "http://purl.org/dc/elements/1.1/" }, + "@id": "", + "dc:coverage": "Earth", + "dc:creator": { "@list": ["NASA", "aaronfranke"] }, + "dc:description": "This spectacular 'blue marble' image is the most detailed true-color image of the entire Earth to date. Using a collection of satellite-based observations, scientists and visualizers stitched together months of observations of the land surface, oceans, sea ice, and clouds into a seamless, true-color mosaic. This model is at a one-millionth scale.", + "dc:format": "model/gltf+json", + "dc:rights": "NASA Image Use Policy https://visibleearth.nasa.gov/image-use-policy", + "dc:source": "https://visibleearth.nasa.gov/images/57752/blue-marble-land-surface-shallow-water-and-shaded-topography/57754l", + "dc:subject": { "@set": ["Earth"] }, + "dc:title": "Blue Marble: Land Surface, Shallow Water, and Shaded Topography", + "dc:type": { "@set": ["Planet", "Demo", "Test"] } + } + ] + }, + "OMI_physics_gravity": { + "gravity": 0.0 + }, + "OMI_physics_shape": { + "shapes": [ + { + "type": "sphere", + "sphere": { + "radius": 40.0 + } + }, + { + "type": "sphere", + "sphere": { + "radius": 6.37814 + } + } + ] + } + }, + "nodes": [ + { + "name": "EarthMillionthScale", + "children": [1, 2, 3], + "extensions": { + "OMI_physics_body": { + "motion": { + "type": "static", + "mass": 5972200.0 + } + } + } + }, + { + "name": "EarthCollider", + "extensions": { + "OMI_physics_body": { + "collider": { + "shape": 1 + } + } + } + }, + { + "name": "EarthMesh", + "mesh": 0 + }, + { + "name": "EarthGravity", + "extensions": { + "OMI_physics_body": { + "trigger": { + "shape": 0 + } + }, + "OMI_physics_gravity": { + "gravity": 9.80665, + "point": { "unitDistance": 6.37814 }, + "type": "point" + } + } + } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }], + "materials": [ + { + "doubleSided": true, + "name": "EarthMaterial", + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + }, + "metallicFactor": 0, + "metallicRoughnessTexture": { + "index": 1 + } + } + } + ], + "meshes": [ + { + "name": "EarthMeshData", + "primitives": [ + { + "attributes": { + "POSITION": 0, + "NORMAL": 1, + "TEXCOORD_0": 2 + }, + "indices": 3, + "material": 0 + } + ] + } + ], + "textures": [ + { + "sampler": 0, + "source": 0 + }, + { + "sampler": 0, + "source": 1 + } + ], + "images": [ + { + "mimeType": "image/jpeg", + "name": "earth_color_4096", + "uri": "earth_color_4096.jpg" + }, + { + "mimeType": "image/png", + "name": "earth_roughness", + "uri": "earth_roughness.png" + } + ], + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 2447, + "max": [6.378139495849609, 6.378159999847412, 6.378159999847412], + "min": [-6.378159999847412, -6.378159999847412, -6.378159999847412], + "type": "VEC3" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 2447, + "type": "VEC3" + }, + { + "bufferView": 2, + "componentType": 5126, + "count": 2447, + "type": "VEC2" + }, + { + "bufferView": 3, + "componentType": 5123, + "count": 14400, + "type": "SCALAR" + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 29364, + "byteOffset": 0, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 29364, + "byteOffset": 29364, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 19576, + "byteOffset": 58728, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 28800, + "byteOffset": 78304, + "target": 34963 + } + ], + "samplers": [ + { + "magFilter": 9729, + "minFilter": 9987 + } + ], + "buffers": [ + { + "byteLength": 107104, + "uri": "earth_millionth_scale.bin" + } + ] +} diff --git a/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_millionth_scale.gltf.import b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_millionth_scale.gltf.import new file mode 100644 index 0000000..85b37a2 --- /dev/null +++ b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_millionth_scale.gltf.import @@ -0,0 +1,39 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://xhdrfkabapnt" +path="res://.godot/imported/earth_millionth_scale.gltf-3ed1639e70033f13fe84010b04025fc5.scn" + +[deps] + +source_file="res://examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_millionth_scale.gltf" +dest_files=["res://.godot/imported/earth_millionth_scale.gltf-3ed1639e70033f13fe84010b04025fc5.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +fbx/importer=0 +fbx/allow_geometry_helper_nodes=false +fbx/embedded_image_handling=1 +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_roughness.png b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_roughness.png new file mode 100644 index 0000000..13a76dc Binary files /dev/null and b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_roughness.png differ diff --git a/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_roughness.png.import b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_roughness.png.import new file mode 100644 index 0000000..b1db19f --- /dev/null +++ b/examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_roughness.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dvdje1oj7aiw2" +path.s3tc="res://.godot/imported/earth_roughness.png-194ba69270d14d237e8a6fb1ba66c6fa.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_roughness.png" +dest_files=["res://.godot/imported/earth_roughness.png-194ba69270d14d237e8a6fb1ba66c6fa.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/examples/omi_physics_gravity/gltf/moon_petavius_crater/moon_petavius_crater.gltf b/examples/omi_physics_gravity/gltf/moon_petavius_crater/moon_petavius_crater.gltf new file mode 100644 index 0000000..9fd281c --- /dev/null +++ b/examples/omi_physics_gravity/gltf/moon_petavius_crater/moon_petavius_crater.gltf @@ -0,0 +1,1369 @@ +{ + "asset": { + "extensions": { "KHR_xmp_json_ld": { "packet": 0 } }, + "generator": "Godot Engine v4.3.dev.custom_build", + "version": "2.0" + }, + "extensionsUsed": ["KHR_xmp_json_ld", "OMI_physics_body", "OMI_physics_gravity", "OMI_physics_shape"], + "extensions": { + "KHR_xmp_json_ld": { + "packets": [ + { + "@context": { "dc": "http://purl.org/dc/elements/1.1/" }, + "@id": "", + "dc:coverage": "Petavius Crater, Earth's Moon", + "dc:creator": { "@list": ["SebastianSosnowski", "aaronfranke"] }, + "dc:description": "Moon Petavius Crater with OMI_physics_gravity playground as a test file for OMI_physics_gravity. Petavius is a large lunar impact crater located to the southeast of the Mare Fecunditatis, near the southeastern lunar limb. This model is at a ten-thousandth scale.", + "dc:format": "model/gltf+json", + "dc:rights": "CC-BY 4.0 Attribution", + "dc:source": "https://sketchfab.com/3d-models/moon-petavius-crater-ce9c009b517b421eab8c8429b536382f", + "dc:subject": { "@set": ["Space", "Moon", "Gravity"] }, + "dc:title": "Moon Petavius Crater with gravity", + "dc:type": { "@set": ["Map", "Demo", "Test"] } + } + ] + }, + "OMI_physics_gravity": { "gravity": 1.62 }, + "OMI_physics_shape": { + "shapes": [ + { "box": { "size": [3, 3, 3] }, "type": "box" }, + { "trimesh": { "mesh": 0 }, "type": "trimesh" }, + { "box": { "size": [2, 6, 2] }, "type": "box" }, + { "box": { "size": [2, 2, 2] }, "type": "box" }, + { "box": { "size": [16, 10, 10] }, "type": "box" }, + { "convex": { "mesh": 7 }, "type": "convex" }, + { "box": { "size": [40, 32, 44] }, "type": "box" }, + { "trimesh": { "mesh": 9 }, "type": "trimesh" }, + { "box": { "size": [20, 16, 16] }, "type": "box" }, + { "box": { "size": [20, 8, 10] }, "type": "box" }, + { "trimesh": { "mesh": 11 }, "type": "trimesh" }, + { "box": { "size": [8, 16, 8] }, "type": "box" }, + { "convex": { "mesh": 13 }, "type": "convex" }, + { "sphere": { "radius": 6 }, "type": "sphere" }, + { "sphere": { "radius": 2.5 }, "type": "sphere" }, + { "box": { "size": [10, 16, 16] }, "type": "box" }, + { "box": { "size": [10, 9, 16] }, "type": "box" }, + { "convex": { "mesh": 16 }, "type": "convex" } + ] + } + }, + "images": [ + { "uri": "textures/moon_petavius_crater_material_albedo000.jpg" }, + { "uri": "textures/moon_petavius_crater_material_orm000.jpg" }, + { "uri": "textures/moon_petavius_crater_material_normal000.jpg" } + ], + "materials": [ + { + "name": "MoonPetaviusCraterMaterial", + "normalTexture": { "index": 2, "scale": 1 }, + "occlusionTexture": { "index": 1 }, + "pbrMetallicRoughness": { + "baseColorFactor": [0.99999988079071, 0.99999988079071, 0.99999988079071, 1], + "baseColorTexture": { "index": 0 }, + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "doubleSided": true, + "name": "ZeroGravitySetZeroPedestalMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0, 0.600000500679016, 0.800000548362732, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "ZeroGravityAddUpMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0, 0, 0.800000548362732, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "SidewaysGravityLocalDownMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0.800000548362732, 0, 0, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "SidewaysGravityLocalWestMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0.800000548362732, 0.800000548362732, 0, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "DiscGravityMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0, 0.800000548362732, 0, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "TorusGravityMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0.800000548362732, 0.199999749660492, 0, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "LineGravityMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0.800000548362732, 0, 0.480000972747803, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [0.214041143655777, 0.522521495819092, 0.99999988079071, 1], + "metallicFactor": 0, + "roughnessFactor": 1 + } + }, + { + "doubleSided": true, + "name": "PointGravityMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0.39999982714653, 0, 0.800000548362732, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + }, + { + "doubleSided": true, + "name": "ShapedGravityCubeMaterial", + "pbrMetallicRoughness": { + "baseColorFactor": [0, 0.800000548362732, 0.299999475479126, 1], + "metallicFactor": 0, + "roughnessFactor": 0.5 + } + } + ], + "meshes": [ + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 0 }, "indices": 1, "mode": 4 }] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 4, "POSITION": 2, "TANGENT": 3, "TEXCOORD_0": 5 }, + "indices": 6, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 9, "POSITION": 7, "TANGENT": 8, "TEXCOORD_0": 10 }, + "indices": 11, + "material": 1, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 14, "POSITION": 12, "TANGENT": 13, "TEXCOORD_0": 15 }, + "indices": 16, + "material": 2, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 19, "POSITION": 17, "TANGENT": 18, "TEXCOORD_0": 20 }, + "indices": 21, + "material": 3, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 24, "POSITION": 22, "TANGENT": 23, "TEXCOORD_0": 25 }, + "indices": 26, + "material": 4, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 29, "POSITION": 27, "TANGENT": 28, "TEXCOORD_0": 30 }, + "indices": 31, + "material": 5, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 32 }, "indices": 33, "mode": 4 }] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 36, "POSITION": 34, "TANGENT": 35, "TEXCOORD_0": 37 }, + "indices": 38, + "material": 6, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 39 }, "indices": 40, "mode": 4 }] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 43, "POSITION": 41, "TANGENT": 42, "TEXCOORD_0": 44 }, + "indices": 45, + "material": 7, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 46 }, "indices": 47, "mode": 4 }] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 50, "POSITION": 48, "TANGENT": 49, "TEXCOORD_0": 51 }, + "indices": 52, + "material": 8, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 53 }, "indices": 54, "mode": 4 }] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 57, "POSITION": 55, "TANGENT": 56, "TEXCOORD_0": 58 }, + "indices": 59, + "material": 9, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 62, "POSITION": 60, "TANGENT": 61, "TEXCOORD_0": 63 }, + "indices": 64, + "material": 10, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 65 }, "indices": 66, "mode": 4 }] + } + ], + "nodes": [ + { + "children": [1, 2], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "MoonPetaviusCrater" + }, + { "extensions": { "OMI_physics_body": { "collider": { "shape": 1 } } }, "name": "MoonPetaviusCraterShape" }, + { "mesh": 1, "name": "MoonPetaviusCraterMesh" }, + { + "children": [4, 5, 6], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [4] } }, + "OMI_physics_gravity": { + "gravity": 0, + "replace": true, + "stop": true, + "type": "directional" + } + }, + "name": "ZeroGravityReplaceZero", + "translation": [10, 0, 3] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 2 } } }, + "name": "ZeroGravityReplaceZeroShape", + "translation": [0, 2, 0] + }, + { "mesh": 2, "name": "ZeroGravityReplaceZeroPedestalMesh" }, + { + "children": [7], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "ZeroGravityReplaceZeroPedestalCollider" + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 3 } } }, + "name": "ZeroGravityReplaceZeroPedestalShape", + "translation": [0, -1, 0] + }, + { + "children": [9, 10, 11], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [9] } }, + "OMI_physics_gravity": { + "directional": { "direction": [0, 1, 0] }, + "gravity": 1.62, + "type": "directional" + } + }, + "name": "ZeroGravityAddUp", + "translation": [10, 0, -0.5] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 2 } } }, + "name": "ZeroGravityAddUpShape", + "translation": [0, 2, 0] + }, + { "mesh": 3, "name": "ZeroGravityAddUpPedestalMesh" }, + { + "children": [12], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "ZeroGravityAddUpPedestalCollider" + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 3 } } }, + "name": "ZeroGravityAddUpPedestalShape", + "translation": [0, -1, 0] + }, + { + "children": [14, 15, 16], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [14] } }, + "OMI_physics_gravity": { "gravity": 1.62, "type": "directional" } + }, + "name": "SidewaysGravityLocalDown", + "rotation": [0.0695864856243134, -0.1205275952816, -0.49513384699821, 0.857597410678864], + "translation": [-9, 0.3, -0.5] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 2 } } }, + "name": "SidewaysGravityLocalDownShape", + "rotation": [0, 0, 0.258819341659546, 0.965925753116608] + }, + { + "mesh": 4, + "name": "SidewaysGravityLocalDownPedestalMesh", + "rotation": [0, 0, 0.258819162845612, 0.965925812721252] + }, + { + "children": [17], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "SidewaysGravityLocalDownPedestalCollider", + "rotation": [0, 0, 0.258819162845612, 0.965925812721252] + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 3 } } }, + "name": "SidewaysGravityLocalDownPedestalShape", + "translation": [0, -1, 0] + }, + { + "children": [19, 20, 21], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [19] } }, + "OMI_physics_gravity": { + "directional": { "direction": [-1, 0, 0] }, + "gravity": 0.935, + "type": "directional" + } + }, + "name": "SidewaysGravityLocalWest", + "rotation": [0, 0.139172896742821, 0, 0.990268111228943], + "translation": [-8.5, 0, 4] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 2 } } }, + "name": "SidewaysGravityLocalWestShape", + "rotation": [0, 0, -0.25881916284561, 0.965925812721252] + }, + { + "mesh": 5, + "name": "SidewaysGravityLocalWestPedestalMesh", + "rotation": [0, 0, -0.25881916284561, 0.965925812721252] + }, + { + "children": [22], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "SidewaysGravityLocalWestPedestalCollider", + "rotation": [0, 0, -0.25881916284561, 0.965925812721252] + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 3 } } }, + "name": "SidewaysGravityLocalWestPedestalShape", + "translation": [0, -1, 0] + }, + { + "children": [24, 25, 26], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [24] } }, + "OMI_physics_gravity": { + "disc": { "radius": 3 }, + "gravity": 2, + "replace": true, + "stop": true, + "type": "disc" + } + }, + "name": "DiscGravity", + "translation": [-6, 0, 22] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 4 } } }, + "name": "DiscGravityShape", + "translation": [0, 0, 2] + }, + { "mesh": 6, "name": "DiscGravityMesh" }, + { + "children": [27], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "DiscGravityCollider" + }, + { "extensions": { "OMI_physics_body": { "collider": { "shape": 5 } } }, "name": "DiscGravityColliderShape" }, + { + "children": [29, 30, 31], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [29] } }, + "OMI_physics_gravity": { + "gravity": 2, + "replace": true, + "stop": true, + "torus": { "radius": 10 }, + "type": "torus" + } + }, + "name": "TorusGravity", + "translation": [-34, 0, 2] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 6 } } }, + "name": "TorusGravityShape1", + "translation": [-5, 0, 0] + }, + { "mesh": 8, "name": "TorusGravityMesh" }, + { + "children": [32], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "TorusGravityCollider" + }, + { "extensions": { "OMI_physics_body": { "collider": { "shape": 7 } } }, "name": "TorusGravityColliderShape" }, + { + "children": [34, 35, 36, 37], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [34, 35] } }, + "OMI_physics_gravity": { + "gravity": 2, + "line": { + "points": [0, 0, 3, 0, 0, -3, -5.196, 0, -6] + }, + "replace": true, + "stop": true, + "type": "line" + } + }, + "name": "LineGravityCapsule", + "translation": [-10, -1, -22] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 8 } } }, + "name": "LineGravityCapsuleShape1", + "translation": [-3, 0, -5] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 9 } } }, + "name": "LineGravityCapsuleShape2", + "translation": [-3, -4, 8] + }, + { "mesh": 10, "name": "LineGravityCapsuleMesh" }, + { + "children": [38], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "LineGravityCapsuleCollider" + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 10 } } }, + "name": "LineGravityCapsuleColliderShape" + }, + { + "children": [40, 41, 42], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [40] } }, + "OMI_physics_gravity": { + "gravity": 2.8, + "line": { + "points": [0, -10, 0, 0, 10, 0] + }, + "type": "line" + } + }, + "name": "LineGravityCone", + "translation": [20, 0, -7] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 11 } } }, + "name": "LineGravityConeShape", + "translation": [0, 6, 0] + }, + { + "mesh": 12, + "name": "LineGravityConeMesh", + "translation": [0, 2, 0] + }, + { + "children": [43], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "LineGravityConeCollider" + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 12 } } }, + "name": "LineGravityConeColliderShape", + "translation": [0, 2, 0] + }, + { + "children": [45, 46, 47], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [45] } }, + "OMI_physics_gravity": { "gravity": 2, "replace": true, "stop": true, "type": "point" } + }, + "name": "PointGravity", + "translation": [7, 5, -15] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 13 } } }, + "name": "PointGravityShape", + "translation": [0, 2.5, 0] + }, + { "mesh": 14, "name": "PointGravitySphereMesh" }, + { + "children": [48], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "PointGravityCollider" + }, + { "extensions": { "OMI_physics_body": { "collider": { "shape": 14 } } }, "name": "PointGravityColliderShape" }, + { + "children": [50, 51, 52, 53], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [50, 51] } }, + "OMI_physics_gravity": { + "gravity": 3, + "replace": true, + "shaped": { "shape": 0 }, + "stop": true, + "type": "shaped" + } + }, + "name": "ShapedGravityCube", + "translation": [20, -2, 12] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 15 } } }, + "name": "ShapedGravityCubeShape1", + "translation": [4, 0, 0] + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 16 } } }, + "name": "ShapedGravityCubeShape2", + "translation": [-6, -3.5, 0] + }, + { "mesh": 15, "name": "ShapedGravityCubeMesh" }, + { + "children": [54], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "ShapedGravityCubeCollider" + }, + { + "extensions": { "OMI_physics_body": { "collider": { "shape": 17 } } }, + "name": "ShapedGravityCubeColliderShape" + } + ], + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 29259, + "max": [19, 1.30579996109009, 19.0009002685547], + "min": [-19, -1.38950002193451, -19.00020027160645], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5123, + "count": 29259, + "max": [29258], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 5106, + "max": [19, 1.30579996109009, 19.0008983612061], + "min": [-19, -1.38953995704651, -19.00020027160645], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 5106, + "max": [1, 0.983123898506165, 0.269449949264526, -1], + "min": [0.0377098880708218, -0.76375699043274, -0.88739860057831, -1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5126, + "count": 5106, + "max": [0.750136017799377, 0.999999046325684, 0.819615840911865], + "min": [-0.98061925172806, 0.182534545660019, -0.75767570734024], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 5106, + "max": [0.974990487098694, 0.975005745887756], + "min": [0.0249942783266306, 0.0249790195375681], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5123, + "count": 29259, + "max": [5043], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 7, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 0, 0.999979496002197], + "min": [-1, -2, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 8, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 0.0000736713409423828, 1], + "min": [-1, -0.00003045622725, -0.00003057986032, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 9, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 1], + "min": [-1, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 10, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.874998092651367, 1], + "min": [0.12498664855957, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 11, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 12, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 0, 0.999979496002197], + "min": [-1, -2, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 13, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 0.0000736713409423828, 1], + "min": [-1, -0.00003045622725, -0.00003057986032, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 14, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 1], + "min": [-1, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 15, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.874998092651367, 1], + "min": [0.12498664855957, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 16, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 17, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 0, 0.999979496002197], + "min": [-1, -2, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 18, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 0.0000736713409423828, 1], + "min": [-1, -0.00003045622725, -0.00003057986032, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 19, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 1], + "min": [-1, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 20, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.874998092651367, 1], + "min": [0.12498664855957, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 21, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 22, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 0, 0.999979496002197], + "min": [-1, -2, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 23, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 0.0000736713409423828, 1], + "min": [-1, -0.00003045622725, -0.00003057986032, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 24, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [1, 1, 1], + "min": [-1, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 25, + "byteOffset": 0, + "componentType": 5126, + "count": 24, + "max": [0.874998092651367, 1], + "min": [0.12498664855957, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 26, + "byteOffset": 0, + "componentType": 5123, + "count": 36, + "max": [23], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 27, + "byteOffset": 0, + "componentType": 5126, + "count": 1250, + "max": [3.49990320205688, 0.5, 3.5], + "min": [-3.5, -0.5, -3.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 28, + "byteOffset": 0, + "componentType": 5126, + "count": 1250, + "max": [1, 0.277228564023972, 1, 1], + "min": [-1, -0.09738609194756, -1.00000011920929, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 29, + "byteOffset": 0, + "componentType": 5126, + "count": 1250, + "max": [1, 0.999985158443451, 1], + "min": [-1, -0.99987101554871, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 30, + "byteOffset": 0, + "componentType": 5126, + "count": 1250, + "max": [1, 0.749996185302734], + "min": [0, 0.249988555908203], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 31, + "byteOffset": 0, + "componentType": 5123, + "count": 6516, + "max": [1104], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 32, + "byteOffset": 0, + "componentType": 5126, + "count": 6516, + "max": [3.49990010261536, 0.5, 3.5], + "min": [-3.5, -0.5, -3.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 33, + "byteOffset": 0, + "componentType": 5123, + "count": 6516, + "max": [6515], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 34, + "byteOffset": 0, + "componentType": 5126, + "count": 8593, + "max": [13.1995973587036, 3.20000004768372, 13.1999998092651], + "min": [-13.19999980926514, -3.20000004768372, -13.19999980926514], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 35, + "byteOffset": 0, + "componentType": 5126, + "count": 8593, + "max": [1, 0.658829808235168, 1, 1], + "min": [-1, -0.74816966056824, -1.00000011920929, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 36, + "byteOffset": 0, + "componentType": 5126, + "count": 8593, + "max": [1, 0.999999821186066, 1], + "min": [-1, -0.99999982118607, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 37, + "byteOffset": 0, + "componentType": 5126, + "count": 8593, + "max": [1, 1], + "min": [0, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 38, + "byteOffset": 0, + "componentType": 5123, + "count": 49152, + "max": [8384], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 39, + "byteOffset": 0, + "componentType": 5126, + "count": 49152, + "max": [13.1996002197266, 3.20000004768372, 13.1999998092651], + "min": [-13.19999980926514, -3.20000004768372, -13.19999980926514], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 40, + "byteOffset": 0, + "componentType": 5123, + "count": 49152, + "max": [49151], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 41, + "byteOffset": 0, + "componentType": 5126, + "count": 4618, + "max": [1.99985980987549, 1.99994897842407, 4.99997043609619], + "min": [-7.1950798034668, -2, -7.99892997741699], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 42, + "byteOffset": 0, + "componentType": 5126, + "count": 4618, + "max": [1, 1.00000023841858, 0.944491326808929, 1], + "min": [-1, -1.00000011920929, -0.86602449417114, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 43, + "byteOffset": 0, + "componentType": 5126, + "count": 4618, + "max": [0.999702334403992, 0.999702036380768, 1], + "min": [-0.99970126152039, -0.99970179796219, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 44, + "byteOffset": 0, + "componentType": 5126, + "count": 4618, + "max": [1, 0.999984741210938], + "min": [0, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 45, + "byteOffset": 0, + "componentType": 5123, + "count": 24576, + "max": [4415], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 46, + "byteOffset": 0, + "componentType": 5126, + "count": 24576, + "max": [1.99989998340607, 1.99989998340607, 5], + "min": [-7.19509983062744, -2, -7.99889993667603], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 47, + "byteOffset": 0, + "componentType": 5123, + "count": 24576, + "max": [24575], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 48, + "byteOffset": 0, + "componentType": 5126, + "count": 456, + "max": [3.46399998664856, 3, 3.46399998664856], + "min": [-3.46399998664856, -3, -3.46399998664856], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 49, + "byteOffset": 0, + "componentType": 5126, + "count": 456, + "max": [1, 0, 1, 1], + "min": [-1, -0.00002157951531, -1, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 50, + "byteOffset": 0, + "componentType": 5126, + "count": 456, + "max": [0.866026937961578, 0.500042736530304, 0.866026937961578], + "min": [-0.86604118347168, -1, -0.86601793766022], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 51, + "byteOffset": 0, + "componentType": 5126, + "count": 456, + "max": [1, 1], + "min": [0, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 52, + "byteOffset": 0, + "componentType": 5123, + "count": 2112, + "max": [455], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 53, + "byteOffset": 0, + "componentType": 5126, + "count": 522, + "max": [3.46399998664856, 3, 3.46399998664856], + "min": [-3.44772005081177, -3, -3.46399998664856], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 54, + "byteOffset": 0, + "componentType": 5123, + "count": 522, + "max": [521], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 55, + "byteOffset": 0, + "componentType": 5126, + "count": 755, + "max": [2.5, 2.5, 2.5], + "min": [-2.5, -2.5, -2.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 56, + "byteOffset": 0, + "componentType": 5126, + "count": 755, + "max": [0.999899983406067, 0.311829507350922, 1, 1], + "min": [-0.9998996257782, -0.31187635660172, -1, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 57, + "byteOffset": 0, + "componentType": 5126, + "count": 755, + "max": [0.999997138977051, 1, 1], + "min": [-0.99999707937241, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 58, + "byteOffset": 0, + "componentType": 5126, + "count": 755, + "max": [1, 1], + "min": [0, 0.527611196041107], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 59, + "byteOffset": 0, + "componentType": 5123, + "count": 3840, + "max": [728], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 60, + "byteOffset": 0, + "componentType": 5126, + "count": 2006, + "max": [2.5, 2.5, 2.5], + "min": [-2.5, -2.5, -2.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 61, + "byteOffset": 0, + "componentType": 5126, + "count": 2006, + "max": [1, 1.00000011920929, 0.737568855285645, 1], + "min": [-1, -0.76894599199295, -0.86604261398315, 1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 62, + "byteOffset": 0, + "componentType": 5126, + "count": 2006, + "max": [1, 1, 1], + "min": [-1, -1, -1], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 63, + "byteOffset": 0, + "componentType": 5126, + "count": 2006, + "max": [0.874998092651367, 1], + "min": [0.12498664855957, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 64, + "byteOffset": 0, + "componentType": 5123, + "count": 2916, + "max": [1943], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 65, + "byteOffset": 0, + "componentType": 5126, + "count": 2916, + "max": [2.5, 2.5, 2.5], + "min": [-2.5, -2.5, -2.5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 66, + "byteOffset": 0, + "componentType": 5123, + "count": 2916, + "max": [2915], + "min": [0], + "normalized": false, + "type": "SCALAR" + } + ], + "bufferViews": [ + { "buffer": 0, "byteLength": 351108, "byteOffset": 0, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 58518, "byteOffset": 351108, "target": 34963 }, + { "buffer": 0, "byteLength": 61272, "byteOffset": 409628, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 81696, "byteOffset": 470900, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 61272, "byteOffset": 552596, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 40848, "byteOffset": 613868, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 58518, "byteOffset": 654716, "target": 34963 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 713236, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 713524, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 713908, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 714196, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 714388, "target": 34963 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 714460, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 714748, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 715132, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 715420, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 715612, "target": 34963 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 715684, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 715972, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 716356, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 716644, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 716836, "target": 34963 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 716908, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 384, "byteOffset": 717196, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 288, "byteOffset": 717580, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 192, "byteOffset": 717868, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 72, "byteOffset": 718060, "target": 34963 }, + { "buffer": 0, "byteLength": 15000, "byteOffset": 718132, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 20000, "byteOffset": 733132, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 15000, "byteOffset": 753132, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 10000, "byteOffset": 768132, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 13032, "byteOffset": 778132, "target": 34963 }, + { "buffer": 0, "byteLength": 78192, "byteOffset": 791164, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 13032, "byteOffset": 869356, "target": 34963 }, + { "buffer": 0, "byteLength": 103116, "byteOffset": 882388, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 137488, "byteOffset": 985504, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 103116, "byteOffset": 1122992, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 68744, "byteOffset": 1226108, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 98304, "byteOffset": 1294852, "target": 34963 }, + { "buffer": 0, "byteLength": 589824, "byteOffset": 1393156, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 98304, "byteOffset": 1982980, "target": 34963 }, + { "buffer": 0, "byteLength": 55416, "byteOffset": 2081284, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 73888, "byteOffset": 2136700, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 55416, "byteOffset": 2210588, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 36944, "byteOffset": 2266004, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 49152, "byteOffset": 2302948, "target": 34963 }, + { "buffer": 0, "byteLength": 294912, "byteOffset": 2352100, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 49152, "byteOffset": 2647012, "target": 34963 }, + { "buffer": 0, "byteLength": 5472, "byteOffset": 2696164, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 7296, "byteOffset": 2701636, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 5472, "byteOffset": 2708932, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 3648, "byteOffset": 2714404, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 4224, "byteOffset": 2718052, "target": 34963 }, + { "buffer": 0, "byteLength": 6264, "byteOffset": 2722276, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 1044, "byteOffset": 2728540, "target": 34963 }, + { "buffer": 0, "byteLength": 9060, "byteOffset": 2729584, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 12080, "byteOffset": 2738644, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 9060, "byteOffset": 2750724, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 6040, "byteOffset": 2759784, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 7680, "byteOffset": 2765824, "target": 34963 }, + { "buffer": 0, "byteLength": 24072, "byteOffset": 2773504, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 32096, "byteOffset": 2797576, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 24072, "byteOffset": 2829672, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 16048, "byteOffset": 2853744, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 5832, "byteOffset": 2869792, "target": 34963 }, + { "buffer": 0, "byteLength": 34992, "byteOffset": 2875624, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 5832, "byteOffset": 2910616, "target": 34963 } + ], + "buffers": [{ "byteLength": 2916448, "uri": "moon_petavius_crater0.bin" }], + "samplers": [{ "magFilter": 9729, "minFilter": 9987, "wrapS": 10497, "wrapT": 10497 }], + "scene": 0, + "scenes": [{ "name": "MoonPetaviusCraterScene", "nodes": [0, 3, 8, 13, 18, 23, 28, 33, 39, 44, 49] }], + "textures": [ + { "sampler": 0, "source": 0 }, + { "sampler": 0, "source": 1 }, + { "sampler": 0, "source": 2 } + ] +} diff --git a/examples/omi_physics_gravity/gltf/moon_petavius_crater/moon_petavius_crater.gltf.import b/examples/omi_physics_gravity/gltf/moon_petavius_crater/moon_petavius_crater.gltf.import new file mode 100644 index 0000000..5782eb2 --- /dev/null +++ b/examples/omi_physics_gravity/gltf/moon_petavius_crater/moon_petavius_crater.gltf.import @@ -0,0 +1,39 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://7wp7uqivdykx" +path="res://.godot/imported/moon_petavius_crater.gltf-afa0a06fcb9910a105f0cf6786b5ddce.scn" + +[deps] + +source_file="res://examples/omi_physics_gravity/gltf/moon_petavius_crater/moon_petavius_crater.gltf" +dest_files=["res://.godot/imported/moon_petavius_crater.gltf-afa0a06fcb9910a105f0cf6786b5ddce.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +fbx/importer=0 +fbx/allow_geometry_helper_nodes=false +fbx/embedded_image_handling=1 +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/examples/omi_physics_gravity/gltf/moon_petavius_crater/moon_petavius_crater0.bin b/examples/omi_physics_gravity/gltf/moon_petavius_crater/moon_petavius_crater0.bin new file mode 100644 index 0000000..e4610ea Binary files /dev/null and b/examples/omi_physics_gravity/gltf/moon_petavius_crater/moon_petavius_crater0.bin differ diff --git a/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_albedo000.jpg b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_albedo000.jpg new file mode 100644 index 0000000..dc39b65 Binary files /dev/null and b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_albedo000.jpg differ diff --git a/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_albedo000.jpg.import b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_albedo000.jpg.import new file mode 100644 index 0000000..462bfbf --- /dev/null +++ b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_albedo000.jpg.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bah5oa2ukqnbp" +path.s3tc="res://.godot/imported/moon_petavius_crater_material_albedo000.jpg-46a880d34ac37c5afe2ba088dadeb274.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_albedo000.jpg" +dest_files=["res://.godot/imported/moon_petavius_crater_material_albedo000.jpg-46a880d34ac37c5afe2ba088dadeb274.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg new file mode 100644 index 0000000..160df5e Binary files /dev/null and b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg differ diff --git a/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg.import b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg.import new file mode 100644 index 0000000..d9fb831 --- /dev/null +++ b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ckd5xoudkqnmk" +path.s3tc="res://.godot/imported/moon_petavius_crater_material_normal000.jpg-e29505312d9dbfcb1036b784c6095be8.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg" +dest_files=["res://.godot/imported/moon_petavius_crater_material_normal000.jpg-e29505312d9dbfcb1036b784c6095be8.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=1 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=1 +roughness/src_normal="res://examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_orm000.jpg b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_orm000.jpg new file mode 100644 index 0000000..7d08d7b Binary files /dev/null and b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_orm000.jpg differ diff --git a/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_orm000.jpg.import b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_orm000.jpg.import new file mode 100644 index 0000000..1d61555 --- /dev/null +++ b/examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_orm000.jpg.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://fqxc3ahru6qw" +path.s3tc="res://.godot/imported/moon_petavius_crater_material_orm000.jpg-79a950a0bb4829212340469c3c2bd1f7.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_orm000.jpg" +dest_files=["res://.godot/imported/moon_petavius_crater_material_orm000.jpg-79a950a0bb4829212340469c3c2bd1f7.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=8 +roughness/src_normal="res://examples/omi_physics_gravity/gltf/moon_petavius_crater/textures/moon_petavius_crater_material_normal000.jpg" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/examples/omi_physics_gravity/gltf/ramp_gravity.gltf b/examples/omi_physics_gravity/gltf/ramp_gravity.gltf new file mode 100644 index 0000000..3f0bb6a --- /dev/null +++ b/examples/omi_physics_gravity/gltf/ramp_gravity.gltf @@ -0,0 +1,158 @@ +{ + "asset": { + "generator": "Godot Engine v4.3.dev.custom_build", + "version": "2.0" + }, + "extensionsUsed": ["GODOT_single_root", "OMI_physics_body", "OMI_physics_gravity", "OMI_physics_shape"], + "extensions": { + "OMI_physics_shape": { + "shapes": [ + { "box": { "size": [6, 4, 3] }, "type": "box" }, + { "box": { "size": [2, 7, 5] }, "type": "box" }, + { "trimesh": { "mesh": 1 }, "type": "trimesh" } + ] + } + }, + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorFactor": [1, 1, 1, 1], + "metallicFactor": 0, + "roughnessFactor": 1 + } + } + ], + "meshes": [ + { + "extras": { "targetNames": [] }, + "primitives": [ + { + "attributes": { "NORMAL": 2, "POSITION": 0, "TANGENT": 1, "TEXCOORD_0": 3 }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { "targetNames": [] }, + "primitives": [{ "attributes": { "POSITION": 5 }, "indices": 6, "mode": 4 }] + } + ], + "nodes": [ + { + "children": [1, 2, 3], + "extensions": { + "OMI_physics_body": { "trigger": { "nodes": [1] } }, + "OMI_physics_gravity": { + "gravity": -9.8, + "shaped": { "shape": 0 }, + "stop": true, + "type": "shaped" + } + }, + "name": "RampGravity" + }, + { + "extensions": { "OMI_physics_body": { "trigger": { "shape": 1 } } }, + "name": "RampGravityShape", + "translation": [0, -1.5, -2] + }, + { + "mesh": 0, + "name": "RampGravityMesh", + "translation": [0, -5, 0.5] + }, + { + "children": [4], + "extensions": { "OMI_physics_body": { "motion": { "type": "static" } } }, + "name": "RampGravityCollider", + "translation": [0, -5, 0.5] + }, + { "extensions": { "OMI_physics_body": { "collider": { "shape": 2 } } }, "name": "RampGravityColliderShape" } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }], + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "componentType": 5126, + "count": 136, + "max": [0.999979496002197, 7, -0.00006628036499], + "min": [-1, 0, -5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "componentType": 5126, + "count": 136, + "max": [1, 0.0000152590218931437, 0.999698579311371, 1], + "min": [-0.00013981414668, -0.99970042705536, -0.00001525865719, -1], + "normalized": false, + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 0, + "componentType": 5126, + "count": 136, + "max": [0.0000841021610540338, 1, 1], + "min": [-0.00014381069923, 0, 0.0000239175878959941], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "componentType": 5126, + "count": 136, + "max": [0.749996185302734, 0.499992370605469], + "min": [0.499992370605469, 0], + "normalized": false, + "type": "VEC2" + }, + { + "bufferView": 4, + "byteOffset": 0, + "componentType": 5123, + "count": 204, + "max": [135], + "min": [0], + "normalized": false, + "type": "SCALAR" + }, + { + "bufferView": 5, + "byteOffset": 0, + "componentType": 5126, + "count": 204, + "max": [1, 7, -0.00009999999747], + "min": [-1, 0, -5], + "normalized": false, + "type": "VEC3" + }, + { + "bufferView": 6, + "byteOffset": 0, + "componentType": 5123, + "count": 204, + "max": [203], + "min": [0], + "normalized": false, + "type": "SCALAR" + } + ], + "bufferViews": [ + { "buffer": 0, "byteLength": 1632, "byteOffset": 0, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 2176, "byteOffset": 1632, "byteStride": 16, "target": 34962 }, + { "buffer": 0, "byteLength": 1632, "byteOffset": 3808, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 1088, "byteOffset": 5440, "byteStride": 8, "target": 34962 }, + { "buffer": 0, "byteLength": 408, "byteOffset": 6528, "target": 34963 }, + { "buffer": 0, "byteLength": 2448, "byteOffset": 6936, "byteStride": 12, "target": 34962 }, + { "buffer": 0, "byteLength": 408, "byteOffset": 9384, "target": 34963 } + ], + "buffers": [{ "byteLength": 9792, "uri": "ramp_gravity0.bin" }] +} diff --git a/examples/omi_physics_gravity/gltf/ramp_gravity.gltf.import b/examples/omi_physics_gravity/gltf/ramp_gravity.gltf.import new file mode 100644 index 0000000..5e32499 --- /dev/null +++ b/examples/omi_physics_gravity/gltf/ramp_gravity.gltf.import @@ -0,0 +1,39 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://bpddn41uk06ct" +path="res://.godot/imported/ramp_gravity.gltf-289823ec6c82ed1f024aac4549a4ca31.scn" + +[deps] + +source_file="res://examples/omi_physics_gravity/gltf/ramp_gravity.gltf" +dest_files=["res://.godot/imported/ramp_gravity.gltf-289823ec6c82ed1f024aac4549a4ca31.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +fbx/importer=0 +fbx/allow_geometry_helper_nodes=false +fbx/embedded_image_handling=1 +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/examples/omi_physics_gravity/gltf/ramp_gravity0.bin b/examples/omi_physics_gravity/gltf/ramp_gravity0.bin new file mode 100644 index 0000000..6dd93a9 Binary files /dev/null and b/examples/omi_physics_gravity/gltf/ramp_gravity0.bin differ diff --git a/examples/omi_physics_gravity/gltf/rounded_cube.bin b/examples/omi_physics_gravity/gltf/rounded_cube.bin new file mode 100644 index 0000000..f01cc76 Binary files /dev/null and b/examples/omi_physics_gravity/gltf/rounded_cube.bin differ diff --git a/examples/omi_physics_gravity/gltf/rounded_cube.gltf b/examples/omi_physics_gravity/gltf/rounded_cube.gltf new file mode 100644 index 0000000..1886812 --- /dev/null +++ b/examples/omi_physics_gravity/gltf/rounded_cube.gltf @@ -0,0 +1,143 @@ +{ + "asset": { + "version": "2.0" + }, + "extensionsUsed": [ + "GODOT_single_root", + "OMI_physics_body", + "OMI_physics_gravity", + "OMI_physics_shape" + ], + "extensions": { + "OMI_physics_shape": { + "shapes": [ + { + "type": "box", + "box": { + "size": [6, 6, 6] + } + }, + { + "type": "box", + "box": { + "size": [1, 1, 1] + } + }, + { + "type": "convex", + "convex": { + "mesh": 0 + } + } + ] + } + }, + "nodes": [ + { + "name": "RoundedCube", + "children": [1, 2, 3], + "extensions": { + "OMI_physics_body": { + "motion": { + "type": "static" + } + } + } + }, + { + "name": "RoundedCubeGravity", + "extensions": { + "OMI_physics_body": { + "trigger": { + "shape": 0 + } + }, + "OMI_physics_gravity": { + "type": "shaped", + "gravity": 9.80665, + "stop": true, + "shaped": { + "shape": 1 + } + } + } + }, + { + "name": "RoundedCubeMesh", + "mesh": 0 + }, + { + "name": "RoundedCubeShape", + "extensions": { + "OMI_physics_body": { + "collider": { + "shape": 2 + } + } + } + } + ], + "scene": 0, + "scenes": [{ "nodes": [0] }], + "accessors": [ + { + "type": "VEC3", + "componentType": 5126, + "count": 1844, + "max": [0.75, 0.75, 0.75], + "min": [-0.75, -0.75, -0.75], + "bufferView": 0, + "byteOffset": 0 + }, + { + "type": "VEC3", + "componentType": 5126, + "count": 1844, + "bufferView": 0, + "byteOffset": 12 + }, + { + "type": "SCALAR", + "componentType": 5123, + "count": 10344, + "bufferView": 1, + "byteOffset": 0 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteOffset": 0, + "byteLength": 44256, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteOffset": 44256, + "byteLength": 20688, + "target": 34963 + } + ], + "buffers": [ + { + "uri": "rounded_cube.bin", + "byteLength": 64944 + } + ], + "meshes": [ + { + "name": "RoundedCubeMeshData", + "primitives": [ + { + "attributes": { + "POSITION": 0, + "NORMAL": 1 + }, + "mode": 4, + "indices": 2 + } + ] + } + ] +} diff --git a/examples/omi_physics_gravity/gltf/rounded_cube.gltf.import b/examples/omi_physics_gravity/gltf/rounded_cube.gltf.import new file mode 100644 index 0000000..d787a14 --- /dev/null +++ b/examples/omi_physics_gravity/gltf/rounded_cube.gltf.import @@ -0,0 +1,39 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://dyki347xrpc7m" +path="res://.godot/imported/rounded_cube.gltf-a0b011d2970245e2b888fef40dfd47af.scn" + +[deps] + +source_file="res://examples/omi_physics_gravity/gltf/rounded_cube.gltf" +dest_files=["res://.godot/imported/rounded_cube.gltf-a0b011d2970245e2b888fef40dfd47af.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +fbx/importer=0 +fbx/allow_geometry_helper_nodes=false +fbx/embedded_image_handling=1 +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/examples/omi_physics_gravity/test/helper/test_player.gd b/examples/omi_physics_gravity/test/helper/test_player.gd new file mode 100644 index 0000000..3642e99 --- /dev/null +++ b/examples/omi_physics_gravity/test/helper/test_player.gd @@ -0,0 +1,64 @@ +extends CharacterBody3D + + +const FOOT_OFFSET = Vector3(0.0, 0.75, 0.0) + +@export var movement_speed: float = 5.0 +@export var jump_velocity: float = 4.5 + +var horizontal_velocity := Vector3.ZERO +var gravity_last_frame := Vector3.ZERO + +@onready var initial_position: Vector3 = position +@onready var ray_cast: RayCast3D = $RayCast3D + + +func _ready() -> void: + var spring_arm: SpringArm3D = $TestPlayerHead + spring_arm.add_excluded_object(get_rid()) + + +func _physics_process(delta: float) -> void: + if Input.is_action_pressed(&"reset"): + position = initial_position + velocity = Vector3.ZERO + return + var gravity: Vector3 = (get_gravity() + gravity_last_frame) * 0.5 + _rotate_to_gravity(gravity) + if ray_cast.is_colliding(): + if Input.is_action_pressed(&"jump"): + velocity = velocity.slide(basis.y) + velocity += jump_velocity * basis.y + else: + position = ray_cast.get_collision_point() + basis * FOOT_OFFSET + velocity = Vector3.ZERO + _ground_movement() + else: + # Add the gravity. + velocity += gravity * delta + move_and_slide() + gravity_last_frame = gravity + + +func _rotate_to_gravity(gravity: Vector3) -> void: + if gravity.is_zero_approx(): + return + var b: Basis = basis + b.y = -gravity.normalized() + b.z = b.x.cross(b.y).normalized() + b.x = b.y.cross(b.z).normalized() + basis = b + + +func _ground_movement() -> void: + # Get the input direction and handle the movement/deceleration. + # As good practice, you should replace UI actions with custom gameplay actions. + var input_dir = Input.get_vector("move_left", "move_right", "move_forward", "move_back") + var direction = Vector3(input_dir.x, 0, input_dir.y) + if direction: + horizontal_velocity.x = direction.x * movement_speed + horizontal_velocity.z = direction.z * movement_speed + else: + horizontal_velocity.x = move_toward(horizontal_velocity.x, 0, movement_speed) + horizontal_velocity.z = move_toward(horizontal_velocity.z, 0, movement_speed) + velocity += basis * horizontal_velocity diff --git a/examples/omi_physics_gravity/test/helper/test_player.tscn b/examples/omi_physics_gravity/test/helper/test_player.tscn new file mode 100644 index 0000000..839a1d2 --- /dev/null +++ b/examples/omi_physics_gravity/test/helper/test_player.tscn @@ -0,0 +1,35 @@ +[gd_scene load_steps=5 format=3 uid="uid://b27cknh75i7cu"] + +[ext_resource type="Script" path="res://examples/omi_physics_gravity/test/helper/test_player.gd" id="1_pfyb6"] +[ext_resource type="Script" path="res://examples/omi_physics_gravity/test/helper/test_player_head.gd" id="2_213qy"] + +[sub_resource type="SphereShape3D" id="SphereShape3D_5j5nk"] +radius = 0.65 + +[sub_resource type="CapsuleMesh" id="CapsuleMesh_2wgql"] +radius = 0.375 +height = 1.8 + +[node name="TestPlayer" type="CharacterBody3D"] +motion_mode = 1 +script = ExtResource("1_pfyb6") + +[node name="TestPlayerHead" type="SpringArm3D" parent="." node_paths=PackedStringArray("player_body")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.08165e-12, 0.75, 2.08165e-12) +spring_length = 3.0 +script = ExtResource("2_213qy") +player_body = NodePath("..") + +[node name="Camera3D" type="Camera3D" parent="TestPlayerHead"] + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.08165e-12, 2.08165e-12, 2.08165e-12) +shape = SubResource("SphereShape3D_5j5nk") + +[node name="RayCast3D" type="RayCast3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.08165e-12, -0.65, 2.08165e-12) +target_position = Vector3(2.08165e-12, -0.2, 2.08165e-12) + +[node name="MeshInstance3D" type="MeshInstance3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.08165e-12, 0.15, 2.08165e-12) +mesh = SubResource("CapsuleMesh_2wgql") diff --git a/examples/omi_physics_gravity/test/helper/test_player_head.gd b/examples/omi_physics_gravity/test/helper/test_player_head.gd new file mode 100644 index 0000000..ebf1757 --- /dev/null +++ b/examples/omi_physics_gravity/test/helper/test_player_head.gd @@ -0,0 +1,30 @@ +extends Node3D + + +const SENSITIVITY = 0.002 + +@export var player_body: CharacterBody3D + +var pitch: float = 0.0 +var yaw: float = 0.0 + + +func _ready() -> void: + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + + +func _input(input_event: InputEvent) -> void: + if input_event is InputEventMouseMotion: + pitch = clampf(pitch - input_event.relative.y * SENSITIVITY, -1.57, 1.57) + yaw -= input_event.relative.x * SENSITIVITY + elif input_event.is_action_pressed(&"ui_cancel"): + if Input.mouse_mode == Input.MOUSE_MODE_VISIBLE: + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + else: + Input.mouse_mode = Input.MOUSE_MODE_VISIBLE + + +func _physics_process(_delta: float) -> void: + rotation = Vector3(pitch, 0.0, 0.0) + player_body.rotate_object_local(Vector3.UP, yaw) + yaw = 0.0 diff --git a/examples/omi_physics_gravity/test/helper/test_space_environment.tscn b/examples/omi_physics_gravity/test/helper/test_space_environment.tscn new file mode 100644 index 0000000..fee83d9 --- /dev/null +++ b/examples/omi_physics_gravity/test/helper/test_space_environment.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=4 format=3 uid="uid://c4vdw2w23qoki"] + +[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_6ujne"] +sky_top_color = Color(0.0117647, 0.0117647, 0.0117647, 1) +sky_horizon_color = Color(0.0117647, 0.0117647, 0.0117647, 1) +ground_bottom_color = Color(0.0117647, 0.0117647, 0.0117647, 1) +ground_horizon_color = Color(0.0117647, 0.0117647, 0.0117647, 1) +sun_angle_max = 2.0 +sun_curve = 1.0 + +[sub_resource type="Sky" id="Sky_3ftm5"] +sky_material = SubResource("ProceduralSkyMaterial_6ujne") + +[sub_resource type="Environment" id="Environment_88n3p"] +background_mode = 2 +sky = SubResource("Sky_3ftm5") +tonemap_mode = 2 + +[node name="TestEnvironment" type="WorldEnvironment"] +environment = SubResource("Environment_88n3p") + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] +transform = Transform3D(-0.866024, -0.433016, 0.250001, 0, 0.499998, 0.866026, -0.500003, 0.749999, -0.43301, 0, 0, 0) diff --git a/examples/omi_physics_gravity/test/test_earth.tscn b/examples/omi_physics_gravity/test/test_earth.tscn new file mode 100644 index 0000000..e55690a --- /dev/null +++ b/examples/omi_physics_gravity/test/test_earth.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=5 format=4 uid="uid://ca2vi6lj62t2o"] + +[ext_resource type="PackedScene" uid="uid://b27cknh75i7cu" path="res://examples/omi_physics_gravity/test/helper/test_player.tscn" id="2_62k7g"] +[ext_resource type="PackedScene" uid="uid://xhdrfkabapnt" path="res://examples/omi_physics_gravity/gltf/earth_millionth_scale/earth_millionth_scale.gltf" id="2_w6yu6"] +[ext_resource type="PackedScene" uid="uid://c4vdw2w23qoki" path="res://examples/omi_physics_gravity/test/helper/test_space_environment.tscn" id="3_3rc18"] +[ext_resource type="PackedScene" uid="uid://bpddn41uk06ct" path="res://examples/omi_physics_gravity/gltf/ramp_gravity.gltf" id="3_6mn0e"] + +[node name="TestEarthGravity" type="Node3D"] + +[node name="EarthMillionthScale" parent="." instance=ExtResource("2_w6yu6")] + +[node name="RampGravity" parent="." instance=ExtResource("3_6mn0e")] +transform = Transform3D(-4.37114e-08, 3.48787e-16, 1, 3.48787e-16, 1, -3.48787e-16, -0.999999, 3.48787e-16, -4.37114e-08, -1, 11.25, 2.08165e-12) + +[node name="TestEnvironment" parent="." instance=ExtResource("3_3rc18")] + +[node name="TestPlayer" parent="." instance=ExtResource("2_62k7g")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.84428, 7.79117, 0) diff --git a/examples/omi_physics_gravity/test/test_moon_petavius_crater.tscn b/examples/omi_physics_gravity/test/test_moon_petavius_crater.tscn new file mode 100644 index 0000000..602e596 --- /dev/null +++ b/examples/omi_physics_gravity/test/test_moon_petavius_crater.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=5 format=4 uid="uid://ci8w7amy40mmq"] + +[ext_resource type="PackedScene" uid="uid://7wp7uqivdykx" path="res://examples/omi_physics_gravity/gltf/moon_petavius_crater/moon_petavius_crater.gltf" id="1_3ef1n"] +[ext_resource type="PackedScene" uid="uid://bpddn41uk06ct" path="res://examples/omi_physics_gravity/gltf/ramp_gravity.gltf" id="2_w24s7"] +[ext_resource type="PackedScene" uid="uid://b27cknh75i7cu" path="res://examples/omi_physics_gravity/test/helper/test_player.tscn" id="2_xq66w"] +[ext_resource type="PackedScene" uid="uid://c4vdw2w23qoki" path="res://examples/omi_physics_gravity/test/helper/test_space_environment.tscn" id="3_j6m6h"] + +[node name="TestMoonPetaviusCrater" type="Node3D"] + +[node name="MoonPetaviusCraterScene" parent="." instance=ExtResource("1_3ef1n")] + +[node name="RampGravity" parent="." instance=ExtResource("2_w24s7")] +transform = Transform3D(-1, 3.48787e-16, -8.74228e-08, 3.48787e-16, 1, -3.48787e-16, 8.74228e-08, -3.48787e-16, -1, 12, 5.5, 19.5) + +[node name="TestEnvironment" parent="." instance=ExtResource("3_j6m6h")] + +[node name="TestPlayer" parent="." instance=ExtResource("2_xq66w")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.08165e-12, 2, 2.08165e-12) +movement_speed = 4.0 +jump_velocity = 2.0