Object
The Object class provides the interface to the Scene objects. It includes visibility distance and mask parameters to efficiently cull distant and invisible objects.
Object is a container for ObjectNode, ObjectGeometry, ObjectAnimation, and Shape instances.
#include <scene/TellusimObject.h>
Constructors
Object()
Methods
static Object create(Type type, const char *name = nullptr)
Clear object.
void clear()
Object type.
Type getType() const
static const char *getTypeName(Type type)
const char *getTypeName() const
bool isMesh() const
bool isBrep() const
Object unique identifier.
uint32_t getID() const
Object index.
uint32_t getIndex() const
Object address.
uint32_t getAddress() const
Object name.
void setName(const char *name)
void setName(const String &name)
String getName() const
Object scene.
void setScene(Scene &scene, bool check = true)
const Scene getScene() const
Scene getScene()
Enabled flag.
void setEnabled(bool enabled)
bool isEnabled() const
Light mask.
void setLightMask(uint32_t mask)
uint32_t getLightMask() const
Camera mask.
void setCameraMask(uint32_t mask)
uint32_t getCameraMask() const
Object mask.
void setObjectMask(uint32_t mask)
uint32_t getObjectMask() const
Shadow mask.
void setShadowMask(uint32_t mask)
uint32_t getShadowMask() const
Tracer mask.
void setTracerMask(uint32_t mask)
uint32_t getTracerMask() const
Tracing mask.
void setTracingMask(uint32_t mask)
uint32_t getTracingMask() const
Collider mask.
void setColliderMask(uint32_t mask)
uint32_t getColliderMask() const
Hidden flag.
void setHidden(bool flag)
bool isHidden() const
Expanded flag.
void setExpanded(bool flag)
bool isExpanded() const
Internal flag.
void setInternal(bool flag)
bool isInternal() const
Virtual flag.
void setVirtual(bool flag)
bool isVirtual() const
Changed flag.
void setChanged(bool flag)
bool isChanged() const
Pointer info.
void setPtrInfo(void *ptr)
void *getPtrInfo() const
Meta info.
void setMetaInfo(const String &info)
String getMetaInfo() const
Visibility range.
void setMinVisibility(float32_t min_distance)
void setMaxVisibility(float32_t max_distance)
void setShadowVisibility(float32_t shadow_distance)
void setTracingVisibility(float32_t tracing_distance)
void setVisibilityRange(float32_t min_distance, float32_t max_distance)
void setVisibilityRange(float32_t min_distance, float32_t max_distance, float32_t shadow_distance)
void setVisibilityRange(float32_t min_distance, float32_t max_distance, float32_t shadow_distance, float32_t tracing_distance)
float32_t getMinVisibility() const
float32_t getMaxVisibility() const
float32_t getShadowVisibility() const
float32_t getTracingVisibility() const
Object nodes.
void shrinkNodes()
void reserveNodes(uint32_t num_nodes)
ObjectNode addNode(const char *name = nullptr)
uint32_t addNode(ObjectNode &node, bool check = true)
bool removeNode(ObjectNode &node)
void releaseNodes()
bool swapNodes(ObjectNode &node_0, ObjectNode &node_1, bool update = false)
uint32_t findNode(const ObjectNode &node) const
uint32_t findNode(const char *name) const
uint32_t getNumNodes() const
uint32_t getNodeCount() const
uint32_t getNodeCapacity() const
const Array<ObjectNode> getNodes() const
Array<ObjectNode> getNodes()
const ObjectNode getNode(uint32_t index) const
const ObjectNode getNode(const char *name) const
ObjectNode getNode(uint32_t index)
ObjectNode getNode(const char *name)
void updateNodes(Array<ObjectNode> nodes)
void updateNode(ObjectNode &node)
void updateNodes(bool update = false)
uint32_t getNodeAddress() const
Object geometries.
void shrinkGeometries()
void reserveGeometries(uint32_t num_geometries)
ObjectGeometry addGeometry(const char *name = nullptr)
uint32_t addGeometry(ObjectGeometry &geometry, bool check = true)
bool removeGeometry(ObjectGeometry &geometry, bool clean = false, bool update = false)
void releaseGeometries()
bool swapGeometries(ObjectGeometry &geometry_0, ObjectGeometry &geometry_1, bool update = false)
uint32_t findGeometry(const ObjectGeometry &geometry) const
uint32_t findGeometry(const char *name) const
uint32_t getNumGeometries() const
uint32_t getGeometryCount() const
uint32_t getGeometryCapacity() const
const Array<ObjectGeometry> getGeometries() const
Array<ObjectGeometry> getGeometries()
const ObjectGeometry getGeometry(uint32_t index) const
const ObjectGeometry getGeometry(const char *name) const
ObjectGeometry getGeometry(uint32_t index)
ObjectGeometry getGeometry(const char *name)
void updateGeometries(Array<ObjectGeometry> geometries)
void updateGeometry(ObjectGeometry &geometry)
void updateGeometries(bool update = false)
bool removeMaterial(const Material &material, bool update = false)
bool updateMaterial(const Material &material, bool update = false)
uint32_t getProgramHash() const
uint32_t getGeometryAddress() const
Object animations.
void shrinkAnimations()
void reserveAnimations(uint32_t num_animations)
ObjectAnimation addAnimation(const char *name = nullptr)
uint32_t addAnimation(ObjectAnimation &animation, bool check = true)
bool removeAnimation(ObjectAnimation &animation)
void releaseAnimations()
bool swapAnimations(ObjectAnimation &animation_0, ObjectAnimation &animation_1, bool update = false)
uint32_t findAnimation(const ObjectAnimation &animation) const
uint32_t findAnimation(const char *name) const
uint32_t getNumAnimations() const
uint32_t getAnimationCount() const
uint32_t getAnimationCapacity() const
const Array<ObjectAnimation> getAnimations() const
Array<ObjectAnimation> getAnimations()
const ObjectAnimation getAnimation(uint32_t index) const
const ObjectAnimation getAnimation(const char *name) const
ObjectAnimation getAnimation(uint32_t index)
ObjectAnimation getAnimation(const char *name)
void updateAnimations(Array<ObjectAnimation> animations)
void updateAnimation(ObjectAnimation &animation)
void updateAnimations(bool update = false)
uint32_t getAnimationAddress() const
Object shapes.
void shrinkShapes()
void reserveShapes(uint32_t num_shapes)
uint32_t addShape(Shape &shape, bool check = true)
bool removeShape(Shape &shape)
void releaseShapes()
bool swapShapes(Shape &shape_0, Shape &shape_1, bool update = false)
uint32_t findShape(const Shape &shape) const
uint32_t findShape(const char *name) const
uint32_t getNumShapes() const
uint32_t getShapeCount() const
uint32_t getShapeCapacity() const
const Array<Shape> getShapes() const
Array<Shape> getShapes()
const Shape getShape(uint32_t index) const
const Shape getShape(const char *name) const
Shape getShape(uint32_t index)
Shape getShape(const char *name)
void updateShapes(Array<Shape> shapes)
void updateShape(Shape &shape)
void updateShapes(bool update = false)
uint32_t getShapeAddress() const
Geometry parameters.
uint32_t getNumGeometryNodes() const
uint32_t getGeometryNodeGeometryIndex(uint32_t index) const
uint32_t getGeometryNodeNodeIndex(uint32_t index) const
Number of geometry graphs.
uint32_t getNumGeometryGraphs() const
uint32_t getGeometryChildAddress() const
Object bound box.
void setBoundBox(BoundBoxf box)
const BoundBoxf getBoundBox() const
Object node transform matrix.
bool setNodeLocalTransform(NodeObject &node, uint32_t index, Matrix4x3f transform)
bool setNodeGlobalTransform(NodeObject &node, uint32_t index, Matrix4x3f transform)
bool setNodeGeometryTransform(NodeObject &node, uint32_t index, Matrix4x3f transform)
Create transforms.
void createTransforms(bool update = false, bool clear = false)
void createLocalTransforms(Matrix4x3f itransform = Matrix4x3f::identity, bool update = false, bool clear = false)
void createGlobalTransforms(Matrix4x3f itransform = Matrix4x3f::identity, bool update = false, bool clear = false)
Type | Name | Description |
---|---|---|
bool | update | Update Nodes. |
bool | clear | Clear ObjectNode update mask after transformation. |
Create object tracings.
void updateTracings(bool update = false)
void removeTracings(bool update = false)
Create object spatial tree.
void updateSpatial(bool update = false)
void removeSpatial(bool update = false)
Create object spatial bounds.
void updateBounds(bool update = false)
Fetch bound box.
bool fetchBoundBox(const BoundBoxCallback &func)
Load object.
bool load(const Xml &xml)
bool load(const Json &json)
bool load(Stream &stream)
Save object.
bool save(Xml &xml) const
bool save(Json &json) const
bool save(Stream &stream) const
Clone object.
Object clone(Scene &scene) const
Updated flag.
bool isUpdated() const
Update scene.
void updateScene()
Types
using BoundBoxCallback = Function<void(Object object)>
Enums
Type
Object types.
Name | Value |
---|---|
TypeUnknown | 0 |
TypeMesh | 1 |
TypeBrep | 2 |
NumTypes | 3 |