Behaviours: gen_server.
Main module for handling 3D objects.
This module provides functions for creating a 3D object and manipulating it in order to change its attributes like position, orientation, color, etc.
This is also a behaviour, since it can be used as the general part for implementing new ad-hoc 3D objects to be manipulated by ROSEN.
object3d() = #object3d{}
A record with all parameters related to a 3D object.
vector() = #vector{}
activities/1 | Gets the list of activities associated to a 3D object. |
add_activity/3 | Associates an activity to a 3D object. |
add_activity/4 | Associates an activity to a 3D object. |
axis/1 | Gets the axis of an object. |
axis/2 | Changes the axis of an object. |
draw/1 | Draws the object. |
new/1 | Creates a new 3D object as specified in the parameter. |
obj/1 | Gets the object info. |
position/1 | Gets the (x,y,z) position of an object. |
position/2 | Sets the (x,y,z) position of an object. |
stop/1 | Destroys the object. |
up/1 | Gets the up direction of an object. |
up/2 | Changes the up direction of an object. |
activities(ObjPid::pid()) -> [pid()]
Gets the list of activities associated to a 3D object.
add_activity(ObjPid::pid(), Module::atom(), InitialParams::property_list()) -> {ok, ActivityPid}
Associates an activity to a 3D object.
The ObjPid
represents the object to which
the activity has to be associated;
Module
is the name of the module implementing the
activity (using gen_activity
behaviour);
InitialParams
is a property list which provides the initial values of the
activity parameters.
It returns the pid of the process executing this activity.
add_activity(ObjPid::pid(), Module::atom(), Name::term(), InitialParams::property_list()) -> {ok, ActivityPid}
Associates an activity to a 3D object.
Same as add_activity/3
, but registering with
Name
the process executing this activity.
axis(ObjPid::pid()) -> vector()
Gets the axis of an object.
axis(ObjPid::pid(), NewAxis::vector()) -> ok
Changes the axis of an object.
draw(ObjPid::pid()) -> ok
Draws the object.
This function is automatically called by the ROSEN engine
to draw the object. In turn, it calls the draw/1 callback of the
code implementing the drawing routines for the specific object.
new(Obj::object3d()) -> {ok, Pid}
Creates a new 3D object as specified in the parameter.
The object is handled has a new process linked with the calling
process. The function result is thus the pid of the spawned process.
If a name is specified in the #object3d record, the process is bound
to that name, so that, in all the functions of this module, the object
can be referred with either the pid or its registered name.
obj(ObjPid::pid()) -> object3d()
Gets the object info.
Returns an #object3d record with the whole description
of the object represented by the given pid or name.
position(ObjPid::pid()) -> vector()
Gets the (x,y,z) position of an object.
position(ObjPid::pid(), Position::vector()) -> ok
Sets the (x,y,z) position of an object.
stop(Pid::pid()) -> ok
Destroys the object.
up(ObjPid::pid()) -> vector()
Gets the up direction of an object.
up(ObjPid::pid(), NewUp::vector()) -> ok
Changes the up direction of an object.
Generated by EDoc, Nov 21 2007, 10:13:23.