geomob interface - Outerra/anteworld GitHub Wiki
From vehicle_script, aircraft_script or charob_script
this.geom = this.get_geomob(0);
From vehicle_script, aircraft_script or charob_script
self.geom = self:get_geomob(0)
uint get_first_bone() const; |
||
Parameter Description | Returns | Description |
---|---|---|
return: first bone ID | Get the first bone ID. | |
entity_handle get_inst_id() const; |
||
Parameter Description | Returns | Description |
return: instance ID | Get the instance ID. | |
const double3& get_pos() const; |
||
Parameter Description | Returns | Description |
return: position | Get object's position. | |
const quat& get_rot() const; |
||
Parameter Description | Returns | Description |
return: rotation | Get object's rotation quaternion. | |
double3 get_ecef_pos() const; |
||
Parameter Description | Returns | Description |
return: ECEF position | Get object's world (ECEF) position. | |
quat get_ecef_rot() const; |
||
Parameter Description | Returns | Description |
return: ECEF rotation | Get object's world (ECEF) rotation. | |
float3 get_relative_pos(bool model_space, uint joint = -1) const; |
||
Parameter Description | Returns | Description |
model_space: Compute relative coordinates versus the root bone of the parent object, else vs. attached bone. joint: Relative joint ID of the object to get the position for, instead of the root bone. |
return: relative position | Get object's relative position. |
quat get_relative_rot(bool model_space, uint joint = -1) const; |
||
Parameter Description | Returns | Description |
model_space: Compute relative coordinates versus the root bone of the parent object, else vs. attached bone. joint: Relative joint ID of the object to get the rotation for, instead of the root bone. |
return: relative rotation | Get object's relative rotation quaternion. |
float3 model_space_pos(const double3& pos) const; |
||
Parameter Description | Returns | Description |
pos: model-space coordinates to transform. | return: bone-space coordinates | Transform model-space coordinates into bone-space ones. |
pkg::transform model_space_transform(const double3& pos, const quat& rot) const; |
||
Parameter Description | Returns | Description |
pos: model-space position to transform. rot: model-space rotation to transform. |
return: bone-space transform | Transform model-space coordinates into bone-space ones. |
float3 bone_space_pos(uint bone, const float3& model_pos) const; |
||
Parameter Description | Returns | Description |
bone: bone ID. model_pos: model-space position to transform. |
return: bone-space coordinates | Transform model-space coordinates into bone-space ones. |
pkg::transform bone_space_transform(uint bone, const float3& model_pos, const quat& model_rot) const; |
||
Parameter Description | Returns | Description |
bone: bone ID. model_pos: Model-space position to transform. model_rot: Model-space rotation to transform. |
return: bone-space transform | Transform model-space coordinates into bone-space ones. |
double3 get_pos_obb_center() const; |
||
Parameter Description | Returns | Description |
return: OBB center position | Get world position of OBB center. | |
double3 get_world_pos_offset(const float3& offset, uint bone = pkg::InvalidBoneId) const; |
||
Parameter Description | Returns | Description |
offset: model's relative offset. bone: bone ID. |
return: world position | Get world position of a point in model's relative offset. |
const float3& get_scale() const; |
||
Parameter Description | Returns | Description |
return: scale | Get instance scale. | |
void set_scale(const float3& scale); |
||
Parameter Description | Returns | Description |
scale: new scale. | Set instance scale. | |
void set_pos(const double3& pos); |
||
Parameter Description | Returns | Description |
pos: new world position (ECEF). | Set object's world position (ECEF). | |
void move(const float3& vec); |
||
Parameter Description | Returns | Description |
vec: vector to move by. | Move object by the given vector. | |
void set_rot(const quat& rot); |
||
Parameter Description | Returns | Description |
rot: new rotation quaternion. | Set object's rotation quaternion. | |
void add_rot(const quat& rot); |
||
Parameter Description | Returns | Description |
rot: rotation quaternion to add. | Add rotation to object's current rotation. | |
void set_pos_rot(const double3& pos, const quat& rot); |
||
Parameter Description | Returns | Description |
pos: new position. rot: new rotation. |
Set object's position and rotation. | |
void remove_from_scene(); |
||
Parameter Description | Returns | Description |
Remove object from the scene. | ||
uint get_children_count() const; |
||
Parameter Description | Returns | Description |
return: children count | Get the number of child entities. | |
entity_handle get_child_entity_id(uint local_child_index) const; |
||
Parameter Description | Returns | Description |
local_child_index: index of the local child entity. | return: child entity ID | Get the entity ID of a child entity by local index. |
const coid::charstr& get_objurl() const; |
||
Parameter Description | Returns | Description |
return: object URL | Get the URL of the object. | |
bool get_objdef_info(ifc_out ot::pkginfo::obj& info) const; |
||
Parameter Description | Returns | Description |
info: object definition info to fill. | return: success status | Get the object definition info. |
coid::token get_obj_param(const coid::token& key, const coid::token& group) const; |
||
Parameter Description | Returns | Description |
key: parameter key. group: parameter group. |
return: parameter value | Get the value of an object parameter. |
ushort get_lod_count() const; |
||
Parameter Description | Returns | Description |
return: LOD count | Get the number of LODs (levels of detail). | |
bool has_collision_geometry() const; |
||
Parameter Description | Returns | Description |
return: has collision geometry | Check if the object has collision geometry. | |
const pkg::mesh_group* get_collision_lod() const; |
||
Parameter Description | Returns | Description |
return: collision LOD | Get the collision level of detail (LOD). | |
uint get_bone_id(const coid::token& name) const; |
||
Parameter Description | Returns | Description |
name: bone name. | return: global bone ID | Get the global bone ID by bone name. |
float3 get_obb_offset() const; |
||
Parameter Description | Returns | Description |
return: OBB offset | Get vector from the model pivot into the center of the OBB. | |
float3 get_pivot() const; |
||
Parameter Description | Returns | Description |
return: pivot position | Get the pivot position. | |
float3 get_obb_hvec() const; |
||
Parameter Description | Returns | Description |
return: OBB half-vector | Get OBB's diagonal half-vector. | |
const pkg::geom_instance_data* get_geom_instance_data_ptr() const; |
||
Parameter Description | Returns | Description |
return: geometry instance data pointer | Get geometry instance data pointer. | |
entity_handle get_eid() const; |
||
Parameter Description | Returns | Description |
return: entity ID | Return entity ID. | |
void set_custom_data(uint custom_data) const; |
||
Parameter Description | Returns | Description |
custom_data: custom data value. | Set custom data (used by scene editor). | |
uint get_custom_data() const; |
||
Parameter Description | Returns | Description |
return: custom data value | Get custom data (used by scene editor). | |
uint get_joint(const coid::token& name) const; |
||
Parameter Description | Returns | Description |
name: joint/bone name. | return: joint/bone ID | Get joint/bone ID by name. |
uint get_mesh_id(const coid::token& name, uint8 lod_group = 0xff, uint8 mat_group = 0xff) const; |
||
Parameter Description | Returns | Description |
name: mesh name. lod_group: LOD group for given base name (0xff if all LOD groups). mat_group: material group for given base name (0xff if all material groups). |
return: mesh ID for given params | Get mesh ID. |
void set_joint_visible(uint joint, bool visible, bool recursive = true); |
||
Parameter Description | Returns | Description |
joint: joint ID. visible: visibility flag. recursive: apply recursively to child joints. |
Show/hide bone hierarchy (not implemented). | |
void reset_joint(uint bone_id); |
||
Parameter Description | Returns | Description |
bone_id: bone ID. | Reset bone to default state. | |
void rotate_joint(uint bone_id, float angle, const float3& vec, bool orig = false); |
||
Parameter Description | Returns | Description |
bone_id: bone ID. angle: rotation angle in radians. vec: rotation axis vector (MUST BE normalized). orig: true if rotation should go from the bind pose, otherwise accumulate. |
Rotate bone along an axis (incremental). | |
void rotate_joint_orig(uint bone_id, float angle, const float3& vec); |
||
Parameter Description | Returns | Description |
bone_id: bone ID angle: rotation angle in radians vec: rotation axis vector (MUST BE normalized) |
Rotate bone along an axis (from default orientation). | |
void rotate_joint_cs(uint bone_id, float cos_angle, float sin_angle, const float3& vec, bool orig = false); |
||
Parameter Description | Returns | Description |
bone_id: bone ID cos_angle: cosine of rotation angle sin_angle: sine of rotation angle vec: rotation axis vector (MUST BE normalized) orig: true if rotation should go from the bind pose, otherwise accumulate |
Rotate bone along an axis (incremental, using cos/sin). | |
void rotate_joint_cs_orig(uint bone_id, float cos_angle, float sin_angle, const float3& vec); |
||
Parameter Description | Returns | Description |
bone_id: bone ID cos_angle: cosine of rotation angle sin_angle: sine of rotation angle vec: rotation axis vector (MUST BE normalized) |
Rotate bone along an axis (from default orientation, using cos/sin). | |
void move_joint(uint bone_id, const float3& vec, bool orig = false); |
||
Parameter Description | Returns | Description |
bone_id: bone ID vec: movement vector orig: true if movement should go from the bind pose, otherwise accumulate |
Move bone (incremental). | |
void move_joint_orig(uint joint, const float3& vec); |
||
Parameter Description | Returns | Description |
joint: joint ID vec: movement vector |
Move bone (from default position). | |
void set_mesh_visible(coid::token name, bool show); |
||
Parameter Description | Returns | Description |
name: mesh name show: visibility flag |
Control mesh visibility. | |
void set_mesh_visible_id(uint id, bool show); |
||
Parameter Description | Returns | Description |
id: ID from get_mesh_id with additional flags show: visibility flag |
Control mesh visibility using mesh ID. | |
void set_mesh_and_shadow_visible(coid::token name, bool show_mesh, bool show_shadow); |
||
Parameter Description | Returns | Description |
name: mesh name show_mesh: mesh visibility flag show_shadow: shadow visibility flag |
Control mesh and shadow visibility. | |
void set_mesh_and_shadow_visible_id(uint id, bool show_mesh, bool show_shadow); |
||
Parameter Description | Returns | Description |
id: ID from get_mesh_id with additional flags show_mesh: mesh visibility flag show_shadow: shadow visibility flag |
Control mesh and shadow visibility using mesh ID. | |
void is_mesh_and_shadow_visible_id(uint id, ifc_out bool& show_mesh, ifc_out bool& show_shadow); |
||
Parameter Description | Returns | Description |
id: ID from get_mesh_id with additional flags show_mesh: mesh visibility flag (output) show_shadow: shadow visibility flag (output) |
Check mesh and shadow visibility using mesh ID. | |
float3 get_joint_model_pos(uint joint) const; |
||
Parameter Description | Returns | Description |
joint: joint ID | return: joint position in model space | Get joint position in model space. |
double3 get_joint_ecef_pos(uint joint) const; |
||
Parameter Description | Returns | Description |
joint: joint ID | return: joint position in ECEF space | Get joint position in ECEF space. |
bool get_joint_ecef_tm(uint joint, ifc_out double3& pos, ifc_out quat& rot) const; |
||
Parameter Description | Returns | Description |
joint: joint ID pos: joint position in ECEF space (output) rot: joint rotation in ECEF space (output) |
return: success status | Get joint transformation in ECEF space. |
float3 get_joint_ecef_rot_z(uint joint) const; |
||
Parameter Description | Returns | Description |
joint: joint ID | return: joint rotation around Z-axis in ECEF space | Get joint rotation around Z-axis in ECEF space. |
uint get_num_bones() const; |
||
Parameter Description | Returns | Description |
return: number of bones | Get number of bones. | |
const pkg::bone_meta2* get_bone_meta_ptr() const; |
||
Parameter Description | Returns | Description |
return: pointer to bones meta information | Get constant pointer to bones meta information (parent IDs). | |
const pkg::bone_desc* get_bone_desc_ptr() const; |
||
Parameter Description | Returns | Description |
return: pointer to bones description | Get constant pointer to bones description (bone name, etc). | |
const pkg::transform* get_bone_ibp_ptr() const; |
||
Parameter Description | Returns | Description |
return: pointer to inverse bind pose transformations | Get constant pointer to inverse bind pose transformations. | |
const pkg::transform* get_bone_bp_local_ptr() const; |
||
Parameter Description | Returns | Description |
return: pointer to bones bind pose local transformations | Get constant pointer to bones bind pose local transformations. | |
pkg::transform* get_bone_local_ptr() const; |
||
Parameter Description | Returns | Description |
return: pointer to bones local transformations | Get pointer to bones local transformations. | |
coid::range<pkg::transform> get_bone_model_data() const; |
||
Parameter Description | Returns | Description |
return: range of bone model transformations | Get range of bone model transformations. | |
void set_visible(bool visible); |
||
Parameter Description | Returns | Description |
visible: visibility flag | Show/hide whole geom object. | |
bool is_visible() const; |
||
Parameter Description | Returns | Description |
return: true if the geom's visible flag is true | Check if the geom is visible. | |
bool is_ready() const; |
||
Parameter Description | Returns | Description |
return: true if the geom is fully loaded | Check if the geom is fully loaded. | |
bool get_bone_model_tm(uint joint, ifc_out float3& pos, ifc_out quat& rot) const; |
||
Parameter Description | Returns | Description |
joint: joint ID pos: position (output) rot: rotation (output) |
return: success status | Get current bone model space transformation from previous frame. |
bool get_bone_model_tm_offset(uint joint, const float3& offset, ifc_out float3& pos, ifc_out quat& rot) const; |
||
Parameter Description | Returns | Description |
joint: joint ID offset: offset vector pos: position (output) rot: rotation (output) |
return: success status | Get bone model space transformation from previous frame with extra offset. |
bool get_bone_ecef_bp_tm(uint joint, ifc_out double3& pos, ifc_out quat& rot) const; |
||
Parameter Description | Returns | Description |
joint: joint ID pos: position in ECEF space (output) rot: rotation in ECEF space (output) |
return: success status | Get bone bind pose ECEF space transformation (inverse of IBP). |
bool get_bone_model_bp_tm(uint joint, ifc_out float3& pos, ifc_out quat& rot) const; |
||
Parameter Description | Returns | Description |
joint: joint ID pos: position in model space (output) rot: rotation in model space (output) |
return: success status | Get bone bind pose model space transformation (inverse of IBP). |
bool get_bone_local_bp_tm(uint joint, ifc_out float3& pos, ifc_out quat& rot) const; |
||
Parameter Description | Returns | Description |
joint: joint ID pos: position in local space (output) rot: rotation in local space (output) |
return: success status | Get bone local bind pose transformation. |
const pkg::bone_gpu_data* get_bone_skin_dq(uint bone_id) const; |
||
Parameter Description | Returns | Description |
bone_id: bone ID | return: pointer to bone skin transformation data | Get bone skin transformation for previous frame. |
bool get_bone_local_tm(uint joint, ifc_out float3& pos, ifc_out quat& rot) const; |
||
Parameter Description | Returns | Description |
joint: joint ID pos: position in local space (output) rot: rotation in local space (output) |
return: success status | Get current bone local space transformation from parent. |
uint get_joint_from_mesh(uint mesh_id) const; |
||
Parameter Description | Returns | Description |
mesh_id: mesh ID | return: bone ID to which the given mesh is attached | Get bone ID to which the mesh is attached. |
uint get_mesh_attached_to_joint(uint joint_id, int idx = 0) const; |
||
Parameter Description | Returns | Description |
joint_id: relative bone ID idx: order number of the mesh (multiple meshes can be on the same bone) |
return: mesh ID of the idx-th mesh attached to given bone | Get mesh ID attached to a given bone. |
const pkg::mesh_desc* get_meshes_ptr() const; |
||
Parameter Description | Returns | Description |
return: pointer to mesh descriptions | Get constant pointer to mesh descriptions. | |
const pkg::mesh_data_cpu* get_meshes_data_ptr() const; |
||
Parameter Description | Returns | Description |
return: pointer to mesh data | Get constant pointer to mesh data. | |
const pkg::mesh_group* get_lods_ptr() const; |
||
Parameter Description | Returns | Description |
return: pointer to LOD groups | Get constant pointer to LOD groups. | |
const pkg::mesh_group* get_collision_meshes_ptr() const; |
||
Parameter Description | Returns | Description |
return: pointer to collision meshes | Get constant pointer to collision meshes. | |
ushort* get_mesh_flags_ptr() const; |
||
Parameter Description | Returns | Description |
return: pointer to mesh flags | Get pointer to mesh flags. | |
const pkg::mesh_data_static_cpu* get_mesh_data_static_ptr(); |
||
Parameter Description | Returns | Description |
return: pointer to static mesh data | Get pointer to static mesh data. | |
coid::range<const pkg::mesh_desc> get_meshes() const; |
||
Parameter Description | Returns | Description |
return: range of mesh descriptions | Get range of mesh descriptions. | |
coid::dynarray<pkg::mesh_group> get_lods() const; |
||
Parameter Description | Returns | Description |
return: dynamic array of LOD groups | Get dynamic array of LOD groups. | |
pkg::mesh_group get_collision_meshes() const; |
||
Parameter Description | Returns | Description |
return: collision meshes | Get collision meshes. | |
bool get_collision_mesh_ecef_tm(uint mesh_id, ifc_out double3& pos, ifc_out quat& rot) const; |
||
Parameter Description | Returns | Description |
mesh_id: mesh ID of collision mesh pos: world position of collision shape (output) rot: world rotation of collision shape (output) |
return: false if given mesh_id was wrong | Get collision mesh world transformation with mesh ID. |
void attach_to(const iref<ot::geomob>& geom, uint joint_id = pkg::InvalidBoneId, bool preserve_location = true); |
||
Parameter Description | Returns | Description |
geom: reference to geom object joint_id: joint ID preserve_location: flag to preserve location |
Attach to another geom object. | |
entity_handle attach_geom(const coid::token& url, const coid::token& joint, const double3& pos, const quat& rot); |
||
Parameter Description | Returns | Description |
---|---|---|
url: URL of geom joint: joint name pos: position rot: rotation |
return: entity handle | Attach geom to another entity. |
bool is_attached() const; |
||
Parameter Description | Returns | Description |
---|---|---|
return: true if this geom is attached to another one | Check if the geom is attached to another. | |
uint parent_joint() const; |
||
Parameter Description | Returns | Description |
return: bone of parent object this object is attached to | Get the bone of the parent object this object is attached to. | |
void get_world_transform(ifc_out double3& pos, ifc_out quat& rot) const; |
||
Parameter Description | Returns | Description |
pos: world position (output) rot: world rotation (output) |
Get world transform of the geom. | |
uint get_mtl_count() const; |
||
Parameter Description | Returns | Description |
return: number of materials | Get number of materials. | |
uint get_mtl_id(uint id) const; |
||
Parameter Description | Returns | Description |
id: material ID | return: material ID | Get material ID. |
float get_internal_temperature(uint channel) const; |
||
Parameter Description | Returns | Description |
channel: channel number (0..3) | return: internal object temperature in degrees Celsius | Get internal temperature. |
void set_internal_temperature(uint channel, float temperature); |
||
Parameter Description | Returns | Description |
channel: channel number (0..3) temperature: temperature in degrees Celsius |
Set internal temperature. | |
const pkg::mesh_data_static_cpu* get_mesh_data_static_cpu(uint mesh) const; |
||
Parameter Description | Returns | Description |
mesh: mesh ID | return: pointer to static mesh data | Get pointer to static mesh data for a specific mesh. |
const pkg::mesh_data_cpu* get_mesh_data_cpu(uint mesh) const; |
||
Parameter Description | Returns | Description |
mesh: mesh ID | return: pointer to mesh data | Get pointer to mesh data for a specific mesh. |
const int2* get_positions(const pkg::mesh_data_static_cpu* mds) const; |
||
Parameter Description | Returns | Description |
mds: pointer to static mesh data | return: pointer to positions | Get positions from static mesh data. |
const ushort* get_indices(const pkg::mesh_data_static_cpu* mds) const; |
||
Parameter Description | Returns | Description |
mds: pointer to static mesh data | return: pointer to indices | Get indices from static mesh data. |
pkg::transform get_mesh_model_transform(uint mesh_id) const; |
||
Parameter Description | Returns | Description |
mesh_id: mesh ID | return: mesh model transformation | Convert internal float4x3 to transform. |
uint create_dynamic_lightmap(uint width, uint height); |
||
Parameter Description | Returns | Description |
width: width of the lightmap height: height of the lightmap |
return: lightmap ID | Create a dynamic lightmap. |
void destroy_dynamic_lightmap(uint lightmap_id); |
||
Parameter Description | Returns | Description |
lightmap_id: lightmap ID | Destroy a dynamic lightmap. | |
uint get_dynamic_lightmap_id() const; |
||
Parameter Description | Returns | Description |
return: lightmap ID | Get dynamic lightmap ID. | |
uint add_light_block(uint x, uint y, uint width, uint height); |
||
Parameter Description | Returns | Description |
x: x position y: y position width: width of the block height: height of the block |
return: light block ID | Add a light block. |
void remove_light_block(uint light_block_id); |
||
Parameter Description | Returns | Description |
light_block_id: light block ID | Remove a light block. | |
void turn_on_block(uint light_block_id, uint rgbi); |
||
Parameter Description | Returns | Description |
light_block_id: light block ID rgbi: RGBI color |
Turn on a light block. | |
void turn_off_block(uint light_block_id); |
||
Parameter Description | Returns | Description |
light_block_id: light block ID | Turn off a light block. | |
void turn_off_lightmap(); |
||
Parameter Description | Returns | Description |
Turn off the lightmap. | ||
void set_emissive_multiplier(float m); |
||
Parameter Description | Returns | Description |
m: emissive multiplier | Set emissive multiplier. | |
float get_emissive_multiplier(); |
||
Parameter Description | Returns | Description |
return: emissive multiplier | Get emissive multiplier. | |
short get_excluded_passes() const; |
||
Parameter Description | Returns | Description |
return: excluded passes | Get excluded passes. | |
void add_excluded_pass(short pass_flag); |
||
Parameter Description | Returns | Description |
pass_flag: pass flag to be excluded | Add an excluded pass. | |
void remove_excluded_pass(short pass_flag); |
||
Parameter Description | Returns | Description |
pass_flag: pass flag to be removed | Remove an excluded pass. | |
coid::dynarray<coid::charstr> get_displays_names() const; |
||
Parameter Description | Returns | Description |
return: dynamic array of display names | Get display names. | |
display_handle create_display(uint width, uint height, const coid::token& display_name); |
||
Parameter Description | Returns | Description |
width: width of the display height: height of the display display_name: name of the display |
return: display handle | Create a display. |
void remove_display(display_handle handle); |
||
Parameter Description | Returns | Description |
handle: display handle | Remove a display. | |
iref<ot::canvas> get_display_canvas(display_handle display_id); |
||
Parameter Description | Returns | Description |
display_id: display handle | return: canvas reference | Get canvas of a display. |
void set_in_interior_flag(bool val); |
||
Parameter Description | Returns | Description |
val: flag value | Set the interior flag. | |
coid::dynarray<entity_handle> get_attached_entities() const; |
||
Parameter Description | Returns | Description |
return: dynamic array of attached entities | Get attached entities. | |
void get_bones_with_attributes(ifc_out coid::dynarray32<uint>& bones_ids_out); |
||
Parameter Description | Returns | Description |
bones_ids_out: output array of bone IDs | Get bones with attributes. | |
void get_bones_containing_attribute(coid::token attribute_key, ifc_out coid::dynarray32<uint>& bones_ids_out); |
||
Parameter Description | Returns | Description |
attribute_key: attribute key bones_ids_out: output array of bone IDs |
Get bones containing a specific attribute. | |
bool get_bone_attributes_keys(uint bone_id, ifc_out coid::dynarray32<coid::charstr>& bone_attributes_keys_out); |
||
Parameter Description | Returns | Description |
bone_id: bone ID bone_attributes_keys_out: output array of attribute keys |
return: true if successful | Get bone attribute keys. |
bool get_bone_attribute_value(uint bone_id, coid::token attribute_key, ifc_out coid::charstr& attribute_value_out); |
||
Parameter Description | Returns | Description |
---|---|---|
bone_id: bone ID attribute_key: attribute key attribute_value_out: output attribute value |
return: true if successful | Get bone attribute value. |
ot::knobs::knob_data get_knob_data(uint bone_id) const; |
||
Parameter Description | Returns | Description |
---|---|---|
bone_id: bone ID | return: knob data | Get knob data for a bone. |