Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
ModuleSceneObjectTree Class Reference

This module is used to represent a list of instances of other scene objects. More...

Inheritance diagram for ModuleSceneObjectTree:
ModuleSceneObject ModuleSceneItem ModuleGlObject ModuleProjectItem ModuleObject OfModule ResourceUser EventObject CoreCustomData CoreBaseObject CoreBaseType

Public Member Functions

ResourceDatacreate_resource (const int &id, void *data) const override
 
void on_resource_update (const int &id, ResourceData *resource) override
 
GMathBbox3d get_bbox (const bool &deformed=true, GeometryOverride *override_data=0) const override
 Return the bbox in local space.
 
GMathBbox3d get_bbox_at (const CtxEval &eval_ctx, const double &time, const bool &deformed=true, GeometryOverride *override_data=0) const override
 Evaluate and return the bbox in local space at the specified time.
 
unsigned int get_object_count () const override
 Return the total number of sub objects.
 
double get_geometry_count () const override
 Return the total number of geometries.
 
double get_primitive_count () const override
 Return the total number of primitives.
 
const unsigned int & get_object_shading_group_count (const unsigned int &sub_object_index) const override
 Return the number of shading groups for the specified sub object //!
 
unsigned int get_object_shading_group_offset (const unsigned int &sub_object_index) const override
 Return the shading group offset for the specified sub object //!
 
const unsigned int & get_object_active_material_count (const unsigned int sub_object_index) const override
 
const ModuleMaterial::Flags & get_object_all_material_flags (const unsigned int sub_object_index) const override
 
const ModuleMaterial::Flags & get_object_common_material_flags (const unsigned int sub_object_index) const override
 
unsigned int get_shading_group_sub_object_index (const unsigned int &shading_group_index) const override
 
GeometryOverrideget_geometry_override (const GeometryOverrideConfig &config) const override
 
void get_geometries (CoreArray< ModuleSceneObjectGeometry > &handles, GeometryOverride *override) const override
 
void get_geometries_at (const CtxEval &eval_ctx, const double &anim_dt, CoreArray< ModuleSceneObjectGeometry > &handles, GeometryOverride *override) const override
 
void get_geometry (const CoreBasicArray< unsigned int > &geometry_id_hierarchy, CoreArray< ModuleSceneObjectGeometry > &handles, GeometryOverride *override=0) const override
 
void get_geometry_at (const CoreBasicArray< unsigned int > &geometry_id_hierarchy, const CtxEval &eval_ctx, const double &anim_dt, CoreArray< ModuleSceneObjectGeometry > &handles, GeometryOverride *override=0) const override
 
ModuleGeometryget_support () const
 Get the geometry acting as a support for instances.
 
const CoreBasicArray< unsigned
int > & 
get_support_point_indices () const
 Get the indices of the points of the support geometry used to place the instances. These are indices before decimation.
 
const CoreBasicArray
< ModuleSceneObject * > & 
get_base_objects () const
 Get the list of base objects. Instances are indices into this list.
 
void get_objects (CoreArray< ModuleSceneObject * > &sub_objects) override
 Get the list of sub objects, corresponding to all the leaves of this scene object tree.
 
const CoreBasicArray< unsigned
int > & 
get_base_objects_shading_group_offset () const
 Get the shading groups offset for each base object.
 
const CoreBasicArray< unsigned
int > & 
get_raw_instances () const
 
const CoreBasicArray< unsigned
int > & 
get_instances () const
 Get the indices of the used objects (see get_base_objects), after decimation.
 
bool has_instances () const
 Tell if the object support instancing (i.e. cb_get_instances callback has been implemented)
 
bool has_time_per_instance () const
 Tell if the object is overriding the time of instances.
 
unsigned int get_time_objects_count () const
 
const CoreBasicArray< unsigned
int > & 
get_instances_time_indices () const
 
CoreArray< float > get_instances_time_offsets () const
 Get the time offset applied on each instances.
 
unsigned int get_base_object_index (unsigned int time_object_index) const
 Return the index of the base object associated to the given variation time object index.
 
double get_time_offset (unsigned int time_object_index) const
 
unsigned int get_instance_count () const
 Return the number of instances after decimation.
 
GMathMatrix4x4d get_instance_matrix (const unsigned int &index) const
 
const GMathMatrix4x4d & get_object_final_matrix (const unsigned int &object_index, const GeometryOverride *override) const
 
const GMathMatrix4x4d & get_object_final_inverse_matrix (const unsigned int &object_index, const GeometryOverride *override) const
 
GMathMatrix4x4d get_instance_final_matrix (const unsigned int &instance_index, const GeometryOverride *override) const
 
const GMathMatrix4x4d & get_object_final_motion_matrix (const CtxEval &eval_ctx, const CtxMotionBlur &mb_ctx, GeometryOverride *override, unsigned int object_index, unsigned int sample_index) const
 
GMathMatrix4x4d get_object_final_motion_matrix (const CtxEval &eval_ctx, const CtxMotionBlur &mb_ctx, GeometryOverride *override, unsigned int object_index, unsigned int sample_index, double span_weight) const
 
GMathMatrix4x4d get_instance_motion_matrix (const CtxEval &eval_ctx, const CtxMotionBlur &mb_ctx, GeometryOverride *override, unsigned int instance_index, unsigned int sample_index) const
 
GMathMatrix4x4d get_instance_motion_matrix (const CtxEval &eval_ctx, const CtxMotionBlur &mb_ctx, GeometryOverride *override, unsigned int instance_index, unsigned int sample_index, double span_weight) const
 
GMathMatrix4x4d get_instance_final_motion_matrix (const CtxEval &eval_ctx, const CtxMotionBlur &mb_ctx, GeometryOverride *override, unsigned int instance_index, unsigned int sample_index) const
 
GMathMatrix4x4d get_instance_final_motion_matrix (const CtxEval &eval_ctx, const CtxMotionBlur &mb_ctx, GeometryOverride *override, unsigned int instance_index, unsigned int sample_index, double span_weight) const
 
void get_instance_transforms (CoreVector< GMathVec3d > &translations, CoreVector< GMathMatrix3x3f > &rotations, CoreVector< GMathVec3f > &scales) const
 
void get_instance_matrices (CoreArray< GMathMatrix4x4d > &matrices) const
 
void get_instance_matrices_at (const CtxEval &eval_ctx, const double &time, CoreArray< GMathMatrix4x4d > &matrices) const
 
void dirty_support_geometry ()
 
void dirty_base_objects ()
 
void dirty_reference_bbox ()
 
void clear_base_objects ()
 Clear base objects resource, basically stuff like shading group offset or material flags of all sub objects.
 
void clear_topology ()
 Clear base topology resource, corresponding to non geometric data, basically indices of scatter points on the support, per instance time offset, etc...
 
void clear_matrices ()
 Clear base matrices resource, containing all instance matrices.
 
void clear_tree ()
 Clear tree resource, containing the tree acceleration structure.
 
size_t get_memory_size () const override
 
void set_matrices_compression (const bool &use_compression)
 
const bool & is_compression_enabled ()
 
GeometryOverrideget_sub_override (GeometryOverride *override, unsigned int object_index)
 
const GeometryOverrideConfigget_override_config (GeometryOverride *override)
 
- Public Member Functions inherited from ModuleSceneObject
void register_component_implementation ()
 
const CoreArray< CoreString > & get_shading_groups () const
 Return the array of shading group names. C++ only.
 
const CoreArray
< ModuleMaterial * > & 
get_materials () const
 Return the array of materials. C++ only.
 
const CoreArray< ModuleTexture * > & get_clip_maps () const
 Return the array of clip map textures. C++ only.
 
const CoreArray
< ModuleDisplacement * > & 
get_displacements () const
 Return the array of displacements. C++ only.
 
const CoreArray
< ShadingVariablesCtx * > & 
get_sg_shading_variables () const
 Return the array of shading variables per shading group. C++ only.
 
const unsigned int & get_shading_group_count () const
 Return the number of shading groups.
 
const unsigned int & get_material_count () const
 Return the number of shading materials.
 
const unsigned int & get_displacement_count () const
 Return the number of displacements.
 
const unsigned int & get_clip_map_count () const
 Return the number of clip maps.
 
const CoreStringget_shading_group (const unsigned int &index) const
 Return the name of the shading group from the specified index.
 
ModuleMaterialget_material (const unsigned int &index) const
 Return the material assigned to the specified shading group index.
 
ModuleTextureget_clip_map (const unsigned int &index) const
 Return the texture used as clip map assigned to the specified shading group index.
 
ModuleDisplacementget_displacement (const unsigned int &index) const
 Return the displacement assigned to the specified shading group index.
 
ShadingVariablesCtxget_sg_shading_variables (const unsigned int &index) const
 Return shading variables assigned to the specified shading group index.
 
void dirty_shading_groups () const
 Flag shading groups as dirty. For internal use only.
 
void dirty_materials () const
 Flag materials as dirty. For internal use only.
 
void dirty_material_flags () const
 Flag material flags as dirty. For internal use only.
 
void dirty_clip_maps () const
 Flag clip maps as dirty. For internal use only.
 
void dirty_displacements () const
 Flag displacements as dirty. For internal use only.
 
void dirty_sg_shading_variables () const
 Flag shading group shading variables as dirty. For internal use only.
 
ModuleMaterialget_override_material () const
 Return the override material.
 
void set_override_material (ModuleMaterial *material)
 Set the override material.
 
const CoreArray< ModuleLight * > & get_lights () const
 Return the explicit array of light assigned to the scene object. C++ only.
 
ModuleGroupget_light_group () const
 Return the light group explicitly attached to the scene object.
 
const unsigned int & get_light_count () const
 Return the number of explicit lights assigned to the scene object.
 
ModuleLightget_light (const unsigned int &index) const
 Return the explicit light assigned to the scene object at the specified index.
 
bool has_lights () const
 Return true if the scene object has lights.
 
bool is_emission_importance_sampling_enabled () const
 Return true if the scene object emissive shading groups have to be sampled as a light.
 
bool is_emission_texture_importance_sampling_enabled () const
 Return true if emission texture must be importance sampled if emission importance sampling is on.
 
EmissionTextureImportanceSamplingMode get_emission_texture_importance_sampling_mode () const
 Return true if emission texture must be importance sampled if emission importance sampling is on.
 
bool is_emission_importance_sampling_local () const
 Return true if the scene object emissive shading groups have to be sampled as an individual light.
 
bool is_emission_importance_sampling_global () const
 Return true if the scene object emissive shading groups have to be sampled as a light in the global sampling acceleration structure.
 
bool is_emissive_material_light () const
 Return true if the scene object emissive shading groups have to be sampled as a material.
 
const unsigned int & get_emission_sample_count () const
 Return the number of sample that have to be used to sample the geometry if it is a light.
 
bool cast_shadows () const
 Return true if the scene object casts shadows.
 
bool receive_shadows () const
 Return true if the scene object receive shadows.
 
bool receive_self_shadows () const
 Return true if the scene object receive self shadows.
 
bool unseen_by_renderer () const
 Return true if the scene object is invisible to the renderer.
 
bool unseen_by_camera () const
 Return true if the scene object is invisible to the camera.
 
bool unseen_by_rays () const
 Return true if the scene object is unseen by rays.
 
bool unseen_by_reflections () const
 Return true if the scene object is unseen by reflections.
 
bool unseen_by_refractions () const
 Return true if the scene object is unseen by refractions.
 
bool unseen_by_gi () const
 Return true if the scene object is unseen by global illumination.
 
bool unseen_by_sss () const
 Return true if the scene object is unseen by sub-surface scattering.
 
bool unseen_by_query () const
 Return true if the scene object is unseen by queries.
 
void set_unseen_by_query (const bool &value)
 set if the scene object is unseen by queries.
 
bool seen_by_query () const
 Return true if the scene object is seen by queries eventhough not visible.
 
void set_seen_by_query (const bool &value)
 set if the scene object is seen by queries eventhough not visible.
 
bool is_emitter () const
 Return true if the scene object emits global illumination.
 
bool is_matte_object () const
 Return true if the scene object is matte.
 
const GMathVec3d & get_matte_color () const
 Return the matte color.
 
const double & get_matte_alpha () const
 Return the matte alpha.
 
const unsigned int & get_display_mode () const
 Return the display mode.
 
const unsigned int & get_highlight_mode () const
 Return the highlight mode.
 
const double & get_raytrace_geometric_offset () const
 Return the raytrace geometric offset in meter.
 
bool is_visible_by_ray_type (const unsigned int &ray_type) const
 
const unsigned int & get_active_material_count () const
 
const ModuleMaterial::Flags & get_all_material_flags () const
 
const ModuleMaterial::Flags & get_common_material_flags () const
 
virtual void get_geometry_attributes_override (const GeometryOverrideConfig &config, GeometryAttributesOverride &attributes) const
 
virtual const ResourceDataget_resource_override (const int &resource_id, GeometryOverride &override_data, void *data=0) const
 
void ray_hit (const CtxEval &eval_ctx, CtxShader &shader_ctx, GeometryRaytraceCtx &raytrace_ctx) const
 
void ray_hit_nearest (const CtxEval &eval_ctx, CtxShader &shader_ctx, GeometryRaytraceCtx &raytrace_ctx) const
 
void frustum_hit (const CtxEval &eval_ctx, CtxShader &shader_ctx, GeometryFrustumCtx &frustum_ctx) const
 
void ray_frustum_hit (const CtxEval &eval_ctx, CtxShader &shader_ctx, GeometryRayFrustumCtx &ray_frustum_ctx) const
 
bool is_geometry () const
 Return true if the scene object is a geometry.
 
bool is_compound () const
 Return true if the scene object is a composition of other objects (i.e: combiner, scatterer, geometry bundle)
 
bool is_geometry_bundle ()
 Return true if the scene object is a geometry bundle.
 
virtual double get_point_count () const
 Return the total number of points.
 
unsigned int sample_geometries_one_point (const CoreBasicArray< ModuleSceneObjectGeometry > &geometries, CoreArray< CoreArray< GeometryPrimitiveSampleDescriptor > > &geometry_samples, const long &seed, const double jittering=0.0) const
 
unsigned int sample_geometries_count (const CoreBasicArray< ModuleSceneObjectGeometry > &geometries, CoreArray< GeometryPrimitiveSampleDescriptor > *geometry_samples, const CtxEval &eval_ctx, const SamplingAlgorithm &algorithm, const SamplingSpace &space, const unsigned int &max_sample_count, const long &seed=0, AppProgressBar *progress_bar=0) const
 
unsigned int sample_geometries_density (const CoreBasicArray< ModuleSceneObjectGeometry > &geometries, CoreArray< GeometryPrimitiveSampleDescriptor > *geometry_samples, const CtxEval &eval_ctx, const SamplingAlgorithm &algorithm, const SamplingSpace &space, const double &max_density, const long &seed=0, AppProgressBar *progress_bar=0) const
 
bool has_shading_variables () const
 
void set_shading_variables (const CoreString &text)
 
void remove_all_shading_variables ()
 
CoreVariant get_shading_variable (const CoreString &variable_name) const
 
ShadingVariablesCtxget_shading_variables () const
 
Structure * get_structure () const
 
bool is_overriding_children_visibility () const
 
void add_geometry_override (GeometryOverride *override) const
 
void set_custom_id (const unsigned int &value)
 Set the Custom ID.
 
unsigned int get_custom_id () const
 Get the Custom ID.
 
- Public Member Functions inherited from ModuleSceneItem
void register_component_implementation ()
 
bool is_translatable () const
 return true if the item can be translated
 
bool is_rotatable () const
 return true if the item can be rotated
 
bool is_scalable () const
 return true if the item can be scaled
 
bool is_pivot_translatable () const
 return true if the pivot of the item can be translated
 
bool is_pivot_rotatable () const
 return true if the pivot of the item can be rotated
 
bool is_pivot_scalable () const
 return true if the pivot of the item can be scaled
 
ModuleSceneItemget_parent () const
 Returns the apparent scene item kinematic parent object if any, with respect to attr muted value or parent disabled state.
 
void set_parent (ModuleSceneItem *item, const ParentInPlaceMode &mode=PARENT_IN_PLACE_FORCED_OFF)
 Set the kinematic parent for this item.
 
ModuleSceneItemget_serialized_parent () const
 Returns the actual scene item kinematic parent object if any, without considering attr muted value or parent disabled state.
 
void set_rotation_order (const GMathRotationOrder &order)
 
void set_rotation_offset_order (const GMathRotationOrder &order)
 
GMathRotationOrder get_rotation_order () const
 
GMathRotationOrder get_rotation_offset_order () const
 
void set_transform (const GMathTransform &xform)
 
void set_translation (const GMathVec3d &t, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the item translation in the given space.
 
void set_rotation (const GMathVec3d &r, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the item rotation in the given space.
 
void set_scaling (const GMathVec3d &s, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the item scaling in the given space.
 
void set_shearing (const GMathVec3d &sh, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the item scaling in the given space.
 
void change_translation (const GMathVec3d &t, const Space &space=SPACE_LOCAL, void *requester=0)
 
void change_rotation (const GMathVec3d &r, const Space &space=SPACE_LOCAL, void *requester=0)
 
void change_scaling (const GMathVec3d &s, const Space &space=SPACE_LOCAL, void *requester=0)
 
void change_shearing (const GMathVec3d &sh, const Space &space=SPACE_LOCAL, void *requester=0)
 
void set_translation_offset (const GMathVec3d &t, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the item translation offset in the given space.
 
void set_rotation_offset (const GMathVec3d &r, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the item rotation offset in the given space.
 
void set_scaling_offset (const GMathVec3d &s, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the item scaling offset in the given space.
 
void change_translation_offset (const GMathVec3d &t, const Space &space=SPACE_LOCAL, void *requester=0)
 
void change_rotation_offset (const GMathVec3d &r, const Space &space=SPACE_LOCAL, void *requester=0)
 
void change_scaling_offset (const GMathVec3d &s, const Space &space=SPACE_LOCAL, void *requester=0)
 
void set_rotation_pivot (const GMathVec3d &r, const Space &space=SPACE_LOCAL)
 Set the position of the rotation pivot in the given space.
 
void set_scaling_pivot (const GMathVec3d &s, const Space &space=SPACE_LOCAL)
 Set the position of the scaling pivot in the given space.
 
void change_rotation_pivot (const GMathVec3d &r, const Space &space=SPACE_LOCAL)
 
void change_scaling_pivot (const GMathVec3d &s, const Space &space=SPACE_LOCAL)
 
void reset_rotation_pivot ()
 Reset the rotation pivot to its initial position.
 
void reset_scaling_pivot ()
 Reset the scaling pivot to its initial position.
 
void inplace_set_translation (const GMathVec3d &t, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the kinematic translation without moving the object (offset the translation)
 
void inplace_set_rotation (const GMathVec3d &r, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the kinematic rotation without moving the object (offset the rotatation)
 
void inplace_set_scaling (const GMathVec3d &s, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the kinematic scaling without moving the object (offset the scale)
 
void inplace_change_translation (const GMathVec3d &t, const Space &space=SPACE_LOCAL, void *requester=0)
 
void inplace_change_rotation (const GMathVec3d &r, const Space &space=SPACE_LOCAL, void *requester=0)
 
void inplace_change_scaling (const GMathVec3d &s, const Space &space=SPACE_LOCAL, void *requester=0)
 
void inplace_set_translation_offset (const GMathVec3d &t, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the translation offset without moving the object.
 
void inplace_set_rotation_offset (const GMathVec3d &r, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the rotation offset without moving the object.
 
void inplace_set_scaling_offset (const GMathVec3d &s, const Space &space=SPACE_LOCAL, void *requester=0)
 Set the scaling offset without moving the object.
 
void inplace_change_translation_offset (const GMathVec3d &t, const Space &space=SPACE_LOCAL, void *requester=0)
 
void inplace_change_rotation_offset (const GMathVec3d &r, const Space &space=SPACE_LOCAL, void *requester=0)
 
void inplace_change_scaling_offset (const GMathVec3d &s, const Space &space=SPACE_LOCAL, void *requester=0)
 
void set_matrix (const GMathMatrix4x4d &matrix, const Space &space)
 Extract translation, rotation, scale and shear values from the given matrix.
 
GMathTransform get_transform (const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 
GMathTransform get_transform_at (const double &time) const
 
GMathTransform compute_transform_at (const double &time) const
 
void get_translation (GMathVec3d &t, const Space &space=SPACE_LOCAL, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 Returns the item translation in the given space.
 
void get_rotation (GMathVec3d &r, const Space &space=SPACE_LOCAL, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 Returns the item rotation in the given space.
 
void get_scaling (GMathVec3d &s, const Space &space=SPACE_LOCAL, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 Returns the item scale in the given space.
 
void get_shearing (GMathVec3d &sh, const Space &space=SPACE_LOCAL, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 Returns the item shear in the given space.
 
void get_translation_offset (GMathVec3d &t, const Space &space=SPACE_LOCAL, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 Returns the item translation in the given space.
 
void get_rotation_offset (GMathVec3d &r, const Space &space=SPACE_LOCAL, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 Returns the item rotation in the given space.
 
void get_scaling_offset (GMathVec3d &s, const Space &space=SPACE_LOCAL, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 Returns the item scaling in the given space.
 
void get_rotation_pivot (GMathVec3d &r, const Space &space=SPACE_LOCAL, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 Returns the position of the rotation pivot in the given space.
 
void get_scaling_pivot (GMathVec3d &s, const Space &space=SPACE_LOCAL, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 Returns the position of the scaling pivot in the given space.
 
void get_rotation_pivot_matrix (GMathMatrix4x4d &r, const Space &space, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 Returns the item rotation pivot matrix in the given space.
 
void get_scaling_pivot_matrix (GMathMatrix4x4d &r, const Space &space, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 Returns the item scaling pivot matrix in the given space.
 
const GMathMatrix4x4d & get_kinematic_matrix (const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 
const GMathMatrix4x4d & get_object_matrix (const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 
const GMathMatrix4x4d & get_global_matrix (const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 
const GMathMatrix4x4d & get_inv_global_matrix (const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 
const GMathMatrix4x4d get_reference_global_matrix () const
 
void get_global_position (GMathVec3d &position, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 
void get_global_orientation (GMathMatrix4x4d &orientation, const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_CURRENT) const
 
void get_translation_at (GMathVec3d &t, const double &time, const Space &space=SPACE_LOCAL) const
 Returns the item translation at the given time in the given space.
 
void get_rotation_at (GMathVec3d &r, const double &time, const Space &space=SPACE_LOCAL) const
 Returns the item rotation at the given time in the given space.
 
void get_scaling_at (GMathVec3d &s, const double &time, const Space &space=SPACE_LOCAL) const
 Returns the item scale at the given time in the given space.
 
void get_shearing_at (GMathVec3d &sh, const double &time, const Space &space=SPACE_LOCAL) const
 Returns the item shear at the given time in the given space.
 
void get_translation_offset_at (GMathVec3d &t, const double &time, const Space &space=SPACE_LOCAL) const
 Returns the item translation in the given space.
 
void get_rotation_offset_at (GMathVec3d &r, const double &time, const Space &space=SPACE_LOCAL) const
 Returns the item rotation in the given space.
 
void get_scaling_offset_at (GMathVec3d &s, const double &time, const Space &space=SPACE_LOCAL) const
 Returns the item scaling in the given space.
 
void get_model_matrix_at (GMathMatrix4x4d &matrix, const double &time) const
 
GMathMatrix4x4d get_kinematic_matrix_at (const double &time) const
 Returns the item kinematic matrix at the given time.
 
GMathMatrix4x4d get_object_matrix_at (const double &time) const
 Returns the item object matrix at the given time.
 
GMathMatrix4x4d get_global_matrix_at (const double &time) const
 Returns the item global matrix at the given time.
 
CoreBasicArray< GMathMatrix4x4d > get_global_matrix_motion_blur_samples (const CtxEval &eval_ctx) const
 Return samples of the global matrix used for the motion blur.
 
GMathMatrix4x4d get_global_matrix_motion_blur_at (const CtxEval &eval_ctx, const double &delta_time) const
 Returns the global matrix for the motion blur at the given time.
 
GMathMatrix4x4d get_global_matrix_motion_blur (const CtxEval &eval_ctx, const GeometryMotionBlurSample &ms) const
 Returns the global matrix for the motion blur at the given motion blur sample.
 
void get_global_position_at (GMathVec3d &position, const double &time) const
 
void get_global_orientation (GMathMatrix4x4d &orientation, const double &time) const
 
const GMathVec3d & get_display_color () const
 
bool is_display_visible () const
 
bool is_display_pickable () const
 
bool is_display_motion_trail (bool selected) const
 
bool is_constrained () const
 
short get_xform_constraint_modifier () const
 
bool is_animated () const
 
bool is_motion_blur_enabled () const
 
bool is_motion_blur_required () const
 
bool is_motion_blurred () const
 
bool is_locally_motion_blurred () const
 
bool is_animation_motion_blurred () const
 
bool has_kinematic_expression () const
 
bool has_local_animation () const
 
void enable_motion_blur (const bool &flag)
 
void require_motion_blur (const int &increment)
 
void require_motion_blur (const bool &flag)
 
void set_matrices_as_dirty (const OfAttr::ValuePage &page=OfAttr::VALUE_PAGE_PREVIOUS)
 
const unsigned int & get_object_count () const
 
const unsigned int & get_object_id () const
 
bool is_visibility_driven () const
 
CoreString get_kinematic_full_name () const
 return the fullname of the item in the transformation hierarchy (world://item)
 
void set_kinematic_full_name_dirty ()
 
bool is_kinematic_full_name_dirty () const
 
bool is_inherit_transform () const
 
unsigned int get_reference_frame () const
 
double get_reference_time () const
 
void update_animation_motion_blur (const bool has_animation_motion_blur)
 update_animation_motion_blur Set the flag ANIMATED_MODEL_MATRIX according to has_animation_motion_blur. If the item has change is animation state then it will propagate motion blur dirtiness
 
const Flags & get_flags () const
 Get flags that are enabled on the current scene item.
 
void enable_flags (const Flags &flags)
 Enable flags on the current scene item.
 
void disable_flags (const Flags &flags)
 Disable flags on the current scene item.
 
- Public Member Functions inherited from ModuleGlObject
virtual bool pre_paint_gl (GlUtilsCtx &ctx) const
 
virtual bool paint_gl (GlUtilsCtx &ctx) const
 
virtual bool destroy_gl_data (GlUtilsGlCtx &gl_ctx) const
 
virtual GMathBbox3d get_gl_bbox (GlUtilsCtx &ctx) const
 

Static Public Member Functions

static void module_ray_hit (OfObject &object, const CtxEval &eval_ctx, CtxShader &shader_ctx, GeometryRaytraceCtx &raytrace_ctx)
 
static void module_ray_hit_nearest (OfObject &object, const CtxEval &eval_ctx, CtxShader &shader_ctx, GeometryRaytraceCtx &raytrace_ctx)
 
static void module_frustum_hit (OfObject &object, const CtxEval &eval_ctx, CtxShader &shader_ctx, GeometryFrustumCtx &frustum_ctx)
 
- Static Public Member Functions inherited from ModuleSceneObject
static void merge_geometries (const CoreVector< ModuleSceneObject * > &objects, CoreArray< GMathVec3d > &vertices, CoreArray< unsigned int > &polygon_indices, CoreArray< unsigned int > &polygon_vertex_count, CoreArray< unsigned int > &polygon_shading_groups, CoreArray< CoreString > &shading_group_names, CoreArray< GeometryUvMap > &uv_maps, CoreArray< GeometryNormalMap > &normal_maps, CoreArray< GeometryColorMap > &color_maps, AppProgressBar *progress_bar=0)
 
- Static Public Member Functions inherited from ModuleSceneItem
static const unsigned int & get_object_count (OfApp &application)
 
static ModuleSceneItemget_scene_item (OfApp &application, const unsigned int &id)
 return the scene item from the specified id
 
static void get_all_scene_items (OfApp &application, CoreVector< ModuleSceneItem * > &items)
 return the most up-to-date array of scene items
 
static VisibilityMode get_visibility_mode (const OfObject &object)
 
static Flags reserve_flag ()
 Get a flag that is not used yet and reserve it.
 

Static Public Attributes

static const ResourceID RESOURCE_ID_BASE_OBJECTS = ModuleObject::declare_resource("scene_object_tree_base_objects")
 Resource type for base objects related information.
 
static const ResourceID RESOURCE_ID_TOPOLOGY = ModuleObject::declare_resource("scene_object_tree_topology")
 Resource type for object indices of instances, support point indices of instances, etc...
 
static const ResourceID RESOURCE_ID_MATRICES = ModuleObject::declare_resource("scene_object_tree_matrices")
 Resource type for item matrices.
 
static const ResourceID RESOURCE_ID_TREE = ModuleObject::declare_resource("scene_object_tree_gas")
 Resource type for GAS data like bounding boxes and some other stuff which can be computed only after it is built.
 

Protected Member Functions

void module_constructor (OfObject &object) override
 
void module_destructor () override
 
void on_attribute_change (const OfAttr &attr, int &dirtiness, const int &dirtiness_flags) override
 
- Protected Member Functions inherited from ModuleSceneObject
void set_override_children_visibility (const bool &override_children)
 
virtual void build_shading_groups (CoreArray< CoreString > &shading_groups) const
 
virtual void build_materials (CoreArray< ModuleMaterial * > &materials) const
 
virtual void build_clip_maps (CoreArray< ModuleTexture * > &clip_maps) const
 
virtual void build_displacements (CoreArray< ModuleDisplacement * > &displacements) const
 
virtual void build_sg_shading_variables (CoreArray< ShadingVariablesCtx * > &sg_shading_variables) const
 
virtual ResourceDatacreate_resource_override (const int &id, GeometryOverride &override_data, void *data) const
 
void update_material_flags () const
 
void update_geometry_overrides (OfObject &object, const EventInfo &event, void *data)
 
- Protected Member Functions inherited from ModuleSceneItem
void in_place_set_parent (const ModuleSceneItem *new_parent_module, const bool &in_place)
 

Friends

class ModuleSceneObjectTreeTransforms
 

Additional Inherited Members

- Public Types inherited from ModuleSceneObject
enum  DisplayMode {
  DISPLAY_WIREFRAME = 0,
  DISPLAY_CONSTANT = 1,
  DISPLAY_NORMALS = 2,
  DISPLAY_SIMPLE_SHADING = 3,
  DISPLAY_PREVIZ = 4
}
 
enum  HighlightMode {
  HIGHLIGHT_NONE = 0,
  HIGHLIGHT_BBOX = 1,
  HIGHLIGHT_WIREFRAME = 2,
  HIGHLIGHT_BOTH = HIGHLIGHT_BBOX|HIGHLIGHT_WIREFRAME
}
 
enum  SamplingAlgorithm {
  SAMPLING_RANDOM,
  SAMPLING_BLUE_NOISE,
  SAMPLING_PRIMITIVE_CENTER
}
 
enum  SamplingSpace {
  SAMPLING_LOCAL_BASE = 0,
  SAMPLING_LOCAL_DEFORMED = 1,
  SAMPLING_GLOBAL_BASE = 2,
  SAMPLING_GLOBAL_DEFORMED = 3
}
 
enum  EmissionImportanceSamplingMode {
  EMISSION_LOCAL = 0,
  EMISSION_GLOBAL = 1,
  EMISSION_NONE = 2
}
 
enum  EmissionTextureImportanceSamplingMode {
  ETIS_NONE = 0,
  ETIS_COLOR = 1,
  ETIS_WEIGHT = 2,
  ETIS_BOTH = 3
}
 
- Static Protected Member Functions inherited from ModuleSceneItem
static bool is_in_place_parenting (OfApp &app, const ModuleSceneItem::ParentInPlaceMode &parent_in_place_mode)
 Compensate the transform of the parent to make sure the object doesn't move in the world.
 
- Protected Attributes inherited from ModuleSceneObject
CoreArray< CoreStringm_shading_groups
 
CoreArray< ModuleMaterial * > m_materials
 
CoreArray< ModuleTexture * > m_clip_maps
 
CoreArray< ModuleDisplacement * > m_displacements
 
CoreArray< ShadingVariablesCtx * > m_sg_shading_variables
 
CoreArray< ModuleLight * > m_lights
 
bool m_shading_groups_dirty
 
bool m_materials_dirty
 
bool m_material_flags_dirty
 
bool m_clip_maps_dirty
 
bool m_displacements_dirty
 
bool m_sg_shading_variables_dirty
 
bool m_lights_dirty
 
SysThreadLockRecursivem_lock
 
- Static Protected Attributes inherited from ModuleSceneObject
static Flags s_geometry_flag = ModuleSceneItem::reserve_flag()
 
static Flags s_compound_flag = ModuleSceneItem::reserve_flag()
 

Detailed Description

This module is used to represent a list of instances of other scene objects.

For the most basic implementation, you need to implement the following callbacks from ModuleSceneObjectTreeCallbacks:

See ModuleSceneObjectTreeCallbacks for more information.

This module defines 4 types of resources with the following dependencies: ```

RESOURCE_ID_BASE_OBJECTS RESOURCE_ID_TOPOLOGY ^ ^ | | | | | RESOURCE_ID_MATRICES | ^ | | | | ------—RESOURCE_ID_TREE-----—

```

Member Function Documentation

void ModuleSceneObjectTree::get_geometry ( const CoreBasicArray< unsigned int > &  geometry_id_hierarchy,
CoreArray< ModuleSceneObjectGeometry > &  geometries,
GeometryOverride override = 0 
) const
overridevirtual

The get_geometry(_at) function will set an array of ModuleSceneObjectGeometry containing the geometry(ies if there is bundle). The geometry will be found thanks to the geometry_id_hierarchy. This attributes contains all the indices of the object in regards of their parents.

Example : We want to find E ``` scatterer[ A B combiner[ C bundle[D E] ] ] [ 0 1 2 [ 0 1] ] geometry_id_hierarchy = [2, 1] ``` The function will return 2 ModuleSceneObjectGeometry [D E], to get E you will need to use the geometry_local_index that is stored in the intersection

Reimplemented from ModuleSceneObject.

GMathMatrix4x4d ModuleSceneObjectTree::get_instance_final_matrix ( const unsigned int &  instance_index,
const GeometryOverride override 
) const

Return the matrix of the instance, taking into account the matrix applied by this scene object tree on this instance, the matrix of the scene object module referenced by this instance, and the geometry override applied on this scene object tree

Parameters
instance_indexthe index of the instance
overridethe geometry override applied on this scene object tree if any
GMathMatrix4x4d ModuleSceneObjectTree::get_instance_final_motion_matrix ( const CtxEval eval_ctx,
const CtxMotionBlur mb_ctx,
GeometryOverride override,
unsigned int  instance_index,
unsigned int  sample_index 
) const

Return the final matrix of the instance at the given sample motion blur index. It takes into account the geometry override applied on this scene object tree, the matrix of the module associated to this instance, and the matrix of this scene object tree applied on the instance

Parameters
Thecurrent eval context
mb_ctxThe motion blur context
overrideThe geometry override applied on this scene object tree
instance_indexThe index of the instance in the instances list
sample_indexThe motion blur sample index
GMathMatrix4x4d ModuleSceneObjectTree::get_instance_final_motion_matrix ( const CtxEval eval_ctx,
const CtxMotionBlur mb_ctx,
GeometryOverride override,
unsigned int  instance_index,
unsigned int  sample_index,
double  span_weight 
) const

Return the final interpolated matrix of the instance at the given sample motion blur index. It takes into account the geometry override applied on this scene object tree, the matrix of the module associated to this instance, and the matrix of this scene object tree applied on the instance

Parameters
Thecurrent eval context
mb_ctxThe motion blur context
overrideThe geometry override applied on this scene object tree
instance_indexThe index of the instance in the instances list
sample_indexThe motion blur sample index
span_weightThe interpolation weight (0.0 = matrix at the sample sample_index, 1.0 = matrix at the sample sample_index + 1)
GMathMatrix4x4d ModuleSceneObjectTree::get_instance_matrix ( const unsigned int &  index) const

Get the transformation matrix of an instance.

Parameters
indexIndex of the instance, after decimation.
GMathMatrix4x4d ModuleSceneObjectTree::get_instance_motion_matrix ( const CtxEval eval_ctx,
const CtxMotionBlur mb_ctx,
GeometryOverride override,
unsigned int  instance_index,
unsigned int  sample_index 
) const

Return the matrix of the instance at the given sample motion blur index

Parameters
Thecurrent eval context
mb_ctxThe motion blur context
overrideThe geometry override applied on this scene object tree
instance_indexThe index of the instance in the instances list
sample_indexThe motion blur sample index
GMathMatrix4x4d ModuleSceneObjectTree::get_instance_motion_matrix ( const CtxEval eval_ctx,
const CtxMotionBlur mb_ctx,
GeometryOverride override,
unsigned int  instance_index,
unsigned int  sample_index,
double  span_weight 
) const

Return the matrix of the instance at the given sample motion blur index

Parameters
Thecurrent eval context
mb_ctxThe motion blur context
overrideThe geometry override applied on this scene object tree
instance_indexThe index of the instance in the instances list
sample_indexThe motion blur sample index
span_weightThe interpolation weight (0.0 = matrix at the sample sample_index, 1.0 = matrix at the sample sample_index + 1)
void ModuleSceneObjectTree::get_instance_transforms ( CoreVector< GMathVec3d > &  translations,
CoreVector< GMathMatrix3x3f > &  rotations,
CoreVector< GMathVec3f > &  scales 
) const

Get the translations, rotations and scales of the decimated instances.

Parameters
translationsThe translations (will be empty if the instances don't have translations)
rotationsThe rotations (will be empty if the instances don't have rotations)
scalesThe scales (will be empty if the instances don't have scales)
const CoreBasicArray< unsigned int > & ModuleSceneObjectTree::get_instances_time_indices ( ) const

Get the indices of the used time variation objects according to the scatter time parameter of this scene object tree (see get_time_objects_count), and after decimation. If there are no such parameters, it returns the indices of the used base objects (because there is only 1 variation per object)

const GMathMatrix4x4d & ModuleSceneObjectTree::get_object_final_inverse_matrix ( const unsigned int &  object_index,
const GeometryOverride override 
) const

Return the inverse of the matrix of the object, taking into account the matrix of the scene object module and the geometry override applied on this scene object tree

Parameters
object_indexthe index of the object
overridethe geometry override applied on this scene object tree if any
const GMathMatrix4x4d & ModuleSceneObjectTree::get_object_final_matrix ( const unsigned int &  object_index,
const GeometryOverride override 
) const

Return the matrix of the object, taking into account the matrix of the scene object module and the geometry override applied on this scene object tree

Parameters
object_indexthe index of the object
overridethe geometry override applied on this scene object tree if any
const GMathMatrix4x4d & ModuleSceneObjectTree::get_object_final_motion_matrix ( const CtxEval eval_ctx,
const CtxMotionBlur mb_ctx,
GeometryOverride override,
unsigned int  object_index,
unsigned int  sample_index 
) const

Return the matrix of the object at the given sample motion blur index taking into account the matrix of the geometry override applied on this scene object tree

Parameters
Thecurrent eval context
mb_ctxThe motion blur context
overrideThe geometry override applied on this scene object tree
object_indexThe index of the object in the base objects list
sample_indexThe motion blur sample index
GMathMatrix4x4d ModuleSceneObjectTree::get_object_final_motion_matrix ( const CtxEval eval_ctx,
const CtxMotionBlur mb_ctx,
GeometryOverride override,
unsigned int  object_index,
unsigned int  sample_index,
double  span_weight 
) const

Return the interpolated matrix of the object at the given sample motion blur index taking into account the matrix of the geometry override applied on this scene object tree

Parameters
Thecurrent eval context
mb_ctxThe motion blur context
overrideThe geometry override applied on this scene object tree
object_indexThe index of the object in the base objects list
sample_indexThe motion blur sample index
span_weightThe interpolation weight (0.0 = matrix at the sample sample_index, 1.0 = matrix at the sample sample_index + 1)
const unsigned int & ModuleSceneObjectTree::get_object_shading_group_count ( const unsigned int &  sub_object_index) const
overridevirtual

Return the number of shading groups for the specified sub object //!

Parameters
[in]sub_object_indexindex of the sub object

Reimplemented from ModuleSceneObject.

unsigned int ModuleSceneObjectTree::get_object_shading_group_offset ( const unsigned int &  sub_object_index) const
overridevirtual

Return the shading group offset for the specified sub object //!

Parameters
[in]sub_object_indexindex of the sub object

Reimplemented from ModuleSceneObject.

const CoreBasicArray< unsigned int > & ModuleSceneObjectTree::get_raw_instances ( ) const

Get the indices of the used objects (see get_base_objects), before decimation. (e.g. the number of raw instances matches the number of indices returned by get_support_point_indices)

unsigned int ModuleSceneObjectTree::get_time_objects_count ( ) const

Return the number of variations of base objects according to the scatter time parameter of this scene object tree. If there are no such parameters, it returns the number of base objects (because there is only 1 variation per object)

double ModuleSceneObjectTree::get_time_offset ( unsigned int  time_object_index) const

Return the time offset for a given time object.

Parameters
indexThe index of the base object to consider. This index should be in the [0, get_time_objects_count()[ to be valid.
Returns
The time offset used by this base object if the scatterer has time variance, otherwise 0.