![]() |
![]() |
![]() |
mialm Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
MiaVector3d; MiaVector3d * mia_vector3d_add (const MiaVector3d *self
,const MiaVector3d *other
,MiaVector3d *result
); MiaVector3d * mia_vector3d_addup (MiaVector3d *self
,const MiaVector3d *other
); MiaVector3d * mia_vector3d_copy (MiaVector3d *dest
,const MiaVector3d *src
); gfloat mia_vector3d_dot (const MiaVector3d *a
,const MiaVector3d *b
); MiaVector3d * mia_vector3d_dup (const MiaVector3d *orig
); gboolean mia_vector3d_equal (const MiaVector3d *a
,const MiaVector3d *b
); gfloat mia_vector3d_get_norm (MiaVector3d *self
); MiaVector3d * mia_vector3d_new (gfloat x
,gfloat y
,gfloat z
); MiaVector3d * mia_vector3d_normalize (MiaVector3d *self
); MiaVector3d * mia_vector3d_scale (MiaVector3d *self
,gfloat f
); MiaVector3d * mia_vector3d_set (MiaVector3d *self
,gfloat x
,gfloat y
,gfloat z
); void mia_vector3d_xmlio_read (ParserState *state
,const gchar *property
); gboolean mia_vector3d_xmlio_write (xmlNodePtr parent
,xmlNsPtr ns
,const gchar *tag
,const MiaVector3d *v
);
MiaVector3d * mia_vector3d_add (const MiaVector3d *self
,const MiaVector3d *other
,MiaVector3d *result
);
Adds self
and other
component wise and stores the result in result
.
if result = NULL, then a new Mia3DVector instance is created and returned.
|
input Mia3DVector |
|
input Mia3DVector |
|
output Mia3DVector |
Returns : |
if result != NULL then result , else a newly created Mia3DVector |
MiaVector3d * mia_vector3d_addup (MiaVector3d *self
,const MiaVector3d *other
);
Adds other
to self
componentwise (equivalent to self
+= other
|
This Mia3DVector will be changed |
|
second 3D vector |
Returns : |
self (for convinience) |
MiaVector3d * mia_vector3d_copy (MiaVector3d *dest
,const MiaVector3d *src
);
Copies the contens of src
to dest
|
Existing MiaVector3d instance |
|
Existing MiaVector3d instance |
Returns : |
dest (for convinience) |
gfloat mia_vector3d_dot (const MiaVector3d *a
,const MiaVector3d *b
);
Evaluate the dot product of a
and b
|
a MiaVector3d |
|
a MiaVector3d |
Returns : |
the dot product |
MiaVector3d * mia_vector3d_dup (const MiaVector3d *orig
);
Creating a new instance of orig
by duplicating it.
|
a Mia3DVector |
Returns : |
a new MiaVector3d |
gboolean mia_vector3d_equal (const MiaVector3d *a
,const MiaVector3d *b
);
Componentwise comparison of a
and b
.
gfloat mia_vector3d_get_norm (MiaVector3d *self
);
Evaluate the Euclidian norm of self
.
|
a 3D vector |
Returns : |
the norm |
MiaVector3d * mia_vector3d_new (gfloat x
,gfloat y
,gfloat z
);
Created a new MiaVector3d initialized with the given components
|
component of new vector |
|
component of new vector |
|
component of new vector |
Returns : |
the new MiaVector3d instance |
MiaVector3d * mia_vector3d_normalize (MiaVector3d *self
);
Normalize self
to have a norm of 1 (if the vector is not zero)
|
a MiaVector3d |
Returns : |
self (for convinience) |
MiaVector3d * mia_vector3d_scale (MiaVector3d *self
,gfloat f
);
Scales self
by factor f
.
|
3D vector to be scaled |
|
scaling factor |
Returns : |
(scaled) self for convinience |
MiaVector3d * mia_vector3d_set (MiaVector3d *self
,gfloat x
,gfloat y
,gfloat z
);
Sets the components of self
to the given values
|
This Mia3DVector will be changed |
|
new x component |
|
new y component |
|
new z component |
Returns : |
self (with the new values set) |
void mia_vector3d_xmlio_read (ParserState *state
,const gchar *property
);
Callback to read the vector from a XML file
|
holst the current state of the XML SAX parser |
|
the name of the property, where the MiaVector3d should be stored |
gboolean mia_vector3d_xmlio_write (xmlNodePtr parent
,xmlNsPtr ns
,const gchar *tag
,const MiaVector3d *v
);
Add vector v
as XML node with tag tag
to the parent
node