Node Object

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files
- Examples

Functions
Node Object
Evas » Evas 3D Extensions

A node is used for hierarchical construction of a scene graph. More...

## Functions
EOAPI void | evas_canvas3d_node_position_inherit_set (Eina_Bool inherit)
| Set the position inheritance flag of the given node. More...
EOAPI Eina_Bool | evas_canvas3d_node_position_inherit_get (void)
| Get the position inheritance flag of the given node. More...
EOAPI void | evas_canvas3d_node_orientation_inherit_set (Eina_Bool inherit)
| Set the orientation inheritance flag of the given node. More...
EOAPI Eina_Bool | evas_canvas3d_node_orientation_inherit_get (void)
| Get the orientation inheritance flag of the given node. More...
EOAPI void | evas_canvas3d_node_scale_inherit_set (Eina_Bool inherit)
| Set the scale inheritance flag of the given node. More...
EOAPI Eina_Bool | evas_canvas3d_node_scale_inherit_get (void)
| Get the scale inheritance flag of the given node. More...
EOAPI void | evas_canvas3d_node_camera_set (Evas_Canvas3D_Object *camera)
| Set a camera to the given node. More...
EOAPI Evas_Canvas3D_Object * | evas_canvas3d_node_camera_get (void)
| Get the camera of the given node. More...
EOAPI void | evas_canvas3d_node_light_set (Evas_Canvas3D_Light *light)
| Set the light of the given node. More...
EOAPI Evas_Canvas3D_Light * | evas_canvas3d_node_light_get (void)
| Get the light of the given node. More...
EOAPI void | evas_canvas3d_node_mesh_frame_set (Evas_Canvas3D_Mesh *mesh, int frame)
| Set the animation frame number of the given node for the given mesh. More...
EOAPI int | evas_canvas3d_node_mesh_frame_get (Evas_Canvas3D_Mesh *mesh)
| Set the animation frame number of the given node for the given mesh. More...
EOAPI void | evas_canvas3d_node_billboard_target_set (Evas_Canvas3D_Node *target)
| Set behavior of node like billboard object. More...
EOAPI Evas_Canvas3D_Node * | evas_canvas3d_node_billboard_target_get (void)
| Get the target node for billboard object. More...
EOAPI void | evas_canvas3d_node_constructor (Evas_Canvas3D_Node_Type type)
| Constructor. More...
EOAPI Evas_Canvas3D_Node_Type | evas_canvas3d_node_type_get (void)
| Get the type of the given node. More...
EOAPI void | evas_canvas3d_node_member_add (Evas_Canvas3D_Node *member)
| Add a member node to the given node. More...
EOAPI void | evas_canvas3d_node_member_del (Evas_Canvas3D_Node *member)
| Delete a member node from the given node. More...
EOAPI Evas_Canvas3D_Node * | evas_canvas3d_node_parent_get (void)
| Get the parent node of the given node. More...
EOAPI const Eina_List * | evas_canvas3d_node_member_list_get (void)
| Get the list of member nodes of the given node. More...
EOAPI void | evas_canvas3d_node_position_set (Evas_Real x, Evas_Real y, Evas_Real z)
| Set the position of the given node. More...
EOAPI void | evas_canvas3d_node_orientation_set (Evas_Real x, Evas_Real y, Evas_Real z, Evas_Real w)
| Set the orientation of the given node using quaternion. More...
EOAPI void | evas_canvas3d_node_orientation_angle_axis_set (Evas_Real angle, Evas_Real x, Evas_Real y, Evas_Real z)
| Set the orientation of the given node using axis-angle. More...
EOAPI void | evas_canvas3d_node_scale_set (Evas_Real x, Evas_Real y, Evas_Real z)
| Set the scale of the given node. More...
EOAPI void | evas_canvas3d_node_position_get (Evas_Canvas3D_Space space, Evas_Real *x, Evas_Real *y, Evas_Real *z)
| Get the position of the given node. More...
EOAPI void | evas_canvas3d_node_orientation_get (Evas_Canvas3D_Space space, Evas_Real *x, Evas_Real *y, Evas_Real *z, Evas_Real *w)
| Get the orientation of the given node as quaternion. More...
EOAPI void | evas_canvas3d_node_scale_get (Evas_Canvas3D_Space space, Evas_Real *x, Evas_Real *y, Evas_Real *z)
| Get the scale of the given node. More...
EOAPI void | evas_canvas3d_node_look_at_set (Evas_Canvas3D_Space target_space, Evas_Real x, Evas_Real y, Evas_Real z, Evas_Canvas3D_Space up_space, Evas_Real ux, Evas_Real uy, Evas_Real uz)
| Rotate the given node to look at desired position. More...
EOAPI void | evas_canvas3d_node_mesh_add (Evas_Canvas3D_Mesh *mesh)
| Add a mesh to the given node. More...
EOAPI void | evas_canvas3d_node_mesh_del (Evas_Canvas3D_Mesh *mesh)
| Delete a mesh from the given node. More...
EOAPI const Eina_List * | evas_canvas3d_node_mesh_list_get (void)
| Get the list of meshes of the given node. More...
EOAPI void | evas_canvas3d_node_bounding_box_get (Evas_Real *x, Evas_Real *y, Evas_Real *z, Evas_Real *x2, Evas_Real *y2, Evas_Real *z2)
| Get axis-aligned bounding box (AABB) of the given node. More...
EOAPI void | evas_canvas3d_node_bounding_sphere_get (Evas_Real *x, Evas_Real *y, Evas_Real *z, Evas_Real *r)
| Get bounding sphere of the given node. More...

## Detailed Description

A node is used for hierarchical construction of a scene graph.

Evas 3D provides n-ary tree structure for the scene graph construction. A node has its position, orientation and scale. Other objects, like camera, light and mesh can be contained in a node to be located in a 3D space.

## Function Documentation

EOAPI void evas_canvas3d_node_position_inherit_set | ( | Eina_Bool | inherit | ) |

Set the position inheritance flag of the given node.

When inheritance is enabled, a node's world space position is determined by adding the parent node's world position and the node's position, otherwise, the node's position will be the world space position.

Parameters

  [in] | inherit | Whether to inherit parent position.

EOAPI Eina_Bool evas_canvas3d_node_position_inherit_get | ( | void |  | ) |

Get the position inheritance flag of the given node.

See also evas_canvas3d_node_position_inherit_set.

Returns
  Whether to inherit parent position.

EOAPI void evas_canvas3d_node_orientation_inherit_set | ( | Eina_Bool | inherit | ) |

Set the orientation inheritance flag of the given node.

When inheritance is enabled, a node's world space orientation is determined by multiplying the parent node's world orientation and the node's orientation, otherwise, the node's orientation will be the world space orientation.

Parameters

  [in] | inherit | Whether to inherit parent orientation.

EOAPI Eina_Bool evas_canvas3d_node_orientation_inherit_get | ( | void |  | ) |

Get the orientation inheritance flag of the given node.

See also evas_canvas3d_node_orientation_inherit_set.

Returns
  Whether to inherit parent orientation.

EOAPI void evas_canvas3d_node_scale_inherit_set | ( | Eina_Bool | inherit | ) |

Set the scale inheritance flag of the given node.

When inheritance is enabled, a node's world space scale is determined by multiplying the parent node's world scale and the node's scale, otherwise, the node's scale will be the world space scale.

Parameters

  [in] | inherit | Whether to inherit parent scale.

EOAPI Eina_Bool evas_canvas3d_node_scale_inherit_get | ( | void |  | ) |

Get the scale inheritance flag of the given node.

See also evas_canvas3d_node_scale_inherit_set.

Returns
  Whether to inherit parent scale.

EOAPI void evas_canvas3d_node_camera_set | ( | Evas_Canvas3D_Object * | camera | ) |

Set a camera to the given node.

If the node is not of type EVAS_CANVAS3D_NODE_TYPE_CAMERA, error message will be generated and nothing happens.

See also evas_canvas3d_node_member_add.

Parameters

  [in] | camera | The camera of the given node if any, or `null` if there're none.

EOAPI Evas_Canvas3D_Object* evas_canvas3d_node_camera_get | ( | void |  | ) |

Get the camera of the given node.

See also evas_canvas3d_node_camera_set.

Returns
  The camera of the given node if any, or `null` if there're none.

EOAPI void evas_canvas3d_node_light_set | ( | Evas_Canvas3D_Light * | light | ) |

Set the light of the given node.

If the node is not of type EVAS_CANVAS3D_NODE_TYPE_LIGHT, error message will be generated and nothing happens.

See also evas_canvas3d_node_member_add.

Parameters

  [in] | light | The light of the given node if any, or `null` if there're none.

EOAPI Evas_Canvas3D_Light* evas_canvas3d_node_light_get | ( | void |  | ) |

Get the light of the given node.

See also evas_canvas3d_node_light_set.

Returns
  The light of the given node if any, or `null` if there're none.

EOAPI void evas_canvas3d_node_mesh_frame_set | ( | Evas_Canvas3D_Mesh * | mesh,
|  | int | frame
| ) |  |

Set the animation frame number of the given node for the given mesh.

If the node is not of type EVAS_CANVAS3D_NODE_TYPE_MESH or the given mesh does not belong to the given mesh error mesh will be generated and nothing happens.

Default mesh frame is 0.

See also evas_canvas3d_node_mesh_add.

Parameters

  [in] | mesh | The given mesh.
  [in] | frame | The animation frame number.

EOAPI int evas_canvas3d_node_mesh_frame_get | ( | Evas_Canvas3D_Mesh * | mesh | ) |

Set the animation frame number of the given node for the given mesh.

If the node is not of type EVAS_CANVAS3D_NODE_TYPE_MESH or the given mesh does not belong to the given mesh error mesh will be generated and nothing happens.

See also evas_canvas3d_node_mesh_add.

Parameters

  [in] | mesh | The given mesh.

Returns
  The animation frame number.

EOAPI void evas_canvas3d_node_billboard_target_set | ( | Evas_Canvas3D_Node * | target | ) |

Set behavior of node like billboard object.

Parameters

  [in] | target | The pointer to target node for billboard object, or `null` if there're none.

EOAPI Evas_Canvas3D_Node* evas_canvas3d_node_billboard_target_get | ( | void |  | ) |

Get the target node for billboard object.

See also evas_canvas3d_node_billboard_target_set.

Returns
  The pointer to target node for billboard object, or `null` if there're none.

EOAPI void evas_canvas3d_node_constructor | ( | Evas_Canvas3D_Node_Type | type | ) |

Constructor.

Parameters

  [in] | type |

EOAPI Evas_Canvas3D_Node_Type evas_canvas3d_node_type_get | ( | void |  | ) |

Get the type of the given node.

See also evas_canvas3d_node_member_add.

Returns
  The type of the given node.

EOAPI void evas_canvas3d_node_member_add | ( | Evas_Canvas3D_Node * | member | ) |

Add a member node to the given node.

Nodes can be constructed into N-ary tree structure like other ordinary scene graph. Basically a node inherit transforms from its parent.

See also evas_canvas3d_node_parent_get.

Parameters

  [in] | member | Node object to be added.

EOAPI void evas_canvas3d_node_member_del | ( | Evas_Canvas3D_Node * | member | ) |

Delete a member node from the given node.

See also evas_canvas3d_node_member_add.

Parameters

  [in] | member | Member node to be deleted from the given node.

EOAPI Evas_Canvas3D_Node* evas_canvas3d_node_parent_get | ( | void |  | ) |

Get the parent node of the given node.

See also evas_canvas3d_node_member_add.

Returns
  The parent node of the given node.

EOAPI const Eina_List* evas_canvas3d_node_member_list_get | ( | void |  | ) |

Get the list of member nodes of the given node.

See also evas_canvas3d_node_member_add.

Returns
  The list of member nodes if any or `null` if there are none.

EOAPI void evas_canvas3d_node_position_set | ( | Evas_Real | x,
|  | Evas_Real | y,
|  | Evas_Real | z
| ) |  |

Set the position of the given node.

According to the inheritance flag, (x, y, z) can be a world space position or parent space position.

Default position is (0.0, 0.0, 0.0).

See also evas_canvas3d_node_position_inherit_set.

Parameters

  [in] | y | Y coordinate of the position.
  [in] | z | Z coordinate of the position.

EOAPI void evas_canvas3d_node_orientation_set | ( | Evas_Real | x,
|  | Evas_Real | y,
|  | Evas_Real | z,
|  | Evas_Real | w
| ) |  |

Set the orientation of the given node using quaternion.

According the the inheritance flag, (w, x, y, z) can be a world space orientation or parent space orientation.

Default orientation is (1.0, 0.0, 0.0, 0.0) (identity quaternion).

See also evas_canvas3d_node_orientation_inherit_set.

Parameters

  [in] | y | Y term of the orientation quaternion (w, x, y, z.
  [in] | z | Z term of the orientation quaternion (w, x, y, z.
  [in] | w | W term of the orientation quaternion (w, x, y, z.

EOAPI void evas_canvas3d_node_orientation_angle_axis_set | ( | Evas_Real | angle,
|  | Evas_Real | x,
|  | Evas_Real | y,
|  | Evas_Real | z
| ) |  |

Set the orientation of the given node using axis-angle.

See also evas_canvas3d_node_orientation_set.

Parameters

  [in] | x | X term of the rotation axis.
  [in] | y | Y term of the rotation axis.
  [in] | z | Z term of the rotation axis.

EOAPI void evas_canvas3d_node_scale_set | ( | Evas_Real | x,
|  | Evas_Real | y,
|  | Evas_Real | z
| ) |  |

Set the scale of the given node.

According to the inheritance flag, (x, y, z) can be a world space scale or parent space scale. Be careful when using non-uniform scale factor with inheritance, each transform attributes are not affected by other attributes.

Default scale is (1.0, 1.0, 1.0).

See also evas_canvas3d_node_scale_inherit_set.

Parameters

  [in] | y | Scale factor along Y-axis.
  [in] | z | Scale factor along Z-axis.

EOAPI void evas_canvas3d_node_position_get | ( | Evas_Canvas3D_Space | space,
|  | Evas_Real * | x,
|  | Evas_Real * | y,
|  | Evas_Real * | z
| ) |  |

Get the position of the given node.

See also evas_canvas3d_node_position_set.

Parameters

  [out] | x | Pointer to receive X coordinate of the position.
  [out] | y | Pointer to receive Y coordinate of the position.
  [out] | z | Pointer to receive Z coordinate of the position.

EOAPI void evas_canvas3d_node_orientation_get | ( | Evas_Canvas3D_Space | space,
|  | Evas_Real * | x,
|  | Evas_Real * | y,
|  | Evas_Real * | z,
|  | Evas_Real * | w
| ) |  |

Get the orientation of the given node as quaternion.

See also evas_canvas3d_node_orientation_set.

Parameters

  [out] | x | Pointer to receive X term of the orientation quaternion.
  [out] | y | Pointer to receive Y term of the orientation quaternion.
  [out] | z | Pointer to receive Z term of the orientation quaternion.
  [out] | w | Pointer to receive W term of the orientation quaternion.

EOAPI void evas_canvas3d_node_scale_get | ( | Evas_Canvas3D_Space | space,
|  | Evas_Real * | x,
|  | Evas_Real * | y,
|  | Evas_Real * | z
| ) |  |

Get the scale of the given node.

See also evas_canvas3d_node_scale_get.

Parameters

  [out] | x | Pointer to receive Scale factor along X-axis.
  [out] | y | Pointer to receive Scale factor along X-axis.
  [out] | z | Pointer to receive Scale factor along X-axis.

EOAPI void evas_canvas3d_node_look_at_set | ( | Evas_Canvas3D_Space | target_space,
|  | Evas_Real | x,
|  | Evas_Real | y,
|  | Evas_Real | z,
|  | Evas_Canvas3D_Space | up_space,
|  | Evas_Real | ux,
|  | Evas_Real | uy,
|  | Evas_Real | uz
| ) |  |

Rotate the given node to look at desired position.

This function rotate the given node so that its forward vector (negative Z-axis) points to the desired position and the up vector coincide with the given up vector.

See also evas_canvas3d_node_orientation_set.

Parameters

  [in] | x | X coordinate of the target position.
  [in] | y | Y coordinate of the target position.
  [in] | z | Z coordinate of the target position.
  [in] | up_space | Space where the up vector belongs to.
  [in] | ux | X term of the up vector.
  [in] | uy | Y term of the up vector.
  [in] | uz | Z term of the up vector.

EOAPI void evas_canvas3d_node_mesh_add | ( | Evas_Canvas3D_Mesh * | mesh | ) |

Add a mesh to the given node.

If the node is not of type EVAS_CANVAS3D_NODE_TYPE_MESH, error message will be generated and nothing happens.

See also evas_canvas3d_node_member_add.

Parameters

  [in] | mesh | The mesh to be added.

EOAPI void evas_canvas3d_node_mesh_del | ( | Evas_Canvas3D_Mesh * | mesh | ) |

Delete a mesh from the given node.

If the node is not of type EVAS_CANVAS3D_NODE_TYPE_MESH or the given mesh does not belong to the given node, error message will be gnerated and nothing happens.

See also evas_canvas3d_node_mesh_add.

Parameters

  [in] | mesh | The mesh to be deleted.

EOAPI const Eina_List* evas_canvas3d_node_mesh_list_get | ( | void |  | ) |

Get the list of meshes of the given node.

If the node is not of type EVAS_CANVAS3D_NODE_TYPE_MESH, error message will be generated and `null` will be returned. If there're no meshes in the given node, `null` will be returned.

See also evas_canvas3d_node_mesh_add.

Returns
  The list of meshes if any, or `null` if there're none.

EOAPI void evas_canvas3d_node_bounding_box_get | ( | Evas_Real * | x,
|  | Evas_Real * | y,
|  | Evas_Real * | z,
|  | Evas_Real * | x2,
|  | Evas_Real * | y2,
|  | Evas_Real * | z2
| ) |  |

Get axis-aligned bounding box (AABB) of the given node.

Parameters

  [in] | y | Pointer to receive Y coordinate of the first point of AABB.
  [in] | z | Pointer to receive Z coordinate of the first point of AABB.
  [in] | x2 | Pointer to receive X coordinate of the second point of AABB.
  [in] | y2 | Pointer to receive Y coordinate of the second point of AABB.
  [in] | z2 | Pointer to receive Z coordinate of the second point of AABB.

EOAPI void evas_canvas3d_node_bounding_sphere_get | ( | Evas_Real * | x,
|  | Evas_Real * | y,
|  | Evas_Real * | z,
|  | Evas_Real * | r
| ) |  |

Get bounding sphere of the given node.

Parameters

  [in] | y | Pointer to receive Y coordinate of the center of sphere.
  [in] | z | Pointer to receive Z coordinate of center of sphere.
  [in] | r | Pointer to receive radius of center of sphere.