Module object3d

Main module for handling 3D objects.

Behaviours: gen_server.

Description

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.

Data Types

object3d()

object3d() = #object3d{}

A record with all parameters related to a 3D object.

vector()

vector() = #vector{}

Function Index

activities/1Gets the list of activities associated to a 3D object.
add_activity/3Associates an activity to a 3D object.
add_activity/4Associates an activity to a 3D object.
axis/1Gets the axis of an object.
axis/2Changes the axis of an object.
draw/1Draws the object.
new/1Creates a new 3D object as specified in the parameter.
obj/1Gets the object info.
position/1Gets the (x,y,z) position of an object.
position/2Sets the (x,y,z) position of an object.
stop/1Destroys the object.
up/1Gets the up direction of an object.
up/2Changes the up direction of an object.

Function Details

activities/1

activities(ObjPid::pid()) -> [pid()]

Gets the list of activities associated to a 3D object.

add_activity/3

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/4

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/1

axis(ObjPid::pid()) -> vector()

Gets the axis of an object.

axis/2

axis(ObjPid::pid(), NewAxis::vector()) -> ok

Changes the axis of an object.

draw/1

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/1

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/1

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/1

position(ObjPid::pid()) -> vector()

Gets the (x,y,z) position of an object.

position/2

position(ObjPid::pid(), Position::vector()) -> ok

Sets the (x,y,z) position of an object.

stop/1

stop(Pid::pid()) -> ok

Destroys the object.

up/1

up(ObjPid::pid()) -> vector()

Gets the up direction of an object.

up/2

up(ObjPid::pid(), NewUp::vector()) -> ok

Changes the up direction of an object.


Generated by EDoc, Nov 21 2007, 10:13:23.