Public Member Functions | Protected Attributes

celery::engine::graphics::SceneEntity Class Reference

Inheritance diagram for celery::engine::graphics::SceneEntity:
Inheritance graph
[legend]
Collaboration diagram for celery::engine::graphics::SceneEntity:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SceneEntity (EntityType type, Transform tfo, SceneMaterial mat, TouchInputHandler tHdl)
EntityType type ()
boolean isCollision (SceneEntity e)
boolean isCollision (Collection< SceneEntity > es)
final Vec2F center ()
final boolean hasTouchInput ()
final SceneMaterial material ()
final void setMaterial (SceneMaterial mat)
final TouchInputHandler touchInputHandler ()
void markForRemoval ()
boolean isMarkedForRemoval ()
final Transform transform ()
final void setTransform (final Transform transform)
void computeCenter (final Viewport v)
abstract void draw (final Canvas c, final Engine e, final Viewport v, final Vec4F bounds)
boolean onTouch (View arg0, MotionEvent arg1)
boolean onDrag (View arg0, MotionEvent arg1)
boolean onRelease (View arg0, MotionEvent arg1)
void pushTransform (Canvas c)
void popTransform (Canvas c)
void pushRotation (Canvas c, Viewport v)
void pushTranslation (Canvas c, Viewport v)
void popTranslation (Canvas c, Viewport v)
void pushScale (Canvas c, Viewport v)
void popScale (Canvas c, Viewport v)
void popRotation (Canvas c, Viewport v)
abstract GeometryData geometryData ()

Protected Attributes

Transform transfo_
TouchInputHandler touchHandler_
SceneMaterial material_
boolean markForRemoval_
Vec2F center_
EntityType type_
GeometryData geoDataModel_
GeometryData geoDataWorld_

Detailed Description

A SceneEntity is a drawable object which can be added to a Scene. SceneEntities may be shared within Scenes, but keep in mind that its actual final transformation in a Scene may be different depending on the previous parent transformations in the Scene's graph.

By default, a SceneEntity is assumed not to have any animation or touch handler.

Author:
psastras

Constructor & Destructor Documentation

celery::engine::graphics::SceneEntity::SceneEntity ( EntityType  type,
Transform  tfo,
SceneMaterial  mat,
TouchInputHandler  tHdl 
) [inline]

The scene entity constructor. Note that if the transform is null, it will automatically be set to the identity transformation (0 rotation, 0 translation and 1 scale). SceneMaterical cannot be null. If TouchInputHandler is null, this object is assumed to not have any touch input capabilities, and will not be queried when a touch input is detected.

Parameters:
tfo The transformation associated with this scene entity. (relating the entity's model space with the Viewport's world space.
mat The material associated with this object, which may be shared with other entities. Materials should be stored by the material manager.
tHdl The touch handler associated with this entity. The touch handler will be fired if this entity detects a touch event.

Member Function Documentation

abstract void celery::engine::graphics::SceneEntity::draw ( final Canvas  c,
final Engine  e,
final Viewport  v,
final Vec4F  bounds 
) [pure virtual]

The draw method is called by the Scene when drawing the SceneEntities. This method is reimplemented by other entities for drawing.

Parameters:
c The application main canvas.
e The engine instance.
v The viewport to use.
final void celery::engine::graphics::SceneEntity::setTransform ( final Transform  transform  )  [inline]

Sets the current transformation of the scene entity to the new transformation. The old transformation is lost.

Parameters:
transform The transformation to apply.
final Transform celery::engine::graphics::SceneEntity::transform (  )  [inline]

Returns the transformation associated with this scene entity.

Returns:
Transformation of the Entity.

The documentation for this class was generated from the following file:
 All Classes Functions Variables