FuncGodotUtil

Static class with a number of reuseable utility methods that can be called at Editor or Run Time.

Methods

Method Description Return type
print_profile_info(message: String, signature: String) Connected by the FuncGodot Map node to the build process' sub components if the Show Profiling Info build flag is set. Also called by the Map node. Void
newline() Return a string that corresponds to the current OS's newline control characters. String
Math
op_vec3_sum(lhs: Vector3, rhs: Vector3) Returns the sum of the two input vectors. Useful for lambda operations. Vector3
op_vec3_avg(array: Array[Vector3]) Returns the average vector of an array of vectors. Vector3
op_swizzle_vec3_w(xyz: Vector3, w: float) PackedFloat32Array
id_to_opengl(vec: Vector3) Conversion from id tech coordinate system to Godot, from a top-down perspective. Vector3
is_point_in_convex_hull(planes: Array[Plane], vertex: Vector3) Check if a point is inside a convex hull defined by a series of planes by an epsilon constant. Bool
Patch Def
elevate_quadratic(p0: Vector3, p1: Vector3, p2: Vector3) Returns the control points that defines a cubic curve for a equivalent input quadratic curve. Array[Vector3]
create_curve(start: Vector3, control: Vector3, end: Vector3, bake_interval: float = 0.05) Create a Curve3D and bake points. Curve3D
update_ref_curve(curve: Curve3D, p0: Vector3, p1: Vector3, p2: Vector3, bake_interval: float = 0.05) Update a Curve3D given quadratic inputs. Void
Textures
load_texture(texture_name: String, wad_resources: Array[QuakeWadFile], map_settings: FuncGodotMapSettings) earches for a Texture2D within the base texture directory or the WAD files added to map settings. If not found, a default texture is returned. Texture2D
is_skip(texture: String, map_settings: FuncGodotMapSettings) Filters faces textured with Skip during the geometry generation step of the build process. Bool
is_clip(texture: String, map_settings: FuncGodotMapSettings) Filters faces textured with Clip during the geometry generation step of the build process. Bool
is_origin(texture: String, map_settings: FuncGodotMapSettings) Filters faces textured with Origin during the parsing and geometry generation steps of the build process. Bool
filter_face(texture: String, map_settings: FuncGodotMapSettings) Filters faces textured with any of the tool textures during the geometry generation step of the build process. Bool
build_base_material(map_settings: FuncGodotMapSettings, material: BaseMaterial3D, texture: String) Adds PBR textures to an existing BaseMaterial3D. Void
build_texture_map(entity_data: Array[EntityData], map_settings: FuncGodotMapSettings) Builds both materials and sizes dictionaries for use in the geometry generation step of the build process. Both dictionaries use texture names as keys. The materials dictionary uses [Material] as values, while the sizes dictionary saves the albedo texture sizes to aid in UV mapping. Array[Dictionary]
UV Mapping
get_valve_uv(vertex: Vector3, u_axis: Vector3, v_axis: Vector3, uv_basis := Transform2D.IDENTITY, texture_size := Vector2.ONE) Returns UV coordinate calculated from the Valve 220 UV format. Vector2
get_quake_uv(vertex: Vector3, normal: Vector3, uv_basis := Transform2D.IDENTITY, texture_size := Vector2.ONE) Returns UV coordinate calculated from the original id Standard UV format. Vector2
get_face_vertex_uv(vertex: Vector3, face: FaceData, texture_size: Vector2) Determines which UV format is being used and returns the UV coordinate. Vector2
get_valve_tangent(u: Vector3, v: Vector3, normal: Vector3) Returns the tangent calculated from the Valve 220 UV format. PackedFloat32Array
get_quake_tangent(normal: Vector3, uv_y_scale: float, uv_rotation: float) Returns the tangent calculated from the original id Standard UV format. PackedFloat32Array
get_face_tangent(face: FaceData) Determines which UV format is being used and returns the tangent. PackedFloat32Array