AnyCAD Rapid API 2023
Help you to create a better world!
Camera Class Reference

Public Member Functions

 Camera (long width, long height, Vector3 position, Vector3 target, Vector3 up)
 
Camera Clone ()
 
Vector3 GetPosition ()
 
void SetPosition (Vector3 val)
 
Vector3 GetUp ()
 
void SetUp (Vector3 val)
 
Vector3 GetTarget ()
 
void SetTarget (Vector3 val)
 
Matrix4 GetViewMatrix ()
 
float GetNear ()
 
void SetNear (float val)
 
float GetFar ()
 
void SetFar (float val)
 
float GetFovy ()
 
void SetFovy (float val)
 
ViewPosition GetOrigin ()
 
void SetOrigin (ViewPosition val)
 
ViewPosition GetSize ()
 
void SetSize (ViewPosition val)
 
long GetWidth ()
 
void SetWidth (long val)
 
long GetHeight ()
 
void SetHeight (long val)
 
float GetOrthoZoomFactor ()
 
void SetOrthoZoomFactor (float val)
 
EnumProjectionType GetProjectionType ()
 
void SetProjectionType (EnumProjectionType val)
 
Matrix4 GetProjectionMatrix ()
 
boolean GetLockNearFar ()
 
void SetLockNearFar (boolean val)
 
Vector3 GetDirection ()
 
Vector3 GetRight ()
 
void UpdateNearFar (AxisAlignedBox sceneBox)
 
void GetNearFarHalfSize (Vector2 nearSize, Vector2 farSize)
 
float GetDistance ()
 
void LookAt (Vector3 position, Vector3 target, Vector3 up)
 
void LookByDirection (Vector3 target, Vector3 dir, Vector3 up)
 
void UpdateViewMatrix ()
 
void UpdateProjectionMatrix ()
 
Vector2 GetViewportSize ()
 
Vector2 GetViewportOrigin ()
 
Vector4 GetViewport ()
 
Vector2 GetViewportCenter ()
 
void Resize (long width, long height)
 
void Zoom (float ratio, float distance)
 
Matrix4 ComputeOrthoMatrix (float zoomFactor)
 
void Dump ()
 
boolean Contain (long winX, long winY)
 

Static Public Member Functions

static Camera CreateOrthographic (long width, long height, float zoom, float zNear, float zFar)
 

Detailed Description

<>
viewport:

  1. Orgion [left, bottom]
    h
    ^------—
    | |
    | |
    O------—> w
    Origon and Size can be Absolute or Relative mode.
    See also
    EnumPositionType2. Camera can be shared among viewports.

Member Function Documentation

◆ Contain()

boolean Camera.Contain ( long  winX,
long  winY 
)

Test if window point is in camera

Parameters
winXthe x value
winYthe y value
Returns
true if in camera.

◆ GetViewportOrigin()

Vector2 Camera.GetViewportOrigin ( )

Get the origin point on screen.

Returns
the origin.

◆ GetViewportSize()

Vector2 Camera.GetViewportSize ( )

Get the size on screen.

Returns
the width and heigth.

◆ Zoom()

void Camera.Zoom ( float  ratio,
float  distance 
)

Zoom by ratio

Parameters
ratio(0, 2)