Types
LookAtAxis = enum AxisX = 0, AxisY, AxisZ, AxisMinusX, AxisMinusY, AxisMinusZ
- Source Edit
GameObject = ref object of RootObj position*: Vec3 rotation*: Quat radius*: float rotation_order*: RotationOrder scale*: Vec3 dimensions*: Vec3 bound_box*: (Vec3, Vec3) object_color*: Vec4 matrix_parent_inverse*: Mat4 scene* {.cursor.}: Scene source_scene_name*: string visible*: bool parent* {.cursor.}: GameObject children*: seq[GameObject] auto_update_matrix*: bool world_matrix*: Mat4 bone_matrix_inverse*: Mat4 properties*: Table[string, JsonNode] name*: string original_name*: string lod_objects*: seq[GameObject] parent_bone_index*: int body*: Body avg_poly_area*: float avg_poly_length*: float zindex*: float center*: Vec3 world_center*: Vec4
- Source Edit
ObjectType = enum TGameObject, TMesh, TCamera, TLight, TArmature
- private Source Edit
Procs
proc clear_parent(self: GameObject; keep_transform: bool = true) {. ...raises: [Exception], tags: [RootEffect].}
- Source Edit
proc clone(self: GameObject; recursive: bool = true; with_behaviours: bool = true; name: string = self.name; new_parent: GameObject = self.parent; scene: Scene = self.scene; instance_body: bool = true): GameObject {....raises: [Exception], tags: [RootEffect].}
- Makes a clone of the object and its children (unless recursive is false). Source Edit
proc clone_impl(self: GameObject; n: var GameObject; recursive: bool; with_behaviours: bool; name: string; new_parent: GameObject; scene: Scene; instance_body: bool): GameObject {. ...raises: [Exception], tags: [RootEffect].}
- Source Edit
proc convert_bone_child_to_bone_parent(self: GameObject) {. ...raises: [ValueError, Exception], tags: [RootEffect].}
- Source Edit
proc destroy(self: GameObject; recursive: bool = true) {....raises: [Exception], tags: [RootEffect].}
- Destroy the object and free all unused resources previously used by it. It will also destroy its children unless you set recursive to false. Source Edit
proc get_local_dimensions(self: GameObject): Vec3 {....raises: [], tags: [].}
- Calculate the local dimensions of the object, i.e. the size of the bounding box with the scale of the object. Source Edit
proc get_local_matrix(self: GameObject): Mat4 {....raises: [ValueError], tags: [].}
- Source Edit
proc get_local_size(self: GameObject): float {....raises: [], tags: [].}
- Calculates the size of the largest dimension of the object in local coordinates. Source Edit
proc get_local_X_vector(self: GameObject): Vec3 {....raises: [ValueError], tags: [].}
- Get the vector of the X axis of the object in local space. Source Edit
proc get_local_Y_vector(self: GameObject): Vec3 {....raises: [ValueError], tags: [].}
- Get the vector of the Y axis of the object in local space. Source Edit
proc get_local_Z_vector(self: GameObject): Vec3 {....raises: [ValueError], tags: [].}
- Get the vector of the Z axis of the object in local space. Source Edit
proc get_top_ancestor(self: GameObject; top_level_parents: seq[GameObject] = @[]): GameObject {. ...raises: [], tags: [].}
- Find the topmost ancestor (e.g. parent of parent of parent...) or an object contained in top_level_parents, whatever happens first. Source Edit
proc get_world_dimensions(self: GameObject): Vec3 {....raises: [Exception], tags: [RootEffect].}
- Calculate the world dimensions of the object, i.e. the size of the bounding box in world scale. Source Edit
proc get_world_matrix(self: GameObject): Mat4 {....raises: [ValueError], tags: [].}
- Source Edit
proc get_world_position(self: GameObject): Vec3 {....raises: [ValueError], tags: [].}
- Source Edit
proc get_world_position_rotation(self: GameObject): (Vec3, Quat) {. ...raises: [ValueError], tags: [].}
- Source Edit
proc get_world_rotation(self: GameObject): Quat {....raises: [ValueError], tags: [].}
- Source Edit
proc get_world_scale(self: GameObject): float {....raises: [], tags: [].}
- Source Edit
proc get_world_scale_vector(self: GameObject): Vec3 {....raises: [ValueError], tags: [].}
- Gets the world scale vector in local coordinates (i.e. relative to the current object orientation). Source Edit
proc get_world_size(self: GameObject): float {....raises: [Exception], tags: [RootEffect].}
- Calculates the size of the largest dimension of the object in world coordinates. Source Edit
proc get_world_X_vector(self: GameObject): Vec3 {....raises: [ValueError], tags: [].}
- Get the vector of the X axis of the object in world space. Source Edit
proc get_world_Y_vector(self: GameObject): Vec3 {....raises: [ValueError], tags: [].}
- Get the vector of the Y axis of the object in world space. Source Edit
proc get_world_Z_vector(self: GameObject): Vec3 {....raises: [ValueError], tags: [].}
- Get the vector of the Z axis of the object in world space. Source Edit
proc hide(self: GameObject; recursive: static[bool] = true)
- Source Edit
proc initGameObject(self: GameObject; engine: MyouEngine; name: string = ""; scene: Scene = nil): GameObject {....raises: [Exception], tags: [RootEffect].}
- Source Edit
proc local_to_world(self: GameObject; point: Vec3): Vec3 {....raises: [ValueError], tags: [].}
- Transforms a point in local coordinates to world coordinates. Source Edit
proc newGameObject(engine: MyouEngine; name: string = ""; scene: Scene = nil): GameObject {. ...raises: [Exception], tags: [RootEffect].}
- Source Edit
proc parent_to(self: GameObject; parent: GameObject; keep_transform: bool = true) {. ...raises: [Exception], tags: [RootEffect].}
- Sets the parent of the object, while adding it to the same scene if needed, as well as keeping the same transform in world space (unless you set keep_transform to false). Source Edit
proc remove(self: GameObject; recursive: bool = true) {....raises: [Exception], tags: [RootEffect].}
- Remove the object from the scene it is in, without destroying it. It will also remove its children unless you set recursive to false. Source Edit
proc rotate_quat(self: GameObject; q: Quat; relative_object: GameObject = nil): GameObject {. discardable, ...raises: [ValueError], tags: [].}
- Source Edit
proc rotate_x(self: GameObject; angle: SomeFloat; relative_object: GameObject = nil)
- Source Edit
proc rotate_x_deg(self: GameObject; angle: SomeFloat; relative_object: GameObject = nil)
- Source Edit
proc rotate_y(self: GameObject; angle: SomeFloat; relative_object: GameObject = nil)
- Source Edit
proc rotate_y_deg(self: GameObject; angle: SomeFloat; relative_object: GameObject = nil)
- Source Edit
proc rotate_z(self: GameObject; angle: SomeFloat; relative_object: GameObject = nil)
- Source Edit
proc rotate_z_deg(self: GameObject; angle: SomeFloat; relative_object: GameObject = nil)
- Source Edit
proc set_local_size(self: GameObject; size: SomeFloat)
- Sets the size of the object in local cordinates, given by the desired largest dimension of the object. The other two dimensions are scaled proportionally. If the object dimensions are zero, no action is taken. Source Edit
proc set_name(self: GameObject; name: string) {....raises: [Exception], tags: [RootEffect].}
- Source Edit
proc set_parent(self: GameObject; parent: GameObject; keep_transform: bool = true) {....raises: [Exception], tags: [RootEffect].}
- Sets the parent of the object, while keeping the same transform in world space (unless you set keep_transform to false). Source Edit
proc set_rotation_order(self: GameObject; order: RotationOrder) {. ...raises: [ValueError], tags: [].}
- Source Edit
proc set_visibility(self: GameObject; visible: bool; recursive: static[bool] = true)
- Source Edit
proc set_world_position(self: GameObject; position: Vec3) {. ...raises: [ValueError], tags: [].}
- Source Edit
proc set_world_position_rotation(self: GameObject; position: Vec3; rotation: Quat) {....raises: [ValueError], tags: [].}
- Source Edit
proc set_world_rotation(self: GameObject; rotation: Quat) {. ...raises: [ValueError], tags: [].}
- Source Edit
proc set_world_size(self: GameObject; size: SomeFloat)
- Sets the size of the object in world cordinates, given by the desired largest dimension of the object. The other two dimensions are scaled proportionally. If the object dimensions are zero, no action is taken. Source Edit
proc show(self: GameObject; recursive: static[bool] = true)
- Source Edit
proc translate(self: GameObject; vector: Vec3; relative_object: GameObject = nil): GameObject {. discardable, ...raises: [ValueError], tags: [].}
- Source Edit
proc translate_x(self: GameObject; x: SomeFloat; relative_object: GameObject = nil): GameObject {.discardable.}
- Source Edit
proc translate_y(self: GameObject; y: SomeFloat; relative_object: GameObject = nil): GameObject {.discardable.}
- Source Edit
proc translate_z(self: GameObject; z: SomeFloat; relative_object: GameObject = nil): GameObject {.discardable.}
- Source Edit
proc update_matrices(self: GameObject) {....raises: [ValueError], tags: [].}
- Source Edit
proc world_to_local(self: GameObject; point: Vec3): Vec3 {....raises: [ValueError], tags: [].}
- Transforms a point in world coordinates to local coordinates. If the object has a scale of 0, the point is not transformed. Source Edit
Methods
method get_armature(self: GameObject): Armature {.base, ...raises: [], tags: [].}
- Source Edit
method is_armature(self: GameObject): bool {.base, ...raises: [], tags: [].}
- Source Edit
Iterators
iterator children_recursive(self: GameObject; include_self: static[bool] = false): GameObject
- Iterate all the descendants of the object, i.e. its children, the children's children an so on. Source Edit
Templates
template children_recursive_and_self(self: GameObject): GameObject
- Iterate all the descendants of the object, and include itself in the iteration. Source Edit