Actors represent models (assets) in a Scene
An actor is a representation of a model in Voxelent. Actors can cache model properties and modified them. This is useful when there are several actors based in the same modelbut each one of them needs to have a different version of any given model property (i.e. color)
To propagate one change for all the actors based in the same model, the setProperty methodshould be invoked by setting the third parameter (scope) like this:
var actor = vxl.c.scene.getActorByName('example');actor.setProperty('color',[1.0,0.0,0.0], vxl.def.model)
If the change should be local (for just that actor) then you should write:
var actor = vxl.c.scene.getActorByName('example');actor.setProperty('color',[1.0,0.0,0.0], vxl.def.actor)
Or simply
var actor = vxl.c.scene.getActorByName('example');actor.setProperty('color',[1.0,0.0,0.0])
Parameters:
model
|
|
The model property of the actor (vxlModel) is shared with the new instance
The actor level properties are copied by VALUE.
If a cloned actor modifies his internal model, any other actor that shares the model will beaffected. A cloned actor however can have different position, colors, etc. (actor level properties)The returned actor is not added to the scene automatically. It is up theprogrammer to determine the scene the cloned actor needs to be added to if at all.The clone does not keep any information about the current position or rotation of the originalactor.Returns:
{vxlActor} an actor |
See:
vxlModelParameters:
Type | Name | Description |
---|---|---|
vxl.def.actor.cull |
face
|
face needs to be one of the elements defined in vxl.def.actor.cull |
Returns:
{Array} the current bounding box. |
Returns:
{Array} a 8-element array with the vertices that constitute the actor bounding box |
Parameters:
Type | Name | Description |
---|---|---|
String |
property
|
the property name |
Returns:
{Object} the property or undefined if the property is not found |
Parameters:
Type | Name | Description |
---|---|---|
Number |
angle
|
the angle |
Parameters:
Type | Name | Description |
---|---|---|
Number |
angle
|
the angle |
Parameters:
Type | Name | Description |
---|---|---|
Number |
angle
|
the angle |
Parameters:
Type | Name | Description |
---|---|---|
Number|Array|vec3 |
r
|
it can be the red component, a 3-dimensional Array or a vec3 (glMatrix) |
Number |
g
|
if r is a number, then this parameter corresponds to the green component |
Number |
b
|
if r is a number, then this parameter corresponds to the blue component |
Parameters:
Type | Name | Description |
---|---|---|
String |
lutID
|
the lookup table id. See vxl.def.lut for currently supported ids. |
Number |
min
|
lowest value for interpolation |
Number |
max
|
highest value for interpolation |
Parameters:
Type | Name | Description |
---|---|---|
Number |
o
|
a float value between 0 and 1. |
Parameters:
Type | Name | Description |
---|---|---|
String |
type
|
one of the possible values for vxl.def.actor.picking |
Function |
pick
|
a function that is invoked when a picking event occurs. This parameter is required if the type (first argument) is different from vxl.def.actor.picking.DISABLED the callback receives an actor object to operate over it. |
Function |
unpick
|
a function that is invoked when an unpicking event occurs. |
Parameters:
Type | Name | Description |
---|---|---|
Number|Array|vec3 |
x
|
it can be the x coordinate, a 3-dimensional Array or a vec3 (glMatrix) |
Number |
y
|
if x is a number, then this parameter corresponds to the y-coordinate |
Number |
z
|
if x is a number, then this parameter corresponds to the z-coordinate |
Parameters:
Type | Name | Description |
---|---|---|
String |
property
|
name of the property |
Object |
value
|
value to be set |
String |
scope
|
indicates if the change is made at the actor level or at the model levelvalid values for scope are vxl.def.model and vxl.def.actor |
Parameters:
Type | Name | Description |
---|---|---|
Number|Array|vec3 |
s
|
the scaling factor. The scaling factor is applied in all axes. |
a
|
|
|
b
|
|
Parameters:
Type | Name | Description |
---|---|---|
scene
|
|
Parameters:
Type | Name | Description |
---|---|---|
Boolean |
flag
|
can be true or false |
Parameters:
Type | Name | Description |
---|---|---|
Number |
s
|
a value for the shininess |
Parameters:
Type | Name | Description |
---|---|---|
vxlTexture|String |
p_texture
|
the texture to load |
Parameters:
Type | Name | Description |
---|---|---|
boolean |
flag
|
true or false |
Parameters:
Type | Name | Description |
---|---|---|
vxl.def.actor.mode |
mode
|
mode needs to be one of the elements defined in vxl.def.actor.mode |
Parameters:
Type | Name | Description |
---|---|---|
Number|Array|vec3 |
x
|
it can be the x coordinate, a 3-dimensional Array or a vec3 (glMatrix) |
Number |
y
|
if x is a number, then this parameter corresponds to the y-coordinate |
Number |
z
|
if x is a number, then this parameter corresponds to the z-coordinate |