Uranium
Application Framework
UM.Scene.Camera.Camera Class Reference

A SceneNode subclass that provides a camera object. More...

Inheritance diagram for UM.Scene.Camera.Camera:
UM.Scene.SceneNode.SceneNode

Public Member Functions

None __init__ (self, str name="", SceneNode.SceneNode parent=None)
 
"Camera" __deepcopy__ (self, Dict[int, object] memo)
 
None setMeshData (self, Optional["MeshData"] mesh_data)
 
bool getAutoAdjustViewPort (self)
 
None setAutoAdjustViewPort (self, bool auto_adjust)
 
Matrix getProjectionMatrix (self)
 Get the projection matrix of this camera. More...
 
int getViewportWidth (self)
 
None setViewportWidth (self, int width)
 
None setViewPortHeight (self, int height)
 
None setViewportSize (self, int width, int height)
 
int getViewportHeight (self)
 
None setWindowSize (self, int width, int height)
 
Tuple[int, int] getWindowSize (self)
 
None setProjectionMatrix (self, Matrix matrix)
 Set the projection matrix of this camera. More...
 
bool isPerspective (self)
 
None setPerspective (self, bool perspective)
 
Ray getRay (self, float x, float y)
 Get a ray from the camera into the world. More...
 
Tuple[float, float] project (self, Vector position)
 Project a 3D position onto the 2D view plane. More...
 
- Public Member Functions inherited from UM.Scene.SceneNode.SceneNode
None __init__ (self, Optional["SceneNode"] parent=None, bool visible=True, str name="")
 Construct a scene node. More...
 
None setCenterPosition (self, Vector center)
 Set the center position of this node. More...
 
Optional["SceneNode"] getParent (self)
 Get the parent of this node. More...
 
Vector getMirror (self)
 
None setMirror (self, vector)
 
Optional[MeshDatagetBoundingBoxMesh (self)
 Get the MeshData of the bounding box. More...
 
None calculateBoundingBoxMesh (self)
 (re)Calculate the bounding box mesh. More...
 
None addDecorator (self, SceneNodeDecorator decorator)
 Add a SceneNodeDecorator to this SceneNode. More...
 
List[SceneNodeDecoratorgetDecorators (self)
 Get all SceneNodeDecorators that decorate this SceneNode. More...
 
Optional[SceneNodeDecoratorgetDecorator (self, type dec_type)
 Get SceneNodeDecorators by type. More...
 
def removeDecorators (self)
 Remove all decorators.
 
None removeDecorator (self, type dec_type)
 Remove decorator by type. More...
 
Any callDecoration (self, str function, *args, **kwargs)
 Call a decoration of this SceneNode. More...
 
bool hasDecoration (self, str function)
 Does this SceneNode have a certain Decoration (as defined by a Decorator) More...
 
str getName (self)
 
None setName (self, str name)
 
int getDepth (self)
 How many nodes is this node removed from the root? More...
 
None setParent (self, Optional["SceneNode"] scene_node)
 Set the parent of this object. More...
 
bool isVisible (self)
 Get the visibility of this node. More...
 
None setVisible (self, bool visible)
 Set the visibility of this SceneNode. More...
 
Optional[MeshDatagetMeshData (self)
 Get the (original) mesh data from the scene node/object. More...
 
Optional[MeshDatagetMeshDataTransformed (self)
 Get the transformed mesh data from the scene node/object, based on the transformation of scene nodes wrt root. More...
 
numpy.ndarray getMeshDataTransformedVertices (self)
 Get the transformed vertices from this scene node/object, based on the transformation of scene nodes wrt root. More...
 
numpy.ndarray getMeshDataTransformedNormals (self)
 Get the transformed normals from this scene node/object, based on the transformation of scene nodes wrt root. More...
 
None setMeshData (self, Optional[MeshData] mesh_data)
 Set the mesh of this node/object. More...
 
None addChild (self, "SceneNode" scene_node)
 Add a child to this node and set it's parent as this node. More...
 
None removeChild (self, "SceneNode" child)
 remove a single child More...
 
None removeAllChildren (self)
 Removes all children and its children's children. More...
 
List["SceneNode"] getChildren (self)
 Get the list of direct children. More...
 
bool hasChildren (self)
 
List["SceneNode"] getAllChildren (self)
 Get list of all children (including it's children children children etc.) More...
 
Matrix getWorldTransformation (self)
 Computes and returns the transformation from world to local space. More...
 
Matrix getLocalTransformation (self)
 Returns the local transformation with respect to its parent. More...
 
def setTransformation (self, Matrix transformation)
 
Quaternion getOrientation (self)
 Get the local orientation value. More...
 
Quaternion getWorldOrientation (self)
 
None rotate (self, Quaternion rotation, int transform_space=TransformSpace.Local)
 Rotate the scene object (and thus its children) by given amount. More...
 
None setOrientation (self, Quaternion orientation, int transform_space=TransformSpace.Local)
 Set the local orientation of this scene node. More...
 
Vector getScale (self)
 Get the local scaling value. More...
 
Vector getWorldScale (self)
 
None scale (self, Vector scale, int transform_space=TransformSpace.Local)
 Scale the scene object (and thus its children) by given amount. More...
 
None setScale (self, Vector scale, int transform_space=TransformSpace.Local)
 Set the local scale value. More...
 
Vector getPosition (self)
 Get the local position. More...
 
Vector getWorldPosition (self)
 Get the position of this scene node relative to the world. More...
 
None translate (self, Vector translation, int transform_space=TransformSpace.Local)
 Translate the scene object (and thus its children) by given amount. More...
 
None setPosition (self, Vector position, int transform_space=TransformSpace.Local)
 Set the local position value. More...
 
None lookAt (self, Vector target, Vector up=Vector.Unit_Y)
 Rotate this scene node in such a way that it is looking at target. More...
 
bool render (self, renderer)
 Can be overridden by child nodes if they need to perform special rendering. More...
 
bool isEnabled (self)
 Get whether this SceneNode is enabled, that is, it can be modified in any way. More...
 
None setEnabled (self, bool enable)
 Set whether this SceneNode is enabled. More...
 
bool isSelectable (self)
 Get whether this SceneNode can be selected. More...
 
None setSelectable (self, bool select)
 Set whether this SceneNode can be selected. More...
 
Optional[AxisAlignedBoxgetBoundingBox (self)
 Get the bounding box of this node and its children. More...
 
None setCalculateBoundingBox (self, bool calculate)
 Set whether or not to calculate the bounding box for this node. More...
 
Vector getShear (self)
 
str getSetting (self, str key, str default_value="")
 
None setSetting (self, str key, str value)
 
str __str__ (self)
 String output for debugging. More...
 

Additional Inherited Members

- Static Public Attributes inherited from UM.Scene.SceneNode.SceneNode
 decoratorsChanged = Signal()
 Signal for when a SceneNodeDecorator is added / removed. More...
 
 parentChanged = Signal()
 Emitted whenever the parent changes. More...
 
 meshDataChanged = Signal()
 Emitted whenever the attached mesh data object changes. More...
 
 childrenChanged = Signal()
 Emitted whenever the list of children of this object or any child object changes. More...
 
 transformationChanged = Signal()
 Signal. More...
 
 boundingBoxChanged = Signal()
 

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.

Member Function Documentation

◆ 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.

Parameters
xThe X coordinate on the near plane this ray should pass through.
yThe Y coordinate on the near plane this ray should pass through.
Returns
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.

◆ setProjectionMatrix()

None UM.Scene.Camera.Camera.setProjectionMatrix (   self,
Matrix  matrix 
)

Set the projection matrix of this camera.

Parameters
matrixThe projection matrix to use for this camera.

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