Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Scene.Camera.Camera Class Reference
Inheritance diagram for UM.Scene.Camera.Camera:
UM.Scene.SceneNode.SceneNode

Public Member Functions

None __init__ (self, str name="", Optional[SceneNode.SceneNode] parent=None)
 
"Camera" __deepcopy__ (self, Dict[int, object] memo)
 
 getZoomFactor (self)
 
None setZoomFactor (self, float zoom_factor)
 
None setMeshData (self, Optional["MeshData"] mesh_data)
 
bool getAutoAdjustViewPort (self)
 
None setAutoAdjustViewPort (self, bool auto_adjust)
 
Matrix getProjectionMatrix (self)
 
int getViewportWidth (self)
 
None setViewportWidth (self, int width)
 
None setViewportHeight (self, int height)
 
None setViewportSize (self, int width, int height)
 
Matrix getViewProjectionMatrix (self)
 
int getViewportHeight (self)
 
None setWindowSize (self, int width, int height)
 
Tuple[int, int] getWindowSize (self)
 
bool render (self, renderer)
 
None setProjectionMatrix (self, Matrix matrix)
 
 getInverseWorldTransformation (self)
 
 getCameraLightPosition (self)
 
bool isPerspective (self)
 
None setPerspective (self, bool perspective)
 
Ray getRay (self, float x, float y)
 
Tuple[float, float] project (self, Vector position)
 
- Public Member Functions inherited from UM.Scene.SceneNode.SceneNode
None setCenterPosition (self, Vector center)
 
Optional["SceneNode"] getParent (self)
 
Vector getMirror (self)
 
None setMirror (self, vector)
 
Optional[MeshDatagetBoundingBoxMesh (self)
 
None calculateBoundingBoxMesh (self)
 
bool collidesWithBbox (self, AxisAlignedBox check_bbox)
 
None addDecorator (self, SceneNodeDecorator decorator)
 
List[SceneNodeDecoratorgetDecorators (self)
 
Optional[SceneNodeDecoratorgetDecorator (self, type dec_type)
 
 removeDecorators (self)
 
None removeDecorator (self, type dec_type)
 
Any callDecoration (self, str function, *args, **kwargs)
 
bool hasDecoration (self, str function)
 
str getName (self)
 
None setName (self, str name)
 
str getId (self)
 
None setId (self, str node_id)
 
int getDepth (self)
 
None setParent (self, Optional["SceneNode"] scene_node)
 
bool isVisible (self)
 
None setVisible (self, bool visible)
 
Optional[MeshDatagetMeshData (self)
 
Optional[MeshDatagetMeshDataTransformed (self)
 
Optional[numpy.ndarray] getMeshDataTransformedVertices (self)
 
Optional[numpy.ndarray] getMeshDataTransformedNormals (self)
 
None addChild (self, "SceneNode" scene_node)
 
None removeChild (self, "SceneNode" child)
 
None removeAllChildren (self)
 
List["SceneNode"] getChildren (self)
 
bool hasChildren (self)
 
List["SceneNode"] getAllChildren (self)
 
Matrix getCachedNormalMatrix (self)
 
Matrix getWorldTransformation (self, copy=True)
 
Matrix getLocalTransformation (self, copy=True)
 
 setTransformation (self, Matrix transformation)
 
Quaternion getOrientation (self)
 
Quaternion getWorldOrientation (self)
 
None rotate (self, Quaternion rotation, int transform_space=TransformSpace.Local)
 
None setOrientation (self, Quaternion orientation, int transform_space=TransformSpace.Local)
 
Vector getScale (self)
 
Vector getWorldScale (self)
 
None scale (self, Vector scale, int transform_space=TransformSpace.Local)
 
None setScale (self, Vector scale, int transform_space=TransformSpace.Local)
 
Vector getPosition (self)
 
Vector getWorldPosition (self)
 
None translate (self, Vector translation, int transform_space=TransformSpace.Local)
 
None setPosition (self, Vector position, int transform_space=TransformSpace.Local)
 
None lookAt (self, Vector target, Vector up=Vector.Unit_Y)
 
bool isEnabled (self)
 
None setEnabled (self, bool enable)
 
bool isSelectable (self)
 
None setSelectable (self, bool select)
 
Optional[AxisAlignedBoxgetBoundingBox (self)
 
None setCalculateBoundingBox (self, bool calculate)
 
Vector getShear (self)
 
Any getSetting (self, str key, Any default_value=None)
 
None setSetting (self, str key, Any value)
 
None invertNormals (self)
 
str __str__ (self)
 

Static Public Member Functions

float getDefaultZoomFactor ()
 

Static Public Attributes

 perspectiveChanged = Signal()
 
- Static Public Attributes inherited from UM.Scene.SceneNode.SceneNode
 decoratorsChanged = Signal()
 
 parentChanged = Signal()
 
 meshDataChanged = Signal()
 
 childrenChanged = Signal()
 
 transformationChanged = Signal()
 
 boundingBoxChanged = Signal()
 

Protected Member Functions

None _updatePerspectiveMatrix (self)
 
None _updateWorldTransformation (self)
 
None _preferencesChanged (self, str key)
 
- Protected Member Functions inherited from UM.Scene.SceneNode.SceneNode
None _onParentChanged (self, Optional["SceneNode"] node)
 
None _onMeshDataChanged (self)
 
None _updateCachedNormalMatrix (self)
 
None _transformChanged (self)
 
None _updateLocalTransformation (self)
 
None _updateTransformation (self)
 
None _resetAABB (self)
 
None _calculateAABB (self)
 

Protected Attributes

 _name
 
 _projection_matrix
 
 _perspective
 
 _viewport_width
 
 _viewport_height
 
 _window_width
 
 _window_height
 
 _auto_adjust_view_port_size
 
 _cached_view_projection_matrix
 
 _camera_light_position
 
 _cached_inversed_world_transformation
 
 _zoom_factor
 
 _preferencesChanged
 
- Protected Attributes inherited from UM.Scene.SceneNode.SceneNode
 _children
 
 _mesh_data
 
 _transformation
 
 _position
 
 _scale
 
 _shear
 
 _mirror
 
 _orientation
 
 _world_transformation
 
 _cached_normal_matrix
 
 _derived_position
 
 _derived_orientation
 
 _derived_scale
 
 _parent
 
 _enabled
 
 _selectable
 
 _calculate_aabb
 
 _aabb
 
 _bounding_box_mesh
 
 _visible
 
 _name
 
 _id
 
 _decorators
 
 _settings
 
 _onParentChanged
 Signals.
 

Additional Inherited Members

- Public Attributes inherited from UM.Scene.SceneNode.SceneNode
 metadata
 
 source_mime_type
 

Detailed Description

A SceneNode subclass that provides a camera object.

The camera provides a projection matrix and its transformation matrix
can be used as view matrix.

Constructor & Destructor Documentation

◆ __init__()

None UM.Scene.Camera.Camera.__init__ ( self,
str parent = "",
Optional[SceneNode.SceneNode] visible = None )
Construct a scene node.

:param parent: The parent of this node (if any). Only a root node should have None as a parent.
:param visible: Is the SceneNode (and thus, all its children) visible?
:param name: Name of the SceneNode.

Reimplemented from UM.Scene.SceneNode.SceneNode.

Member Function Documentation

◆ __deepcopy__()

"Camera" UM.Scene.Camera.Camera.__deepcopy__ ( self,
Dict[int, object] memo )

Reimplemented from UM.Scene.SceneNode.SceneNode.

◆ _preferencesChanged()

None UM.Scene.Camera.Camera._preferencesChanged ( self,
str key )
protected
Updates the _perspective field if the preference was modified.

◆ _updateWorldTransformation()

None UM.Scene.Camera.Camera._updateWorldTransformation ( self)
protected

Reimplemented from UM.Scene.SceneNode.SceneNode.

◆ getProjectionMatrix()

Matrix UM.Scene.Camera.Camera.getProjectionMatrix ( self)
Get the projection matrix of this camera.

◆ getRay()

Ray UM.Scene.Camera.Camera.getRay ( self,
float x,
float y )
Get a ray from the camera into the world.

This will create a ray from the camera's origin, passing through (x, y)
on the near plane and continuing based on the projection matrix.

:param x: The X coordinate on the near plane this ray should pass through.
:param y: The Y coordinate on the near plane this ray should pass through.

:return: A Ray object representing a ray from the camera origin through X, Y.

:note The near-plane coordinates should be in normalized form, that is within (-1, 1).

◆ project()

Tuple[float, float] UM.Scene.Camera.Camera.project ( self,
Vector position )
Project a 3D position onto the 2D view plane.

◆ render()

bool UM.Scene.Camera.Camera.render ( self,
renderer )
Can be overridden by child nodes if they need to perform special rendering.
If you need to handle rendering in a special way, for example for tool handles,
you can override this method and render the node. Return True to prevent the
view from rendering any attached mesh data.

:param renderer: The renderer object to use for rendering.

:return: False if the view should render this node, True if we handle our own rendering.

Reimplemented from UM.Scene.SceneNode.SceneNode.

◆ setMeshData()

None UM.Scene.Camera.Camera.setMeshData ( self,
Optional["MeshData"] mesh_data )
Set the mesh of this node/object

:param mesh_data: MeshData object

Reimplemented from UM.Scene.SceneNode.SceneNode.

◆ setProjectionMatrix()

None UM.Scene.Camera.Camera.setProjectionMatrix ( self,
Matrix matrix )
Set the projection matrix of this camera.
:param matrix: The projection matrix to use for this camera.

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