- clearCurrent
void clearCurrent(bool enable_next)
If this is the current Camera, remove it from being current. If enable_next is true, request to make the next Camera current, if any.
- getCameraTransform
Transform getCameraTransform()
Gets the camera transform. Subclassed cameras (such as CharacterCamera) may provide different transforms than the Node transform.
- getCullMask
long getCullMask()
- getCullMaskBit
bool getCullMaskBit(long layer)
- getDopplerTracking
Camera.DopplerTracking getDopplerTracking()
- getEnvironment
Ref!Environment getEnvironment()
- getFov
double getFov()
- getHOffset
double getHOffset()
- getKeepAspectMode
Camera.KeepAspect getKeepAspectMode()
- getProjection
Camera.Projection getProjection()
- getSize
double getSize()
- getVOffset
double getVOffset()
- getZfar
double getZfar()
- getZnear
double getZnear()
- isCurrent
bool isCurrent()
- isPositionBehind
bool isPositionBehind(Vector3 world_point)
Returns true if the given position is behind the Camera. Note that a position which returns false may still be outside the Camera's field of view.
- makeCurrent
void makeCurrent()
Makes this camera the current Camera for the Viewport (see class description). If the Camera Node is outside the scene tree, it will attempt to become current once it's added.
- opAssign
Camera opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
- opEquals
bool opEquals(Camera other)
Undocumented in source. Be warned that the author may not have intended to support it.
- opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
- projectLocalRayNormal
Vector3 projectLocalRayNormal(Vector2 screen_point)
Returns a normal vector from the screen point location directed along the camera. Orthogonal cameras are normalized. Perspective cameras account for perspective, screen width/height, etc.
- projectPosition
Vector3 projectPosition(Vector2 screen_point)
Returns the 3D point in worldspace that maps to the given 2D coordinate in the Viewport rectangle.
- projectRayNormal
Vector3 projectRayNormal(Vector2 screen_point)
Returns a normal vector in worldspace, that is the result of projecting a point on the Viewport rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking.
- projectRayOrigin
Vector3 projectRayOrigin(Vector2 screen_point)
Returns a 3D position in worldspace, that is the result of projecting a point on the Viewport rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking.
- setCullMask
void setCullMask(long mask)
- setCullMaskBit
void setCullMaskBit(long layer, bool enable)
- setCurrent
void setCurrent(bool arg0)
- setDopplerTracking
void setDopplerTracking(long mode)
- setEnvironment
void setEnvironment(Environment env)
- setFov
void setFov(double arg0)
- setHOffset
void setHOffset(double ofs)
- setKeepAspectMode
void setKeepAspectMode(long mode)
- setOrthogonal
void setOrthogonal(double size, double z_near, double z_far)
Sets the camera projection to orthogonal mode, by specifying a width and the near and far clip planes in worldspace units. (As a hint, 2D games often use this projection, with values specified in pixels)
- setPerspective
void setPerspective(double fov, double z_near, double z_far)
Sets the camera projection to perspective mode, by specifying a FOV Y angle in degrees (FOV means Field of View), and the near and far clip planes in worldspace units.
- setProjection
void setProjection(long arg0)
- setSize
void setSize(double arg0)
- setVOffset
void setVOffset(double ofs)
- setZfar
void setZfar(double arg0)
- setZnear
void setZnear(double arg0)
- unprojectPosition
Vector2 unprojectPosition(Vector3 world_point)
Returns the 2D coordinate in the Viewport rectangle that maps to the given 3D point in worldspace.
- cullMask
long cullMask [@property getter]
long cullMask [@property setter]
The culling mask that describes which 3D render layers are rendered by this camera.
- current
bool current [@property getter]
bool current [@property setter]
If true the ancestor Viewport is currently using this Camera. Default value: false.
- dopplerTracking
Camera.DopplerTracking dopplerTracking [@property getter]
long dopplerTracking [@property setter]
If not DOPPLER_TRACKING_DISABLED this Camera will simulate the Doppler effect for objects changed in particular _process methods. Default value: DOPPLER_TRACKING_DISABLED.
- environment
Environment environment [@property getter]
Environment environment [@property setter]
- far
double far [@property getter]
double far [@property setter]
The distance to the far culling boundary for this Camera relative to its local z-axis.
- fov
double fov [@property getter]
double fov [@property setter]
The camera's field of view angle (in degrees). Only applicable in perspective mode. Since keepAspect locks one axis, fov sets the other axis' field of view angle.
- hOffset
double hOffset [@property getter]
double hOffset [@property setter]
The horizontal (X) offset of the Camera viewport.
- keepAspect
Camera.KeepAspect keepAspect [@property getter]
long keepAspect [@property setter]
The axis to lock during fov/size adjustments. Can be either KEEP_WIDTH or KEEP_HEIGHT.
- near
double near [@property getter]
double near [@property setter]
The distance to the near culling boundary for this Camera relative to its local z-axis.
- projection
Camera.Projection projection [@property getter]
long projection [@property setter]
The camera's projection mode. In PROJECTION_PERSPECTIVE mode, objects' z-distance from the camera's local space scales their perceived size.
- size
double size [@property getter]
double size [@property setter]
The camera's size measured as 1/2 the width or height. Only applicable in orthogonal mode. Since keepAspect locks on axis, size sets the other axis' size length.
- vOffset
double vOffset [@property getter]
double vOffset [@property setter]
The vertical (Y) offset of the Camera viewport.
Camera node, displays from a point of view.
Camera is a special node that displays what is visible from its current location. Cameras register themselves in the nearest Viewport node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the Camera will register in the global viewport. In other words, a Camera just provides 3D display capabilities to a Viewport, and, without one, a scene registered in that Viewport (or higher viewports) can't be displayed.