es.ucm.look.ar.ar3D.core.drawables
Class Entity3D

java.lang.Object
  extended by es.ucm.look.ar.ar3D.core.drawables.Entity3D
All Implemented Interfaces:
Drawable3D

public class Entity3D
extends java.lang.Object
implements Drawable3D

Represents an 3D entity that can be contained in a scene


Constructor Summary
Entity3D(Mesh3D drawable)
          Constructs an entity with a drawable.
 
Method Summary
 void draw(GL10 gl)
          Draws this entity into the given GL context
 Armature getArmature()
          Returns an Armature in the local system coordiantes of this entity
 Color4 getMaterial()
          Returns entity's material
 Matrix3 getMatrix()
          Returns the matrix with the current transformation for the entity
 float getRadius()
           
 int getTextureBind()
          Returns the integer associated to the open gl texture used by this entity
 void setDrawable(Mesh3D drawable)
          Sets the drawable for this entity
 void setLighted(boolean lighted)
          Sets whether entity is affect by light
 void setMaterial(Color4 m)
          Sets entity's material
 void setTexture(Bitmap bitmap)
           
 void setTexture(int texture)
          Sets the texture for this entity
 void setTexture(java.lang.String uri)
          Sets the texture for this entity
 void update(long elapsed)
          Updates entity the given time
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Entity3D

public Entity3D(Mesh3D drawable)
Constructs an entity with a drawable. Its initial position and rotation is ( 0, 0, 0 )

Parameters:
id - the id
drawable - the drawable
Method Detail

draw

public void draw(GL10 gl)
Draws this entity into the given GL context

Specified by:
draw in interface Drawable3D
Parameters:
gl - the GL context

getArmature

public Armature getArmature()
Returns an Armature in the local system coordiantes of this entity

Returns:
an Armature in the local system coordiantes of this entity

getMaterial

public Color4 getMaterial()
Returns entity's material

Returns:
entity's material

getMatrix

public Matrix3 getMatrix()
Returns the matrix with the current transformation for the entity

Returns:
the matrix with the current transformation for the entity

getRadius

public float getRadius()

getTextureBind

public int getTextureBind()
Returns the integer associated to the open gl texture used by this entity

Returns:

setDrawable

public void setDrawable(Mesh3D drawable)
Sets the drawable for this entity

Parameters:
drawable - the drawable

setLighted

public void setLighted(boolean lighted)
Sets whether entity is affect by light


setMaterial

public void setMaterial(Color4 m)
Sets entity's material

Parameters:
m - entity's material

setTexture

public void setTexture(Bitmap bitmap)

setTexture

public void setTexture(int texture)
Sets the texture for this entity

Parameters:
texture - the resource

setTexture

public void setTexture(java.lang.String uri)
Sets the texture for this entity

Parameters:
uri - the uri for the texture

update

public void update(long elapsed)
Updates entity the given time

Specified by:
update in interface Drawable3D
Parameters:
elapsed - elapsed time since last update (in milliseconds)