NDEVR
API Documentation

A core object representing a user view as well as convenience functions for moving this view through 3D space. More...

Inheritance diagram for Camera:
[legend]
Collaboration diagram for Camera:
[legend]

Public Member Functions

 Camera (const Camera &camera)
 Copy constructor.
 Camera (const Model &camera)
 Constructs a Camera from an existing Model.
 ~Camera ()
 Destructor.
Vector< 2, Angle< fltp08 > > activeFOV () const
 Gets the currently active field of view, accounting for projection mode.
Vector< 2, fltp08activeOrthoSize () const
 Gets the active orthographic view size in world units.
void addAnimation (CameraAnimation animation, bool clear_current_animations=true)
 Adds a camera animation to the queue.
void addIsOrthographicAnimation (bool is_orthographic, const TimeSpan &time, bool clear_animations=true)
 Adds an animation that transitions between orthographic and perspective projection.
void addLookatAnimation (Vector< 3, fltp08 > lookat, const TimeSpan &time, bool clear_animations=true)
 Adds an animation that transitions the camera to look at the specified direction.
void addObjectsToVisible (const Buffer< UUID > &models, DesignObjectLookup *lookup)
 Adds multiple objects to the set of objects visible to this camera.
void addObjectToVisible (const Model &model)
 Adds the given model to the set of objects visible to this camera.
void addOrbitAnimation (Vector< 3, fltp08 > target, Vector< 3, Angle< fltp08 > > orient, fltp08 zoom, bool face_target, const TimeSpan &time, bool clear_animations=true)
 Adds an orbit animation around a target point.
void addZoomAnimation (fltp08 distance_mult, const TimeSpan &time, bool clear_animations=true)
 Adds a zoom animation that scales the view over the specified time.
void addZoomMultiplierAnimation (fltp08 multiplier, const TimeSpan &time, bool clear_animations=true)
 Adds an animation that scales the zoom level by a multiplier over the specified time.
void addZoomToExtentsAnimation (Bounds< 3, fltp08 > object, const TimeSpan &time, bool use_true_extents=true, bool clear_animations=true, Vector< 3, Angle< fltp08 > > angle_offsets=Vector< 3, Angle< fltp08 > >(Angle< fltp08 >(0)))
 Adds an animation that zooms to fit the given bounds using the current orientation.
void addZoomToExtentsAnimation (SnapLocation location, Bounds< 3, fltp08 > object, const TimeSpan &time, bool use_true_extents=true, bool clear_animations=true, Vector< 3, Angle< fltp08 > > angle_offsets=Vector< 3, Angle< fltp08 > >(Angle< fltp08 >(0)))
 Adds an animation that zooms to fit the given bounds at a specific snap location.
void addZoomToExtentsAnimation (Vector< 3, Angle< fltp08 > > orientation, Bounds< 3, fltp08 > object, const TimeSpan &time, bool use_true_extents=true, bool clear_animations=true)
 Adds an animation that zooms to fit the given bounds at a specified orientation.
fltp08 calculatedReferenceSize () const
 Gets the calculated reference size based on the current viewport dimensions.
Matrix< fltp08calculateProjectionMatrix () const
 Calculates the projection matrix from current camera parameters.
CameraBackgroundcameraBackground ()
 Gets the camera background settings (mutable).
const CameraBackgroundcameraBackground () const
 Gets the camera background settings (const).
void clearAnimations ()
 Removes all queued camera animations.
void clearAutozoomFocus ()
 Clears the current auto-zoom focus settings.
Vertex< 3, fltp08computedOffset () const
 Gets the computed camera offset in world space, accounting for animations.
void copyFrom (const Camera &object)
 Copies all camera settings from the given camera into this one.
SelectionInfo createSelectionInfo () const
 Creates a new SelectionInfo based on the current camera state.
SnapLocation currentSnapLocation () const
 Gets the current snap location that the camera is aligned to.
const Bounds< 1, fltp08 > & farPlaneBounds () const
 Gets the allowable range for the far clipping plane distance.
ViewportFormat format () const
 Gets the viewport format descriptor for this camera.
Bounds< 3, fltp08getFocusBounds () const
 Gets the current auto-zoom focus bounds.
const Ray< 3, fltp08 > & getLookat () const
 Gets the current look-at ray describing the camera view direction and position.
Bounds< 3, fltp08getOrthographicBounds () const
 Computes the 3D axis-aligned bounds visible in orthographic mode.
Bounds< 2, Angle< fltp08 > > getPerspectiveBounds () const
 Computes the angular bounds visible in perspective mode.
Vector< 2, Angle< fltp08 > > getRotateAroundPoint (const Vector< 3, fltp04 > &vCenter) const
 Computes the rotation angles needed to rotate the camera around a given center point.
Vector< 3, fltp08gotoLocation () const
 Gets the target location for a pending goto animation.
Vector< 3, Angle< fltp08 > > gotoOrientation () const
 Gets the target orientation for a pending goto animation.
bool hasFullAutoFocus () const
 Checks whether the camera has full auto-focus enabled on all axes.
bool hasWorldGridAlignment () const
 Checks whether the camera grid is aligned with the world coordinate system.
fltp08 heightToWidthRatio () const
 Computes the height-to-width ratio of the viewport.
bool isObjectPotentiallyVisibleToCamera (const UUID &id) const
 Checks whether the given object is potentially visible from this camera's viewpoint.
bool isUserCamera () const
 Checks whether this camera represents a user-interactive viewport camera.
void look (fltp08 horz_percent, fltp08 vert_percent)
 Rotates the camera by normalized horizontal and vertical percentages.
void look (fltp08 horz_percent, fltp08 vert_percent, const CameraAnimation &original)
 Rotates the camera by normalized horizontal and vertical percentages with animation parameters.
void lookHorizontal (fltp08 percent)
 Rotates the camera horizontally by a normalized percentage of the view.
void lookVertical (fltp08 percent)
 Rotates the camera vertically by a normalized percentage of the view.
void move (const Ray< 3, fltp08 > &distance)
 Moves the camera by a ray-defined offset and direction.
void move (const Ray< 3, fltp08 > &distance, const CameraAnimation &original)
 Moves the camera by a ray-defined offset and direction with animation parameters.
void move (fltp08 horizontal_distance, fltp08 vertical_distance)
 Moves the camera by the specified horizontal and vertical distances.
void move (fltp08 horizontal_distance, fltp08 vertical_distance, const CameraAnimation &original)
 Moves the camera by the specified horizontal and vertical distances with animation parameters.
void moveForward (fltp08 distance)
 Moves the camera forward or backward along its look direction.
void moveHorizontal (fltp08 distance)
 Moves the camera horizontally (left/right) relative to its view direction.
void moveHorizontalPercent (fltp08 percent)
 Moves the camera horizontally by a normalized percentage of the viewport width.
void movePercent (fltp08 horizontal_percent, fltp08 vertical_percent)
 Moves the camera by normalized horizontal and vertical percentages of the viewport.
void movePercent (fltp08 horizontal_percent, fltp08 vertical_percent, const CameraAnimation &original)
 Moves the camera by normalized horizontal and vertical percentages with animation parameters.
void moveVertical (fltp08 distance)
 Moves the camera vertically (up/down) relative to its view direction.
void moveVerticalPercent (fltp08 percent)
 Moves the camera vertically by a normalized percentage of the viewport height.
const Bounds< 1, fltp08 > & nearPlaneBounds () const
 Gets the allowable range for the near clipping plane distance.
void panPercent (fltp08 horizontal_percent, fltp08 vertical_percent, const CameraAnimation &original)
 Pans the camera by normalized percentages, keeping the target point fixed while moving the offset.
fltp04 pixelThickness () const
 Gets the current pixel thickness for rendering lines and points.
void postUpdateBackground ()
 Signals that the camera background needs to be updated.
SnapLocation preferredSnapLocation () const
 Gets the preferred snap location for this camera.
Matrix< fltp08projectionMatrix () const
 Gets the current projection matrix, which may be custom or calculated.
void readMetaData ()
 Reads camera metadata from the underlying design object storage.
void refreshFocusBounds (const DesignObjectLookup *lookup, TimeSpan animation_time)
 Recomputes the auto-zoom focus bounds based on the current scene state.
bool refreshMovement (const Time &current_time, const DesignObjectLookup *lookup=nullptr, const TimeSpan &time_out=TimeSpan(0.2))
 Advances any active camera animations and updates the camera position and orientation.
void setAutoZoomFocus (AutoZoomFocus focus)
 Sets the auto-zoom focus configuration for this camera.
void setFarPlaneBounds (const Bounds< 1, fltp08 > &near_plane_bounds)
 Sets the allowable range for the far clipping plane distance.
void setFocusBounds (const Bounds< 3, fltp08 > &bounds)
 Sets the auto-zoom focus bounds directly.
void setNearPlaneBounds (const Bounds< 1, fltp08 > &near_plane_bounds)
 Sets the allowable range for the near clipping plane distance.
void setProjectionTransform (const Matrix< fltp08 > &transform)
 Sets a custom projection transform matrix, overriding the computed one.
void setReferenceSize (fltp08 size)
 Sets the reference size used for scaling calculations.
void setupFromFormat (const ViewportFormat &format)
 Configures this camera from the given viewport format settings.
void setUseReferenceSize (bool use_reference_size)
 Sets whether the camera should use a reference size for scaling calculations.
void setWindowSize (const Vector< 2, uint04 > &size)
 Sets the window size for this camera viewport.
Vertex< 2, fltp08toScreenSpace (const Vector< 2, fltp04 > &pixel_location) const
 Converts a pixel location to normalized screen space in the range -1.0 to 1.0.
Vertex< 3, fltp08toWorldSpaceFromPixelSpace (const Vector< 2, fltp04 > &pixel_location, fltp08 depth_percent) const
 Converts a pixel-space location and depth to a 3D world-space position.
Vertex< 3, fltp08toWorldSpaceFromViewSpace (const Vector< 2, fltp08 > &view_location, fltp08 depth_percent) const
 Converts a view-space location and depth to a 3D world-space position.
void updateGridSpacing ()
 Recalculates the grid spacing based on the current zoom level and view parameters.
void updateSelectionInfo (const Bounds< 2, fltp04 > &pixel_location, SelectionInfo &info) const
 Updates the given SelectionInfo with a rectangle-based selection at the specified pixel bounds.
void updateSelectionInfo (const Polygon< fltp04 > &pixel_location, SelectionInfo &info) const
 Updates the given SelectionInfo with a polygon-based selection at the specified pixel polygon.
void updateSelectionInfo (const Vector< 2, fltp04 > &pixel_location, SelectionInfo &info) const
 Updates the given SelectionInfo with a point-based selection at the specified pixel location.
Matrix< fltp08viewMatrix () const
 Gets the view matrix (camera transformation matrix).
Matrix< fltp08viewToWorldSpace () const
 Computes the transformation matrix from view space to world space.
fltp08 widthToHeightRatio () const
 Computes the width-to-height ratio of the viewport.
Vector< 2, uint04windowSize () const
 Gets the current window size in pixels.
Matrix< fltp08worldToViewSpace () const
 Computes the transformation matrix from world space to view space.
void writeMetaData ()
 Writes the current camera metadata to the underlying design object storage.
void zoom (fltp08 distance_mult, const CameraAnimation &original)
 Zooms the camera by a distance multiplier with animation parameters.
Public Member Functions inherited from Model
 Model ()
 Default constructor. Creates an uninitialized Model.
 Model (const DesignInfo &obj)
 Constructs a Model from an existing DesignInfo descriptor.
 Model (DesignObjectBase *base)
 Constructs a Model from a design object base, using the next available index.
 Model (uint04 index, DesignObjectBase *base)
 Constructs a Model at a specific index within the design object base.
void addChild (Model &child)
 Adds an existing model as a child of this model.
void addChild (uint04 child_idx, Model &child)
 Adds an existing model as a child at a specific index.
void addChild (uint04 child_index)
 Adds a child by its database index.
void addPerVertexColorFromMaterialConstant (UVType constant_index)
 Adds per-vertex color data derived from a material constant UV channel.
Matrix< fltp08applyTransformToParent (Matrix< fltp08 > mat, const Matrix< fltp08 > &parent_mat) const
 Applies a transformation matrix to the parent transform, respecting parent matrix flags.
Vector< 3, fltp08calculateAverageDirection (const Matrix< fltp08 > &parent_transform=Constant< Matrix< fltp08 > >::Invalid) const
 Calculates the average direction vector of descendant linear geometries.
Vector< 2, fltp08calculateHVLength (const Matrix< fltp08 > &parent_transform=Constant< Matrix< fltp08 > >::Invalid) const
 Calculates horizontal and vertical length components of descendant linear geometries.
void calculateIndexNeighborList ()
 Calculates the index neighbor list for geometry processing.
fltp08 calculateLength (const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid) const
 Calculates the total length of all descendant linear geometries.
void calculateNormals (NormalMode mode, Angle< fltp08 > smoothing_angle)
 Recalculates normals for all descendant geometries.
void calculateSmoothTextures (Vector< 3, fltp08 > origin, fltp08 scale)
 Calculates smooth texture coordinates based on a projection origin and scale.
fltp08 calculateSurfaceArea (const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid) const
 Calculates the surface area of all descendant mesh geometries.
void calculateTangentSpace (bool calc_tan, bool calc_bitan)
 Calculates tangent and/or bitangent vectors for all descendant geometries.
fltp08 calculateVolume (const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid) const
 Calculates the volume of all descendant mesh geometries.
Vector< 2, fltp08calculateVolumeAndSurfaceArea (const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid, const void *lock=nullptr) const
 Calculates both volume and surface area in a single pass for efficiency.
bool canExplode () const
 Checks whether this model can be exploded into its constituent children.
bool canInteract () const
 Checks whether this model can be interacted with (visible, not locked, etc.).
Vertex< 3, fltp08centerAlignModel ()
 Centers the model geometry at the origin and returns the offset applied.
void checkBounds ()
 Validates and recalculates cached bounding boxes if needed.
uint04 childCount () const
 Returns the number of direct children this model has.
void clearChildren ()
 Removes all children from this model without deleting them.
void clearLayer ()
 Removes the layer assignment from this model.
void clearMaterial ()
 Removes the material assignment from this model.
void clearMaterialDescendants ()
 Removes all descendant material assignments without deleting the materials.
void colorByChannel (Material &mat, const StringView &channel, fltp08 avg=Constant< fltp08 >::Invalid) const
 Colors geometry vertices by a data channel value from a material.
void copyFrom (const Model &model, bool deep_copy, bool copy_ids=false, bool recursive=true, bool keep_root_properties=false)
 Copies data from another model into this model.
void copyMaterialProperties (const Model &model)
 Copies material properties from another model to this model.
Model createChild ()
 Creates a new child model and appends it to this model's child list.
Model createChild (uint04 child_slot)
 Creates a new child model at a specific child slot index.
Effect createChildEffect ()
 Creates a new child effect attached to this model.
Geometry createChildGeometry ()
 Creates a new child geometry for this model.
Material createChildMaterial (bool copy_child=false)
 Creates a new child material for this model.
void createChildren (uint04 child_size)
 Creates multiple children at once.
Effect createSceneEffect () const
 Creates a new effect in the scene database.
Geometry createSceneGeometry () const
 Creates a new geometry in the scene database.
Model createSceneLayer () const
 Creates a new layer model in the scene database.
Material createSceneMaterial () const
 Creates a new material in the scene database.
Model createSceneModel () const
 Creates a new model in the scene database associated with this model.
RGBColor customModelColor (ModelColorMode mode) const
 Returns the resolved model color based on the specified color mode.
void deleteChildren ()
 Deletes all children of this model.
void deleteModel (bool deletchildren, bool removfrom_parent=true)
 Deletes this model from the scene.
BitFlag descendedFlagsNoCache (bool complete_cache_ignore) const
 Computes descended flags without using the cache.
BitFlag descendedPersonalFlagsNoCache () const
 Computes descended personal flags without using the cache.
void descendentGeometryTypes (Set< GeometryType > &buffer) const
 Collects all unique geometry types from descendants into the provided set.
Model directLayer () const
 Returns the directly assigned layer model.
TranslatedString displayName () const
 Returns the translated display name for this model.
TranslatedString displayNamePath (const StringView &seperator=":") const
 Returns the full display name path from root to this model.
bool doesModelPropertyContain (NDPN property, const char *value, bool ignorcase) const
 Checks whether a model property contains a given C-string substring.
template<class t_type>
bool doesModelPropertyContain (NDPN property, const StringView &value, bool ignorcase) const
 Checks whether a model property contains a given substring.
void ensureTangentSpace (bool ensure_tan, bool ensure_bitan)
 Ensures that tangent and/or bitangent data exists, calculating if needed.
void ensureVisibleChildren (uint04 count)
 Hides children whos child index is greater than size, or creates/shows children if needed such that there is exactly a given number of visible children for this model.
void eraseModel ()
 Erases this model from the database without removing children.
ModelBuffer explodeModel ()
 Explodes this model, promoting its children to siblings in the parent.
bool exportIgnored () const
 Checks whether this model is excluded from export operations.
Model findDescendentByName (const StringView &name) const
 Recursively searches descendants for a model with the given name.
Model findDescendentByType (const StringView &type) const
 Recursively searches descendants for a model with the given type.
Time getAscModifiedTime (bool include_self, bool include_layer=true) const
 Returns the greatest modified time of this model and all ancestors.
Bounds< 3, fltp08getBounds () const
 Returns the local bounding box of this model.
Bounds< 3, fltp08getBoundsOfVisible () const
 Returns the bounding box of all visible descendants.
Model getChild (uint04 child) const
 Returns the child model at the given child slot index.
Model getChild (UUID id) const
 Returns the child model with the specified UUID.
uint04 getChildIndex () const
 Returns this model's index within its parent's child list.
uint04 getChildIndex (uint04 child) const
 Returns the database index of the child at the given slot.
Buffer< uint04getChildIndices () const
 Returns the database indices of all direct children.
uint04 getChildLayerIndex () const
 Returns this model's index within its parent's layer child list.
ModelBuffer getChildren () const
 Returns a buffer containing all direct children of this model.
void getChildren (ModelBuffer &children) const
 Appends all direct children of this model to the provided buffer.
ModelBuffer getChildrenByName (const StringView &name) const
 Returns all direct children whose name matches the given string.
ModelBuffer getChildrenByType (const Buffer< String > &type) const
 Returns all direct children whose type matches any of the given strings.
ModelBuffer getChildrenByType (const StringView &type) const
 Returns all direct children whose type matches the given string.
Buffer< UUIDgetChildrenIDs () const
 Returns the UUIDs of all direct children.
PrimitiveAlignedBuffer< std::pair< Model, Geometry >, 32 > getClippingGeometry () const
 Returns model-geometry pairs used for clipping operations.
Matrix< fltp08getCompleteTransform () const
 Returns the fully composed local-to-global transform matrix for this model.
ModelBuffer getDescendants (bool include_deleted=false, bool local_only=false) const
 Returns all descendant models recursively.
void getDescendants (ModelBuffer &buffer, bool include_deleted=false, bool local_only=false) const
 Appends all descendant models recursively to the provided buffer.
ModelBuffer getDescendantsByName (const StringView &name, uint04 max_count=Constant< uint04 >::Max) const
 Recursively searches all descendants for models matching the given name.
ModelBuffer getDescendantsByNameAndType (const StringView &name, const StringView &type, uint04 max_count=Constant< uint04 >::Max) const
 Recursively searches all descendants for models matching both name and type.
ModelBuffer getDescendantsByType (const StringView &type, uint04 max_count=Constant< uint04 >::Max) const
 Recursively searches all descendants for models matching the given type.
Time getDescModifiedTime (bool includself) const
 Returns the greatest modified time of this model and all descendants.
uint04 getDirectLayerIndex () const
 Returns the database index of the directly assigned layer.
Effect getEffect (uint04 index=0) const
 Returns the effect at the specified child index.
EffectBuffer getEffectChildren () const
 Returns all direct child effects of this model.
EffectBuffer getEffectDescendants () const
 Returns all descendant effects recursively.
uint04 getEffectIndex (uint04 child_index=0) const
 Returns the database index of the effect at the given child slot.
Model getFamilyMember (uint04 index) const
 Returns a model from the family tree (ancestors + descendants) by flat index.
Geometry getGeometry () const
 Returns the geometry attached to this model.
GeometryBuffer getGeometryDescendants (bool remove_redundant=true, uint04 max_count=Constant< uint04 >::Max) const
 Recursively collects all descendant geometries.
uint04 getGeometryIndex () const
 Returns the database index of the geometry associated with this model.
Model getLayer () const
 Returns the layer model assigned to this model (direct or inherited).
Material getMaterial () const
 Returns the material assigned to this model.
MaterialBuffer getMaterialDescendants (bool local_only=false) const
 Recursively collects all descendant materials.
void getMaterialDescendants (MaterialBuffer &materials, bool local_only=false) const
 Appends all descendant materials to the provided buffer.
void getMaterialDescendants (Set< Material > &materials, bool local_only=false) const
 Appends all descendant materials to the provided set (deduplicating).
MaterialBuffer getMaterialDescendantsByName (const StringView &name, uint04 max_count=Constant< uint04 >::Max) const
 Returns descendant materials filtered by name.
uint04 getMaterialIdx () const
 Returns the database index of the material assigned to this model.
MaterialMode getMaterialMode () const
 Returns the material mode determining how materials are resolved for this model.
StringView getModelIcon () const
 Returns the icon identifier string for this model's type.
uint04 getNumOfEffects () const
 Returns the number of effects attached to this model.
Model getParent () const
 Returns the parent model of this model.
uint04 getParentIndex () const
 Returns the database index of this model's parent.
Matrix< fltp08getParentTransform () const
 Returns the parent's transformation matrix as seen by this model.
Model getRoot () const
 Returns the root ancestor of this model's hierarchy.
Material getRootMaterial () const
 Returns the root material resolved through the hierarchy.
Model getRootMaterialModel ()
 Returns the ancestor model that determines the root material for this model.
Effect getSceneEffect (UUID id) const
 Returns a scene effect by its UUID.
EffectBuffer getSceneEffects () const
 Returns all effects in the scene database.
GeometryBuffer getSceneGeometries () const
 Returns all geometries in the scene database.
Geometry getSceneGeometry (uint04 index) const
 Returns a scene geometry by database index.
Geometry getSceneGeometry (UUID id) const
 Returns a scene geometry by UUID.
Model getSceneLayer (UUID id) const
 Returns a scene layer by its UUID.
ModelBuffer getSceneLayers (bool include_deleted=false) const
 Returns all layer models in the scene.
Material getSceneMaterial (uint04 index) const
 Returns a scene material by database index.
Material getSceneMaterial (UUID id) const
 Returns a scene material by UUID.
MaterialBuffer getSceneMaterials () const
 Returns all materials in the scene database.
Model getSceneModel (UUID id) const
 Retrieves a scene model by its UUID.
ModelBuffer getSceneModels (bool include_deleted=false, bool local_only=false) const
 Returns all models in the scene database.
ModelBuffer getSceneModelsByName (const StringView &name, uint04 max_count=Constant< uint04 >::Max, bool includdeleted=false) const
 Returns scene models filtered by name.
ModelBuffer getSceneModelsByType (const StringView &type, uint04 max_count=Constant< uint04 >::Max, bool includdeleted=false) const
 Returns scene models filtered by type.
Bounds< 3, fltp08getSelectionBounds () const
 Returns the selection-specific bounding box in local space.
template<class t_type>
Buffer< t_type > getTypeChildren (const StringView &type) const
 Returns children of a specific type, cast to the requested derived type.
template<class t_type>
Buffer< t_type > getTypeDescendants (const StringView &type) const
 Recursively searches descendants for models of a specific type, cast to a derived type.
Bounds< 3, fltp08globalBounds () const
 Returns the global bounding box of this model (including transform).
Vertex< 3, fltp08globalCenterOfRotation () const
 Returns the center of rotation in global coordinates.
Bounds< 3, fltp08globalSelectionBounds () const
 Returns the global selection bounding box.
bool hasChild (uint04 child_index=0U) const
 Checks whether this model has a child at the given slot.
void hasDescendants (bool &has_point, bool &has_line, bool &has_mesh, bool only_user_objects) const
 Checks which types of geometry primitives exist among descendants.
bool hasDescendent (const Model &model) const
 Checks whether a given model is a descendant of this model.
bool hasDescendent (const UUID &id) const
 Checks whether a model with the given UUID is a descendant of this model.
bool hasDirectLayer () const
 Checks whether this model has a directly assigned layer (not inherited).
bool hasEffect (uint04 index=0) const
 Checks whether an effect exists at the given child index.
bool hasFocus () const
 Checks whether this model currently has focus.
bool hasGeometryDescendent () const
 Checks whether any descendant has geometry data.
bool hasHoles (PrimitiveProperty property) const
 Checks whether the geometry has holes (missing primitives) for a given property.
bool hasLayer () const
 Checks whether this model has a layer (directly or inherited).
bool hasLayerRootMaterial () const
 Checks whether a root material exists through the layer hierarchy.
bool hasLinearDescendent () const
 Checks whether any descendant has linear (line/polyline) geometry.
bool hasMaterial () const
 Checks whether this model has a material assigned.
bool hasMeshDescendent () const
 Checks whether any descendant has mesh (triangle) geometry.
bool hasPointsDescendent () const
 Checks whether any descendant has point geometry.
bool hasRootMaterial () const
 Checks whether a root material can be resolved through the hierarchy.
bool hasSelectedDescendent () const
 Checks whether any descendant of this model is selected.
Vector< 32, bool > inheritedFlags () const
 Returns the cached inherited flags vector for this model.
Vector< 32, bool > inheritedFlagsNoCache (bool complete_cache_ignore) const
 Computes inherited flags without using the cache.
Vector< 32, bool > inheritedPersonalFlagsNoCache () const
 Computes inherited personal flags without using the cache.
void invalidateBounds ()
 Invalidates all cached bounding boxes, forcing recalculation on next access.
void invalidateGlobalBoundsDesc ()
 Invalidates global bounding boxes for this model and all descendants.
void invalidateSelectionBounds ()
 Invalidates the cached selection bounding box.
void invalidateTransformCache ()
 Invalidates the cached transformation matrix, forcing recomputation.
void invalidateVisibleBounds ()
 Invalidates the cached visible bounding box.
bool isApplicationOwned () const
 Checks whether this model is owned by the application (not user-created).
bool isDeleted () const
 Checks whether this model has been deleted.
bool isLayer () const
 Checks whether this model is a layer definition.
bool isLocked () const
 Checks whether this model is locked against editing.
bool isScene () const
 Checks whether this model represents a scene root node.
bool isSelected () const
 Checks whether this model is currently selected.
bool isTreeVisible () const
 Checks whether this model is visible in the model tree view.
template<class t_buffer_type>
bool isType (const Buffer< t_buffer_type > &types) const
 Checks whether the model's type matches any type in the given buffer.
bool isVisible () const
 Checks whether this model is visible (accounting for inherited visibility).
 operator bool () const
 Boolean conversion operator. Returns true if this Model references a valid entry.
void overrideMaterialDescendants (MaterialMode override_desc)
 Overrides material mode for all descendants.
BitFlag parentMatrixFlags () const
 Returns the parent matrix flags for this model.
BitFlag personalDescendedFlags () const
 Returns the cached personal descended flags.
Vector< 32, bool > personalInheritedFlags () const
 Returns the personal inherited flags from the cache.
void removeChild (const Model &model)
 Removes a specific child model from this model's child list.
void removeDuplicateVertices (fltp08 epsilon, void *lock, InfoPipe *log=nullptr)
 Removes duplicate vertices from all descendant geometries.
void removeGeometry ()
 Removes the geometry reference from this model (does not delete the geometry).
void removeMaterial ()
 Removes the material from this model.
void restoreModel ()
 Restores a previously deleted model, re-adding it to the scene.
void restoreModel (Model &parent, uint04 index=Constant< uint04 >::Invalid)
 Restores a previously deleted model under a specific parent.
void setChildApplicationConstructed (const StringView &database_name=StringView())
 Sets the child database to an application-constructed database by name.
void setChildApplicationConstructed (DesignObjectBase *base)
 Sets the child database to use an application-constructed DesignObjectBase.
void setChildEffectSize (uint04 child_size)
 Sets the number of child effect slots for this model.
void setChildIndex (uint04 child, uint04 id)
 Sets the database index for a specific child slot.
void setEffectIndex (uint04 material_index, uint04 sub_index=0)
 Sets the effect database index at a given sub-index.
void setGeometryApplicationConstructed (const StringView &database_name=StringView())
 Sets the geometry database to an application-constructed database by name.
void setGeometryChild (Geometry &geo)
 Sets the geometry child of this model to an existing Geometry object.
void setGeometryIndex (uint04 geo_index)
 Sets the geometry database index for this model.
void setIsLayer (bool is_layer)
 Marks or unmarks this model as a layer definition.
void setLayer (Model layer)
 Assigns this model to a specific layer.
void setMaterial (const Material &material)
 Assigns a material to this model.
void setMaterialApplicationConstructed (const StringView &database_name=StringView())
 Sets the material database to an application-constructed database by name.
void setMaterialMode (MaterialMode option)
 Sets the material mode for this model.
void setModelTransform (const Matrix< fltp08 > &transform)
 Sets the model's local transformation matrix, replacing the current one.
bool setModelVisible (bool is_visible)
 Sets the visibility of this model.
void setNormalMode (NormalMode mode, Angle< fltp08 > smoothing_angle, InfoPipe *log)
 Sets the normal mode and recalculates normals with progress logging.
void setOrientation (const Vector< 3, Angle< fltp08 > > &new_orientation, const void *lock=nullptr)
 Sets the orientation of this model using floating-point angles.
void setOrientation (const Vector< 3, Angle< sint04 > > &new_orientation, const void *lock=nullptr)
 Sets the orientation of this model using integer-precision angles.
void setParentMatrixFlag (ParentMatrixFlags flag, bool value)
 Sets or clears a specific parent matrix flag.
void setParentMatrixFlags (BitFlag flags)
 Sets the parent matrix flags controlling which parent transform components to inherit.
void setSize (const Vector< 3, fltp08 > &size)
 Sets the model size by scaling its transform to match the desired dimensions.
void setWindingMode (WindingMode mode)
 Sets the winding mode for all descendant geometries.
Vector< 3, fltp08size () const
 Returns the size (extents) of the model's bounding box.
void swapChildren (uint04 a, uint04 b)
 Swaps the positions of two children in the child list.
void updateAscGeometryTime (const Time &time, bool include_self)
 Updates the geometry-modified timestamp for this model and all ancestors.
void updateAscTime (const Time &time, bool includself)
 Updates the modified timestamp for this model and all ancestors.
void updateDescGeometryTime (const Time &time, bool include_self)
 Updates the geometry-modified timestamp for this model and all descendants.
void updateDescTime (const Time &time, bool include_self)
 Updates the modified timestamp for this model and all descendants.
void updateFrom (const Model &model, bool check_resources)
 Updates this model's properties from another model, optionally checking resources.
void updateGeometryTime (Time time=Time::SystemTime())
 Updates the geometry-modified timestamp for this model.
void updateInheritedFlagsCache (bool force_update_all=false, bool update_personal_flags=false)
 Recalculates and caches the inherited flags for this model.
void updateModelTransform (const Matrix< fltp08 > &transform, const void *lock=nullptr)
 Applies a delta transform to the current model transform.
void updateModifiedTime (Time time=Time::SystemTime())
 Updates the modified timestamp for this model.
void updateVisibleRecursive (bool is_visible)
 Recursively updates visibility for this model and all descendants.
void validate (bool validate_children=true) const
 Validates this model's internal state for consistency.
uint04 vertexCount () const
 Returns the total number of vertices across all descendant geometries.
uint04 visibleVertexCount () const
 Returns the total number of visible vertices across all descendant geometries.
Public Member Functions inherited from DesignObject
 DesignObject ()=default
 Creates an "invalid" design object.
 DesignObject (const DesignInfo &info)
 Constructs a DesignObject from an existing DesignInfo, sharing the same base and indices.
 DesignObject (DesignObjectBase *base)
 Creates an new design object within the given DesignObjectBase.
 DesignObject (uint04 index, DesignObjectBase *base)
 Sets a DesignObject up to be a pointer to an existing object in the database.
JSONNode activeFilters () const
 Retrieves the active filters applied to this design object as a JSON structure.
void appendData (const StringView &data, bool compressed)
 Appends data to this design object's data storage.
DesignObjectBasebase () const
 Returns a reference to the underlying DesignObjectBase database.
void clearAllMetaData ()
 Removes all metadata entries from this design object.
void clearMetaData (const StringView &index)
 Removes a specific metadata entry by key.
void copyFrom (const DesignObject &object)
 Copies all properties from the given design object into this one.
uint04 designIndex () const
 Returns the design-specific index used to access type-specific properties (e.g., model, geometry, material properties).
bool doesPropertyBeginWith (NDPO property, const StringView &value, bool ignore_case) const
 Checks whether a string property's value begins with the given substring.
bool doesPropertyContain (NDPO property, const StringView &value, bool ignore_case) const
 Checks whether a string property's value contains the given substring.
File file () const
 Returns the file path associated with this design object as a File object.
template<auto t_property>
constexpr decltype(auto) get () const
 Retrieves a property value using a compile-time property constant, with the type deduced from PropertySpec.
template<auto t_property, class t_type>
constexpr decltype(auto) get () const
 Retrieves a property value using a compile-time property constant, cast to the requested type.
template<class t_type, class t_property_type>
constexpr decltype(auto) get (t_property_type property) const
 Retrieves a property value from the database, cast to the requested type.
DesignObject getDesignParent () const
 Retrieves the parent design object of this object in the model hierarchy.
StringView getIcon () const
 Retrieves the icon identifier string associated with this design object.
template<class t_type>
decltype(auto) getInheritedProperty (NDPO property) const
 Retrieves a property value, walking up the parent hierarchy if the property is not set on this object.
Scene getScene () const
 Retrieves the Scene that this design object belongs to.
bool hasMetaData (const StringView &index) const
 Checks whether a metadata entry exists for the given key.
template<class t_type, class t_design_type>
bool hasProperty (t_design_type property) const
 Checks whether a property has a valid (non-default) value.
uint04 index () const
 Returns the primary row index of this object within the DesignObjectBase property table.
template<auto t_property>
bool is (const char *value) const
 Checks whether a compile-time property matches the given C-string value.
template<auto t_property>
bool is (const String &value) const
 Checks whether a compile-time property matches the given String value.
template<auto t_property>
bool is (const StringView &value) const
 Checks whether a compile-time property matches the given StringView value.
template<auto t_property, class t_type>
std::enable_if<!ObjectInfo< t_type >::String, bool >::type is (const t_type &value) const
 Checks whether a compile-time property matches a non-string value using equality comparison.
template<class t_property_type>
bool is (t_property_type property, const char *value) const
 Checks whether a string property matches the given C-string value.
template<class t_property_type>
bool is (t_property_type property, const String &value) const
 Checks whether a string property matches the given String value.
template<class t_property_type>
bool is (t_property_type property, const StringView &value) const
 Checks whether a string property matches the given StringView value.
template<class t_property_type, class t_type>
std::enable_if<!ObjectInfo< t_type >::String, bool >::type is (t_property_type property, const t_type &value) const
 Checks whether a non-string property matches the given value using equality comparison.
bool isDesignType (DesignObjectType mode) const
 Checks whether this object has the specified design type flag set.
bool isDesignType (uint04 mode) const
 Checks whether this object has the specified design type flag set, using a raw integer value.
bool isValid () const
 Checks whether this design object has a valid index into the database.
const JSONNodemetaData () const
 Retrieves the entire metadata tree for this design object.
const JSONNodemetaData (const StringView &index) const
 Retrieves a specific metadata entry by key.
void offsetDesign (const Vector< 3, fltp08 > &offset)
 Translates this design object by the given offset vector.
 operator bool () const
 Bool conversion operator.
bool operator!= (const DesignObject &object) const
 Checks inequality with another DesignObject.
bool operator< (const DesignObject &object) const
 Less-than comparison for ordering DesignObjects (e.g., for sorted containers).
bool operator== (const DesignObject &object) const
 Checks equality with another DesignObject by comparing base pointers and indices.
bool operator> (const DesignObject &object) const
 Greater-than comparison for ordering DesignObjects (e.g., for sorted containers).
Table & propertyTable ()
 Returns a mutable reference to the property table that stores this object's properties.
const Table & propertyTable () const
 Returns a const reference to the property table that stores this object's properties.
void removeMetaData (const StringView &index, const void *lock_ptr=nullptr)
 Removes a metadata entry by key, with optional write lock support.
void scale (Vector< 3, fltp08 > scale, Vertex< 3, fltp08 > center_of_scale, const Matrix< fltp08 > &transform)
 Scales this design object's geometry by the given scale factors around a center point, applying an additional transform.
void scale (Vector< 3, fltp08 > scale, Vertex< 3, fltp08 > center_of_scale=Constant< Vertex< 3, fltp08 > >::Invalid)
 Scales this design object's geometry and transform by the given scale factors around a center point.
template<auto t_property, class t_type>
void set (const t_type &value)
 Sets a property value in the database using a compile-time property constant.
template<class t_type, class t_property_type>
void set (t_property_type property, const t_type &value)
 Sets a property value in the database.
void setActiveFilters (const JSONNode &node)
 Sets the active filters on this design object from a JSON structure.
void setDesignType (DesignObjectType mode, bool is_type)
 Sets or clears a design type flag on this object.
void setMetaData (const JSONNode &node)
 Replaces the entire metadata tree with the given JSON node.
void setMetaData (const StringView &index, const bool &data)
 Sets a metadata entry at the given key to a boolean value.
void setMetaData (const StringView &index, const fltp08 &data)
 Sets a metadata entry at the given key to a 64-bit floating point value.
void setMetaData (const StringView &index, const JSONNode &node)
 Sets a metadata entry at the given key to the specified JSON node value.
void setMetaData (const StringView &index, const String &data)
 Sets a metadata entry at the given key to a String value.
void setMetaData (const StringView &index, const StringView &data)
 Sets a metadata entry at the given key to a StringView value.
void setMetaData (const StringView &index, const uint01 &data)
 Sets a metadata entry at the given key to a uint01 value.
void setMetaData (const StringView &index, const uint04 &data)
 Sets a metadata entry at the given key to a uint04 value.
template<auto t_property, class t_type>
bool update (const t_type &value, const void *lock=nullptr)
 Updates a property using a compile-time property constant, only if the new value differs.
template<class t_type, class t_property_type>
bool update (t_property_type property, const t_type &value, const void *lock=nullptr)
 Updates a property only if the new value differs from the current value.
void updateCreatedTime ()
 Sets the creation time stamp for this design object to the current system time.
void updateDesignModifiedTime (Time time=Time::SystemTime())
 Updates the modified time stamp for this design object.
void updateDesignTransform (const Matrix< fltp08 > &transform, const void *lock=nullptr)
 Updates the transform of this design object if it differs from the current value.
bool updateDesignVisible (bool is_visible, const void *lock=nullptr)
 Updates the spatial visibility of this design object if it differs from the current value.
void updateMetaData (const StringView &index, const bool &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
void updateMetaData (const StringView &index, const fltp08 &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
void updateMetaData (const StringView &index, const String &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
void updateMetaData (const StringView &index, const StringView &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
bool validateDesignObject () const
 Validates the internal state of this design object, ensuring indices and base pointer are consistent.

Static Public Member Functions

static constexpr StringView TypeName ()
 Gets the type name identifier for Camera objects.
Static Public Member Functions inherited from Model
static ModelBuffer ReduceToRoots (const ModelBuffer &children, const std::function< bool(const Model &, const Set< Model > &)> &filter)
 Reduces a collection of models to only root-level models (removing any that are descendants of others in the set), filtered by a user-provided predicate.
Static Public Member Functions inherited from DesignObject
static constexpr StringView FilePathDesignNameVariable ()
 Returns the placeholder variable string used in file paths to represent the design name.

Public Attributes

Resource< Stringcamera_format
 Format descriptor for the camera source (e.g., resolution, codec).
Resource< Stringcamera_source
 Identifier of the source providing the camera feed (e.g., device name).
Resource< Vertex< 2, fltp08 > > cross_hairs
 The 2D position of the crosshair overlay on screen.
Resource< fltp08default_zoom_delta
 The default incremental change applied during zoom operations.
Resource< fltp08far_plane
 The distance from the camera to the far clipping plane.
DynamicPointer< Set< UUID > > hidden_items
 Set of object UUIDs explicitly marked as hidden from this camera.
Resource< bool > is_exposed
 Whether the camera viewport is currently exposed and visible to the user.
Resource< bool > is_orthographic
 Whether the camera uses orthographic projection instead of perspective.
Resource< bool > is_valid
 Whether the camera is in a valid, usable state.
Resource< Timelast_visible_update_time
 Timestamp of the last update to visible content.
Resource< bool > location_lock
 Whether the camera position is locked and cannot be moved.
Resource< fltp08near_plane
 The distance from the camera to the near clipping plane.
Resource< Vertex< 3, fltp08 > > offset
 The positional offset of the camera in 3D world space.
Resource< Vector< 3, Angle< fltp08 > > > orientation
 The rotational orientation of the camera as Euler angles.
Resource< fltp08orthographic_fov
 The field of view size used for orthographic projection.
Resource< fltp08orthographic_perspective_ratio
 The blend ratio between orthographic and perspective projection modes.
Resource< Vector< 2, Angle< fltp08 > > > perspective_fov
 The horizontal and vertical field of view angles for perspective projection.
Resource< fltp04pixel_thickness
 The thickness of rendered lines and points in pixels.
Resource< fltp08plane_intercept_value
 The depth value at which a cutting plane intercepts the view.
Resource< bool > rotation_lock
 Whether the camera rotation is locked and cannot be changed.
Resource< ScreenshotRequestscreenshot_request
 The current pending screenshot request, if any.
Resource< SelectionInfoselection_info
 The current selection state associated with this camera view.
Resource< Vertex< 3, fltp08 > > target
 The point in 3D world space the camera is looking at.
DynamicPointer< Set< UUID > > visible_items
 Set of object UUIDs explicitly marked as visible to this camera.
Resource< fltp08zoom_extent_mult
 Multiplier applied to the zoom extents calculation.

Additional Inherited Members

Public Types inherited from Model
enum  DescendedFlags { e_descendent_selected = 0 , e_descendent_focussed = 1 , e_descendent_deletion_blocked = 2 }
 Flags that propagate upward from descendant models to ancestors, indicating aggregate states of the subtree below this model. More...
enum  InheritedFlags : uint01 {
  e_inherited_is_visible = 0 , e_inherited_has_no_focus = 1 , e_inherited_is_tree_visible = 2 , e_inherited_not_selected = 3 ,
  e_placholder = 4 , e_inherited_can_delete = 5 , e_inherited_does_not_follow_camera = 6 , e_inherited_does_not_orient_to_camera = 7 ,
  e_inherited_does_not_scale_to_camera = 8 , e_inherited_not_deleted = 9 , e_inherited_not_application_owned = 10 , e_inherited_exportable = 11
}
 Flags that are recursively inherited from ancestor models down through the hierarchy. More...
enum class  MaterialMode { e_by_parent , e_by_layer , e_custom , e_hidden }
 Determines how a model resolves its material for rendering. More...
enum class  ModelColorMode { e_direct , e_by_selectable_children , e_by_material_root , e_by_layer }
 Determines how the model color is resolved for display purposes. More...
enum  ParentMatrixFlags : uint01 {
  e_ignore_offset = 0 , e_ignore_scale = 1 , e_ignore_rotation = 2 , e_ignore_scale_distortion = 3 ,
  e_use_only_for_offset = 4 , e_orient_to_camera = 5 , e_follow_camera = 6 , e_scale_to_camera = 7
}
 Flags controlling which components of the parent's transformation matrix are applied to this model. More...
Public Types inherited from DesignInfo
enum  DesignObjectType : uint01
Protected Member Functions inherited from Model
DesignObjectBasechildBase () const
 Returns the DesignObjectBase used for child model storage.
ColumnT< uint04 > & childToParentReference () const
 Returns the column mapping child indices to parent indices.
DesignObjectBasegeometryBase () const
 Returns the DesignObjectBase used for geometry storage.
DesignObjectBasematerialBase () const
 Returns the DesignObjectBase used for material storage.
DesignObjectBaseparentBase () const
 Returns the DesignObjectBase used for parent model storage.
ColumnT< Buffer< uint04 > > & parentToChildReference () const
 Returns the column mapping parent indices to child index lists.
Protected Member Functions inherited from DesignObject
template<class t_type>
void _setProperty (NDPO property, const t_type &value)
 Low-level property setter that directly writes to the design properties table without triggering side effects such as transform or visibility updates.
void initDesignObject ()
 Initializes default property values for this design object after construction.
Protected Member Functions inherited from DesignInfo
 DesignInfo (DesignObjectBase *base)
 Creates an new design object within the given DesignObjectBase.
 DesignInfo (uint04 index, DesignObjectBase *base)
 Sets a DesignObject up to be a pointer to an existing object in the database.
void _setDesignVisible (bool is_visible)
 Sets the spatial visibility of this design object and propagates the change through the design hierarchy.
void _setTransform (const Matrix< fltp08 > &transform)
 Sets the 4x4 transform matrix for this design object and propagates the change through the design hierarchy.
Protected Attributes inherited from DesignInfo
DesignObjectBasem_base = nullptr
 Pointer to the owning DesignObjectBase property database.
uint04 m_design_index = Constant<uint04>::Invalid
 Index of the parent design that owns this object.
uint04 m_index = Constant<uint04>::Invalid
 Row index of this object within the property database.

Detailed Description

A core object representing a user view as well as convenience functions for moving this view through 3D space.


See also
Model, CameraManager, Scene, SelectionController

Definition at line 94 of file Camera.h.

Constructor & Destructor Documentation

◆ Camera() [1/2]

Camera::Camera ( const Model & camera)

Constructs a Camera from an existing Model.

Parameters
[in]cameraThe Model to interpret as a Camera.

References Model::Model().

Referenced by Camera(), and copyFrom().

◆ Camera() [2/2]

Camera::Camera ( const Camera & camera)

Copy constructor.

Parameters
[in]cameraThe Camera to copy from.

References Camera().

Member Function Documentation

◆ activeFOV()

Vector< 2, Angle< fltp08 > > Camera::activeFOV ( ) const
nodiscard

Gets the currently active field of view, accounting for projection mode.

Returns
The active horizontal and vertical field of view angles.

◆ activeOrthoSize()

Vector< 2, fltp08 > Camera::activeOrthoSize ( ) const
nodiscard

Gets the active orthographic view size in world units.

Returns
The width and height of the orthographic view.

◆ addAnimation()

void Camera::addAnimation ( CameraAnimation animation,
bool clear_current_animations = true )

Adds a camera animation to the queue.

Parameters
[in]animationThe animation to add.
[in]clear_current_animationsWhether to clear existing animations before adding.

◆ addIsOrthographicAnimation()

void Camera::addIsOrthographicAnimation ( bool is_orthographic,
const TimeSpan & time,
bool clear_animations = true )

Adds an animation that transitions between orthographic and perspective projection.

Parameters
[in]is_orthographicWhether to animate to orthographic (true) or perspective (false).
[in]timeThe duration of the animation.
[in]clear_animationsWhether to clear existing animations before adding.

References is_orthographic.

◆ addLookatAnimation()

void Camera::addLookatAnimation ( Vector< 3, fltp08 > lookat,
const TimeSpan & time,
bool clear_animations = true )

Adds an animation that transitions the camera to look at the specified direction.

Parameters
[in]lookatThe target look-at direction vector.
[in]timeThe duration of the animation.
[in]clear_animationsWhether to clear existing animations before adding.

◆ addObjectsToVisible()

void Camera::addObjectsToVisible ( const Buffer< UUID > & models,
DesignObjectLookup * lookup )

Adds multiple objects to the set of objects visible to this camera.

Parameters
[in]modelsThe UUIDs of the models to make visible.
[in]lookupThe design object lookup used to resolve the models.

◆ addObjectToVisible()

void Camera::addObjectToVisible ( const Model & model)

Adds the given model to the set of objects visible to this camera.

Parameters
[in]modelThe model to make visible.

References Model::Model().

◆ addOrbitAnimation()

void Camera::addOrbitAnimation ( Vector< 3, fltp08 > target,
Vector< 3, Angle< fltp08 > > orient,
fltp08 zoom,
bool face_target,
const TimeSpan & time,
bool clear_animations = true )

Adds an orbit animation around a target point.

Parameters
[in]targetThe point to orbit around.
[in]orientThe target orientation at the end of the orbit.
[in]zoomThe zoom level at the end of the orbit.
[in]face_targetWhether the camera should continuously face the target during orbit.
[in]timeThe duration of the orbit animation.
[in]clear_animationsWhether to clear existing animations before adding.

References target, and zoom().

◆ addZoomAnimation()

void Camera::addZoomAnimation ( fltp08 distance_mult,
const TimeSpan & time,
bool clear_animations = true )

Adds a zoom animation that scales the view over the specified time.

Parameters
[in]distance_multThe zoom multiplier to animate towards.
[in]timeThe duration of the zoom animation.
[in]clear_animationsWhether to clear existing animations before adding.

◆ addZoomMultiplierAnimation()

void Camera::addZoomMultiplierAnimation ( fltp08 multiplier,
const TimeSpan & time,
bool clear_animations = true )

Adds an animation that scales the zoom level by a multiplier over the specified time.

Parameters
[in]multiplierThe zoom multiplier to animate towards.
[in]timeThe duration of the animation.
[in]clear_animationsWhether to clear existing animations before adding.

◆ addZoomToExtentsAnimation() [1/3]

void Camera::addZoomToExtentsAnimation ( Bounds< 3, fltp08 > object,
const TimeSpan & time,
bool use_true_extents = true,
bool clear_animations = true,
Vector< 3, Angle< fltp08 > > angle_offsets = Vector< 3, Anglefltp08 > >(Anglefltp08 >(0)) )

Adds an animation that zooms to fit the given bounds using the current orientation.

Parameters
[in]objectThe 3D bounds to zoom to fit within the viewport.
[in]timeThe duration of the animation.
[in]use_true_extentsWhether to use true geometric extents or simplified bounds.
[in]clear_animationsWhether to clear existing animations before adding.
[in]angle_offsetsAdditional angular offsets applied to the final orientation.

◆ addZoomToExtentsAnimation() [2/3]

void Camera::addZoomToExtentsAnimation ( SnapLocation location,
Bounds< 3, fltp08 > object,
const TimeSpan & time,
bool use_true_extents = true,
bool clear_animations = true,
Vector< 3, Angle< fltp08 > > angle_offsets = Vector< 3, Anglefltp08 > >(Anglefltp08 >(0)) )

Adds an animation that zooms to fit the given bounds at a specific snap location.

Parameters
[in]locationThe snap location to orient the camera towards.
[in]objectThe 3D bounds to zoom to fit within the viewport.
[in]timeThe duration of the animation.
[in]use_true_extentsWhether to use true geometric extents or simplified bounds.
[in]clear_animationsWhether to clear existing animations before adding.
[in]angle_offsetsAdditional angular offsets applied to the final orientation.

◆ addZoomToExtentsAnimation() [3/3]

void Camera::addZoomToExtentsAnimation ( Vector< 3, Angle< fltp08 > > orientation,
Bounds< 3, fltp08 > object,
const TimeSpan & time,
bool use_true_extents = true,
bool clear_animations = true )

Adds an animation that zooms to fit the given bounds at a specified orientation.

Parameters
[in]orientationThe target camera orientation.
[in]objectThe 3D bounds to zoom to fit within the viewport.
[in]timeThe duration of the animation.
[in]use_true_extentsWhether to use true geometric extents or simplified bounds.
[in]clear_animationsWhether to clear existing animations before adding.

References orientation.

◆ calculatedReferenceSize()

fltp08 Camera::calculatedReferenceSize ( ) const
nodiscard

Gets the calculated reference size based on the current viewport dimensions.

Returns
The calculated reference size.

◆ calculateProjectionMatrix()

Matrix< fltp08 > Camera::calculateProjectionMatrix ( ) const
nodiscard

Calculates the projection matrix from current camera parameters.

Returns
The calculated projection matrix.

◆ cameraBackground() [1/2]

CameraBackground & Camera::cameraBackground ( )
inlinenodiscard

Gets the camera background settings (mutable).

Returns
A mutable reference to the CameraBackground.

Definition at line 601 of file Camera.h.

◆ cameraBackground() [2/2]

const CameraBackground & Camera::cameraBackground ( ) const
inlinenodiscard

Gets the camera background settings (const).

Returns
A const reference to the CameraBackground.

Definition at line 596 of file Camera.h.

◆ computedOffset()

Vertex< 3, fltp08 > Camera::computedOffset ( ) const
inlinenodiscard

Gets the computed camera offset in world space, accounting for animations.

Returns
The computed 3D offset position.

Definition at line 431 of file Camera.h.

◆ copyFrom()

void Camera::copyFrom ( const Camera & object)

Copies all camera settings from the given camera into this one.

Parameters
[in]objectThe camera to copy settings from.

References Camera().

◆ createSelectionInfo()

SelectionInfo Camera::createSelectionInfo ( ) const
nodiscard

Creates a new SelectionInfo based on the current camera state.

Returns
A freshly constructed SelectionInfo object.

◆ currentSnapLocation()

SnapLocation Camera::currentSnapLocation ( ) const
nodiscard

Gets the current snap location that the camera is aligned to.

Returns
The current snap location.

◆ farPlaneBounds()

const Bounds< 1, fltp08 > & Camera::farPlaneBounds ( ) const
inlinenodiscard

Gets the allowable range for the far clipping plane distance.

Returns
The far plane bounds.

Definition at line 523 of file Camera.h.

◆ format()

ViewportFormat Camera::format ( ) const
nodiscard

Gets the viewport format descriptor for this camera.

Returns
The current ViewportFormat.

Referenced by setupFromFormat().

◆ getFocusBounds()

Bounds< 3, fltp08 > Camera::getFocusBounds ( ) const
inlinenodiscard

Gets the current auto-zoom focus bounds.

Returns
The 3D bounds used for auto-zoom focus.

Definition at line 585 of file Camera.h.

◆ getLookat()

const Ray< 3, fltp08 > & Camera::getLookat ( ) const
nodiscard

Gets the current look-at ray describing the camera view direction and position.

Returns
A reference to the look-at ray.

◆ getOrthographicBounds()

Bounds< 3, fltp08 > Camera::getOrthographicBounds ( ) const
nodiscard

Computes the 3D axis-aligned bounds visible in orthographic mode.

Returns
The orthographic view bounds.

◆ getPerspectiveBounds()

Bounds< 2, Angle< fltp08 > > Camera::getPerspectiveBounds ( ) const
nodiscard

Computes the angular bounds visible in perspective mode.

Returns
The perspective view bounds as angular ranges.

◆ getRotateAroundPoint()

Vector< 2, Angle< fltp08 > > Camera::getRotateAroundPoint ( const Vector< 3, fltp04 > & vCenter) const
nodiscard

Computes the rotation angles needed to rotate the camera around a given center point.

Parameters
[in]vCenterThe 3D center point to rotate around.
Returns
The horizontal and vertical rotation angles.

◆ gotoLocation()

Vector< 3, fltp08 > Camera::gotoLocation ( ) const
nodiscard

Gets the target location for a pending goto animation.

Returns
The target 3D position.

◆ gotoOrientation()

Vector< 3, Angle< fltp08 > > Camera::gotoOrientation ( ) const
nodiscard

Gets the target orientation for a pending goto animation.

Returns
The target orientation as Euler angles.

◆ hasFullAutoFocus()

bool Camera::hasFullAutoFocus ( ) const
nodiscard

Checks whether the camera has full auto-focus enabled on all axes.

Returns
True if full auto-focus is active, false otherwise.

◆ hasWorldGridAlignment()

bool Camera::hasWorldGridAlignment ( ) const
nodiscard

Checks whether the camera grid is aligned with the world coordinate system.

Returns
True if the grid is world-aligned, false otherwise.

◆ heightToWidthRatio()

fltp08 Camera::heightToWidthRatio ( ) const

Computes the height-to-width ratio of the viewport.

Returns
The inverse aspect ratio (height / width).

References Model::Model(), and e_no_snap.

◆ isObjectPotentiallyVisibleToCamera()

bool Camera::isObjectPotentiallyVisibleToCamera ( const UUID & id) const
nodiscard

Checks whether the given object is potentially visible from this camera's viewpoint.

Parameters
[in]idThe UUID of the object to check.
Returns
True if the object may be visible, false if it is definitely hidden.

◆ isUserCamera()

bool Camera::isUserCamera ( ) const
nodiscard

Checks whether this camera represents a user-interactive viewport camera.

Returns
True if this is a user camera, false otherwise.

◆ look() [1/2]

void Camera::look ( fltp08 horz_percent,
fltp08 vert_percent )

Rotates the camera by normalized horizontal and vertical percentages.

Parameters
[in]horz_percentThe horizontal rotation as a fraction of the full range.
[in]vert_percentThe vertical rotation as a fraction of the full range.

◆ look() [2/2]

void Camera::look ( fltp08 horz_percent,
fltp08 vert_percent,
const CameraAnimation & original )

Rotates the camera by normalized horizontal and vertical percentages with animation parameters.

Parameters
[in]horz_percentThe horizontal rotation as a fraction of the full range.
[in]vert_percentThe vertical rotation as a fraction of the full range.
[in]originalThe animation parameters to apply to this rotation.

◆ lookHorizontal()

void Camera::lookHorizontal ( fltp08 percent)

Rotates the camera horizontally by a normalized percentage of the view.

Parameters
[in]percentThe rotation amount as a fraction of the full horizontal range.

◆ lookVertical()

void Camera::lookVertical ( fltp08 percent)

Rotates the camera vertically by a normalized percentage of the view.

Parameters
[in]percentThe rotation amount as a fraction of the full vertical range.

◆ move() [1/4]

void Camera::move ( const Ray< 3, fltp08 > & distance)

Moves the camera by a ray-defined offset and direction.

Parameters
[in]distanceThe ray describing the movement direction and magnitude.

◆ move() [2/4]

void Camera::move ( const Ray< 3, fltp08 > & distance,
const CameraAnimation & original )

Moves the camera by a ray-defined offset and direction with animation parameters.

Parameters
[in]distanceThe ray describing the movement direction and magnitude.
[in]originalThe animation parameters to apply to this movement.

◆ move() [3/4]

void Camera::move ( fltp08 horizontal_distance,
fltp08 vertical_distance )

Moves the camera by the specified horizontal and vertical distances.

Parameters
[in]horizontal_distanceThe horizontal movement distance.
[in]vertical_distanceThe vertical movement distance.

◆ move() [4/4]

void Camera::move ( fltp08 horizontal_distance,
fltp08 vertical_distance,
const CameraAnimation & original )

Moves the camera by the specified horizontal and vertical distances with animation parameters.

Parameters
[in]horizontal_distanceThe horizontal movement distance.
[in]vertical_distanceThe vertical movement distance.
[in]originalThe animation parameters to apply to this movement.

◆ moveForward()

void Camera::moveForward ( fltp08 distance)

Moves the camera forward or backward along its look direction.

Parameters
[in]distanceThe distance to move (positive = forward, negative = backward).

◆ moveHorizontal()

void Camera::moveHorizontal ( fltp08 distance)

Moves the camera horizontally (left/right) relative to its view direction.

Parameters
[in]distanceThe distance to move (positive = right, negative = left).

◆ moveHorizontalPercent()

void Camera::moveHorizontalPercent ( fltp08 percent)

Moves the camera horizontally by a normalized percentage of the viewport width.

Parameters
[in]percentThe movement amount as a fraction of the viewport width.

◆ movePercent() [1/2]

void Camera::movePercent ( fltp08 horizontal_percent,
fltp08 vertical_percent )

Moves the camera by normalized horizontal and vertical percentages of the viewport.

Parameters
[in]horizontal_percentThe horizontal movement as a fraction of the viewport width.
[in]vertical_percentThe vertical movement as a fraction of the viewport height.

◆ movePercent() [2/2]

void Camera::movePercent ( fltp08 horizontal_percent,
fltp08 vertical_percent,
const CameraAnimation & original )

Moves the camera by normalized horizontal and vertical percentages with animation parameters.

Parameters
[in]horizontal_percentThe horizontal movement as a fraction of the viewport width.
[in]vertical_percentThe vertical movement as a fraction of the viewport height.
[in]originalThe animation parameters to apply to this movement.

◆ moveVertical()

void Camera::moveVertical ( fltp08 distance)

Moves the camera vertically (up/down) relative to its view direction.

Parameters
[in]distanceThe distance to move (positive = up, negative = down).

◆ moveVerticalPercent()

void Camera::moveVerticalPercent ( fltp08 percent)

Moves the camera vertically by a normalized percentage of the viewport height.

Parameters
[in]percentThe movement amount as a fraction of the viewport height.

◆ nearPlaneBounds()

const Bounds< 1, fltp08 > & Camera::nearPlaneBounds ( ) const
inlinenodiscard

Gets the allowable range for the near clipping plane distance.

Returns
The near plane bounds.

Definition at line 518 of file Camera.h.

◆ panPercent()

void Camera::panPercent ( fltp08 horizontal_percent,
fltp08 vertical_percent,
const CameraAnimation & original )

Pans the camera by normalized percentages, keeping the target point fixed while moving the offset.

Parameters
[in]horizontal_percentThe horizontal pan amount as a fraction of the viewport width.
[in]vertical_percentThe vertical pan amount as a fraction of the viewport height.
[in]originalThe animation parameters to apply to this pan.

◆ pixelThickness()

fltp04 Camera::pixelThickness ( ) const

Gets the current pixel thickness for rendering lines and points.

Returns
The pixel thickness value.

◆ preferredSnapLocation()

SnapLocation Camera::preferredSnapLocation ( ) const
nodiscard

Gets the preferred snap location for this camera.

Returns
The preferred snap location.

◆ projectionMatrix()

Matrix< fltp08 > Camera::projectionMatrix ( ) const
nodiscard

Gets the current projection matrix, which may be custom or calculated.

Returns
The projection matrix.

◆ refreshFocusBounds()

void Camera::refreshFocusBounds ( const DesignObjectLookup * lookup,
TimeSpan animation_time )

Recomputes the auto-zoom focus bounds based on the current scene state.

Parameters
[in]lookupThe design object lookup used to calculate bounds.
[in]animation_timeDuration over which to animate to the new focus bounds.

◆ refreshMovement()

bool Camera::refreshMovement ( const Time & current_time,
const DesignObjectLookup * lookup = nullptr,
const TimeSpan & time_out = TimeSpan(0.2) )

Advances any active camera animations and updates the camera position and orientation.

Parameters
[in]current_timeThe current time used to evaluate animation progress.
[in]lookupOptional design object lookup used to resolve animation targets.
[in]time_outMaximum time span allowed for the refresh operation.
Returns
True if the camera state changed during the refresh, false otherwise.

◆ setAutoZoomFocus()

void Camera::setAutoZoomFocus ( AutoZoomFocus focus)

Sets the auto-zoom focus configuration for this camera.

Parameters
[in]focusThe auto-zoom focus settings to apply.

◆ setFarPlaneBounds()

void Camera::setFarPlaneBounds ( const Bounds< 1, fltp08 > & near_plane_bounds)
inline

Sets the allowable range for the far clipping plane distance.

Parameters
[in]near_plane_boundsThe min/max bounds for the far plane.

Definition at line 513 of file Camera.h.

◆ setFocusBounds()

void Camera::setFocusBounds ( const Bounds< 3, fltp08 > & bounds)
inline

Sets the auto-zoom focus bounds directly.

Parameters
[in]boundsThe 3D bounds to use for auto-zoom focus.

Definition at line 590 of file Camera.h.

◆ setNearPlaneBounds()

void Camera::setNearPlaneBounds ( const Bounds< 1, fltp08 > & near_plane_bounds)
inline

Sets the allowable range for the near clipping plane distance.

Parameters
[in]near_plane_boundsThe min/max bounds for the near plane.

Definition at line 508 of file Camera.h.

◆ setProjectionTransform()

void Camera::setProjectionTransform ( const Matrix< fltp08 > & transform)

Sets a custom projection transform matrix, overriding the computed one.

Parameters
[in]transformThe custom projection matrix to use.

◆ setReferenceSize()

void Camera::setReferenceSize ( fltp08 size)

Sets the reference size used for scaling calculations.

Parameters
[in]sizeThe reference size value.

References Model::size().

◆ setupFromFormat()

void Camera::setupFromFormat ( const ViewportFormat & format)

Configures this camera from the given viewport format settings.

Parameters
[in]formatThe viewport format to apply.

References format().

◆ setUseReferenceSize()

void Camera::setUseReferenceSize ( bool use_reference_size)

Sets whether the camera should use a reference size for scaling calculations.

Parameters
[in]use_reference_sizeTrue to use reference size, false to use actual window size.

◆ setWindowSize()

void Camera::setWindowSize ( const Vector< 2, uint04 > & size)

Sets the window size for this camera viewport.

Parameters
[in]sizeThe new window size in pixels (width, height).

References Model::size().

◆ toScreenSpace()

Vertex< 2, fltp08 > Camera::toScreenSpace ( const Vector< 2, fltp04 > & pixel_location) const
nodiscard

Converts a pixel location to normalized screen space in the range -1.0 to 1.0.

Parameters
[in]pixel_locationThe pixel coordinates to convert.
Returns
The corresponding screen-space coordinates.

◆ toWorldSpaceFromPixelSpace()

Vertex< 3, fltp08 > Camera::toWorldSpaceFromPixelSpace ( const Vector< 2, fltp04 > & pixel_location,
fltp08 depth_percent ) const
nodiscard

Converts a pixel-space location and depth to a 3D world-space position.

Parameters
[in]pixel_locationThe 2D pixel coordinates.
[in]depth_percentThe normalized depth value (0.0 = near plane, 1.0 = far plane).
Returns
The corresponding 3D world-space position.

◆ toWorldSpaceFromViewSpace()

Vertex< 3, fltp08 > Camera::toWorldSpaceFromViewSpace ( const Vector< 2, fltp08 > & view_location,
fltp08 depth_percent ) const
nodiscard

Converts a view-space location and depth to a 3D world-space position.

Parameters
[in]view_locationThe 2D view-space coordinates (normalized -1.0 to 1.0).
[in]depth_percentThe normalized depth value (0.0 = near plane, 1.0 = far plane).
Returns
The corresponding 3D world-space position.

◆ TypeName()

constexpr StringView Camera::TypeName ( )
inlinestaticconstexpr

Gets the type name identifier for Camera objects.

Returns
The string "camera".

Definition at line 606 of file Camera.h.

◆ updateSelectionInfo() [1/3]

void Camera::updateSelectionInfo ( const Bounds< 2, fltp04 > & pixel_location,
SelectionInfo & info ) const

Updates the given SelectionInfo with a rectangle-based selection at the specified pixel bounds.

Parameters
[in]pixel_locationThe pixel bounds of the selection rectangle.
[in]infoThe SelectionInfo to update.

◆ updateSelectionInfo() [2/3]

void Camera::updateSelectionInfo ( const Polygon< fltp04 > & pixel_location,
SelectionInfo & info ) const

Updates the given SelectionInfo with a polygon-based selection at the specified pixel polygon.

Parameters
[in]pixel_locationThe pixel-space polygon defining the selection area.
[in]infoThe SelectionInfo to update.

◆ updateSelectionInfo() [3/3]

void Camera::updateSelectionInfo ( const Vector< 2, fltp04 > & pixel_location,
SelectionInfo & info ) const

Updates the given SelectionInfo with a point-based selection at the specified pixel location.

Parameters
[in]pixel_locationThe pixel coordinates of the selection point.
[in]infoThe SelectionInfo to update.

◆ viewMatrix()

Matrix< fltp08 > Camera::viewMatrix ( ) const
nodiscard

Gets the view matrix (camera transformation matrix).

Returns
The view matrix.

◆ viewToWorldSpace()

Matrix< fltp08 > Camera::viewToWorldSpace ( ) const
nodiscard

Computes the transformation matrix from view space to world space.

Returns
The view-to-world transformation matrix.

◆ widthToHeightRatio()

fltp08 Camera::widthToHeightRatio ( ) const

Computes the width-to-height ratio of the viewport.

Returns
The aspect ratio (width / height).

◆ windowSize()

Vector< 2, uint04 > Camera::windowSize ( ) const
nodiscard

Gets the current window size in pixels.

Returns
The window width and height.

◆ worldToViewSpace()

Matrix< fltp08 > Camera::worldToViewSpace ( ) const
nodiscard

Computes the transformation matrix from world space to view space.

Returns
The world-to-view transformation matrix.

◆ zoom()

void Camera::zoom ( fltp08 distance_mult,
const CameraAnimation & original )

Zooms the camera by a distance multiplier with animation parameters.

Parameters
[in]distance_multThe zoom multiplier (values > 1 zoom out, < 1 zoom in).
[in]originalThe animation parameters to apply to this zoom.

Referenced by addOrbitAnimation().


The documentation for this class was generated from the following file: