3DRadSpace  v1.0.0a
Scripting documentation
_3DRadSpaceDll.Camera Class Reference

3D Camera class. Allows drawing three dimensinal scenes. More...

Inheritance diagram for _3DRadSpaceDll.Camera:
_3DRadSpaceDll.GameObject _3DRadSpaceDll.FPVCamera

Public Member Functions

 Camera (string name, bool Enabled, Vector3 Pos, Vector3 Rot, Vector3 Targ, Vector3 UpDir, float FOV, float nearplane, float farplane)
 Camera object constructor. More...
 
 Camera (string name, bool Enabled, Vector3 Pos, Vector3 Rot, Vector3 UpDir, float FOV, float nearplane, float farplane)
 Creates a Camera object with the specified arguments. More...
 
 Camera (string name, Vector3 Pos, Vector3 Target, float FOV, float nearplane, float farplane)
 Camera constructor used in the editor. More...
 
 Camera ()
 Empty constructor. Values are mostly default. More...
 
override void Load (ContentManager content)
 Loads the object. In this cases, initializes the DeltaPos used when the camera is 'chasing' an object. More...
 
override void EditorDraw (SpriteBatch spriteBatch, Matrix? view, Matrix? projection)
 Drawing code for the editor. More...
 
void SetFOVDegrees (float deg)
 Sets the FOV with a degree value More...
 
float GetFOVDegrees ()
 Converts FOV to degrees. More...
 
override void Update (MouseState mouse, KeyboardState keyboard, GameTime time)
 Updates the Camera object. In this case, the Camera object is affected by it's 'relationship(s)'. More...
 
void Draw (SpriteBatch spriteBatch, out Matrix view, out Matrix projection)
 Camera drawing for game code. This method doesn't override the GameObject's Draw function. :thinking: More...
 
- Public Member Functions inherited from _3DRadSpaceDll.GameObject
 GameObject ()
 Default constructor. More...
 
void Enable ()
 Enables object. More...
 
void Disable ()
 Disables object. More...
 
void Toggle ()
 Switches object on/off state. More...
 
void Show ()
 Shows the object. More...
 
void Hide ()
 Hides the object. More...
 
virtual void Draw (SpriteBatch spriteBatch, Matrix? view, Matrix? projection)
 Unloads the resource. More...
 
virtual void Trigger ()
 This is specific to objects like ExitFade, NetServer,etc More...
 
override bool Equals (object obj)
 Determines whether the specified object is equal to the current object. More...
 
override int GetHashCode ()
 Returns the hash code calculated from a string representing the data inside the object. More...
 
override string ToString ()
 Returns the object's name More...
 
void RunOnce ()
 Runs the object one Update loop. If used on a active object it will be stopped. More...
 

Properties

static Model model [get, set]
 Expected to be loaded by the game editor. Not used in 3DRadSpacePlayer. More...
 
Vector3 CameraTarget [get, set]
 Look at point. More...
 
Vector3 CameraRotation [get, set]
 Camera Rotation. This is a normalized 3D Vector (with the lenght equal or lower(?) to 1) More...
 
float FOV [get, set]
 Fielf of view (Measured in radians). More...
 
static Vector2 ScreenSize [get, set]
 Screen size. Used to calculate the projection's aspect ratio. More...
 
float MinDrawDist [get, set]
 Minimum drawing distance. A recommended value is 0.1f. More...
 
float MaxDrawDist [get, set]
 Maximum drawing distance. More...
 
- Properties inherited from _3DRadSpaceDll.GameObject
string Name [get, set]
 Object Name. Used as a string identifier. More...
 
object Tag [get, set]
 Tag object. More...
 
bool Enabled [get, set]
 Checks if object is enabled. More...
 
bool Hidden [get, set]
 Checks if object is being drawn. More...
 
List< ObjectBehiavourBehiavours [get, set]
 Relation with other objects More...
 
Quaternion RotationQuaternion [get]
 Rotation in a Quaterion system. More...
 
string Resource [get, set]
 Resource file More...
 

Additional Inherited Members

- Static Public Member Functions inherited from _3DRadSpaceDll.GameObject
static implicit operator bool (GameObject o)
 Checks if the object exists. Same as GameObject != null. More...
 
static bool operator== (GameObject a, GameObject b)
 Checks if two GameObjects are equal. More...
 
static bool operator!= (GameObject a, GameObject b)
 The opposite of the equality operator. More...
 
- Public Attributes inherited from _3DRadSpaceDll.GameObject
Vector3 Position
 Object position More...
 
Vector3 Rotation
 Rotation in a Euler angles system. More...
 
List< int > SelectedObjects
 Used for editor. More...
 
- Events inherited from _3DRadSpaceDll.GameObject
onDraw OnDraw
 Called when object is being drawn on frame. More...
 
onUpdate OnUpdate
 Called when object is being updated on the update logic loop. More...
 
onObjectDestroy OnRemoval
 Called when object is being deleted. More...
 
onObjectLoad OnObjectLoad
 Called when a object resource is being loaded. More...
 

Detailed Description

3D Camera class. Allows drawing three dimensinal scenes.

Constructor & Destructor Documentation

◆ Camera() [1/4]

_3DRadSpaceDll.Camera.Camera ( string  name,
bool  Enabled,
Vector3  Pos,
Vector3  Rot,
Vector3  Targ,
Vector3  UpDir,
float  FOV,
float  nearplane,
float  farplane 
)

Camera object constructor.

Parameters
nameObject name.
EnabledIf camera is enabled.
PosCamera position.
RotCamera rotation. Also used to calculate the target.
TargCamera Target. The point the camera is looking at.
UpDirCamera up direction.
FOVField of view in radians.
nearplaneMinumum draw distance.
farplaneMaximum draw distance.

◆ Camera() [2/4]

_3DRadSpaceDll.Camera.Camera ( string  name,
bool  Enabled,
Vector3  Pos,
Vector3  Rot,
Vector3  UpDir,
float  FOV,
float  nearplane,
float  farplane 
)

Creates a Camera object with the specified arguments.

Parameters
nameObjet name.
EnabledIf camera is enabled.
PosPosition
RotCamera rotation.Also used to calculate the target.
UpDirCamera up direction.
FOVField of view in radians
nearplaneMinumum draw distance
farplaneMaximum draw distance

◆ Camera() [3/4]

_3DRadSpaceDll.Camera.Camera ( string  name,
Vector3  Pos,
Vector3  Target,
float  FOV,
float  nearplane,
float  farplane 
)

Camera constructor used in the editor.

Parameters
name
Pos
Target
FOV
nearplane
farplane

◆ Camera() [4/4]

_3DRadSpaceDll.Camera.Camera ( )

Empty constructor. Values are mostly default.

Member Function Documentation

◆ Draw()

void _3DRadSpaceDll.Camera.Draw ( SpriteBatch  spriteBatch,
out Matrix  view,
out Matrix  projection 
)

Camera drawing for game code. This method doesn't override the GameObject's Draw function. :thinking:

Parameters
spriteBatchNot used.
viewUses it's own view
projection

◆ EditorDraw()

override void _3DRadSpaceDll.Camera.EditorDraw ( SpriteBatch  spriteBatch,
Matrix?  view,
Matrix?  projection 
)
virtual

Drawing code for the editor.

Reimplemented from _3DRadSpaceDll.GameObject.

◆ GetFOVDegrees()

float _3DRadSpaceDll.Camera.GetFOVDegrees ( )

Converts FOV to degrees.

Returns
Degrees

◆ Load()

override void _3DRadSpaceDll.Camera.Load ( ContentManager  content)
virtual

Loads the object. In this cases, initializes the DeltaPos used when the camera is 'chasing' an object.

Parameters
content

Reimplemented from _3DRadSpaceDll.GameObject.

◆ SetFOVDegrees()

void _3DRadSpaceDll.Camera.SetFOVDegrees ( float  deg)

Sets the FOV with a degree value

Parameters
degDegrees

◆ Update()

override void _3DRadSpaceDll.Camera.Update ( MouseState  mouse,
KeyboardState  keyboard,
GameTime  time 
)
virtual

Updates the Camera object. In this case, the Camera object is affected by it's 'relationship(s)'.

Parameters
mouseNot used
keyboardNot used
timeNot used

Reimplemented from _3DRadSpaceDll.GameObject.

Property Documentation

◆ CameraRotation

Vector3 _3DRadSpaceDll.Camera.CameraRotation
getset

Camera Rotation. This is a normalized 3D Vector (with the lenght equal or lower(?) to 1)

◆ CameraTarget

Vector3 _3DRadSpaceDll.Camera.CameraTarget
getset

Look at point.

◆ FOV

float _3DRadSpaceDll.Camera.FOV
getset

Fielf of view (Measured in radians).

◆ MaxDrawDist

float _3DRadSpaceDll.Camera.MaxDrawDist
getset

Maximum drawing distance.

◆ MinDrawDist

float _3DRadSpaceDll.Camera.MinDrawDist
getset

Minimum drawing distance. A recommended value is 0.1f.

◆ model

Model _3DRadSpaceDll.Camera.model
staticgetset

Expected to be loaded by the game editor. Not used in 3DRadSpacePlayer.

◆ ScreenSize

Vector2 _3DRadSpaceDll.Camera.ScreenSize
staticgetset

Screen size. Used to calculate the projection's aspect ratio.