![]() |
![]() |
![]() |
mialm Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
MiaCamera; MiaCamera * mia_camera_copy (MiaCamera *dest
,const MiaCamera *orig
); MiaCamera * mia_camera_dup (MiaCamera *orig
); gfloat mia_camera_get_dist (const MiaCamera *self
); MiaVector3d * mia_camera_get_location (const MiaCamera *self
); MiaQuaternion * mia_camera_get_rotation (const MiaCamera *self
); gfloat mia_camera_get_zoom (const MiaCamera *self
); MiaCamera * mia_camera_new (MiaVector3d *loc
,MiaQuaternion *rot
,gfloat zoom
); void mia_camera_set_dist (MiaCamera *self
,gfloat dist
); void mia_camera_set_location (MiaCamera *self
,MiaVector3d *loc
); void mia_camera_set_rotation (MiaCamera *self
,MiaQuaternion *rot
); void mia_camera_set_zoom (MiaCamera *self
,gfloat zoom
); gboolean mia_camera_test (void
); gboolean mia_camera_xmlio_write (xmlNodePtr root
,xmlNsPtr ns
,const gchar *tag
,const MiaCamera *c
);
MiaCamera descibes a point of view within a 3D volume, i.e. camera location, view direction, and zoom are stored within this class and manipulated by the corresponding functions.
MiaCamera * mia_camera_copy (MiaCamera *dest
,const MiaCamera *orig
);
Copy a MiaCamera to an already created instance,
|
destination object |
|
original object to be copied |
Returns : |
the copy of the camera |
MiaCamera * mia_camera_dup (MiaCamera *orig
);
Create a newly created duplicate of a MiaCamera. The returned camera
must be freed by calling g_object_unref()
|
camera to be copied |
Returns : |
the copy of the camera |
gfloat mia_camera_get_dist (const MiaCamera *self
);
Evaluate the distance of the camera from the center of the universe (0,0,0)
|
the camera |
Returns : |
the distance |
MiaVector3d * mia_camera_get_location (const MiaCamera *self
);
get current location of the camera (note that the z value is equal to the distance)
|
the camera |
Returns : |
location |
MiaQuaternion * mia_camera_get_rotation (const MiaCamera *self
);
get the current view directopn of the camera as a rotation described by a MiaQuaternion
|
the camera |
Returns : |
Quaternion describing the camera rotation |
gfloat mia_camera_get_zoom (const MiaCamera *self
);
Get the current zoom value of the camera
|
the camera |
Returns : |
zoom |
MiaCamera * mia_camera_new (MiaVector3d *loc
,MiaQuaternion *rot
,gfloat zoom
);
Create a camera defined by its position, heading, distance and
zoom. The created object must be destroyed by calling g_object_unref()
For some reason I can not remember, the location z value is ignored and the distance value is given separately.
|
The camera location, z is ignored |
|
the rotation angle |
|
camera zoom into the field of view |
Returns : |
a newly created quaternion |
void mia_camera_set_dist (MiaCamera *self
,gfloat dist
);
Sets the new distance to the center (0,0,0), can also be achieved by setting the full location
|
the camera |
|
new distance to the center of the universe |
void mia_camera_set_location (MiaCamera *self
,MiaVector3d *loc
);
Set the new location of the camera
|
the camera |
|
new location of the camera |
void mia_camera_set_rotation (MiaCamera *self
,MiaQuaternion *rot
);
sets the current view direction of the camera as a rotation described by a MiaQuaternion
|
the camera |
|
new rotation of the camera position around the center of the universe |
void mia_camera_set_zoom (MiaCamera *self
,gfloat zoom
);
sets the new zoom of the camera (i.e. change field of view)
|
the camera |
|
the new zoom value for the camera |
gboolean mia_camera_test (void
);
Run some tests on the camera (not impmented)
Returns : |
TRUE if tests were successful |
gboolean mia_camera_xmlio_write (xmlNodePtr root
,xmlNsPtr ns
,const gchar *tag
,const MiaCamera *c
);
Write the MiaCamera instance to an XML node
|
XML node to attach the camera description to |
|
XML namespace |
|
XML tag to use to create the XML node. |
|
the camera to store |
Returns : |
true if the camera was sucessfully written nor c==NULL |