ants.move.core.models.avatar
Class AvatarModel

java.lang.Object
  |
  +--ants.move.core.models.avatar.AvatarModel
All Implemented Interfaces:
ants.comm.RemoteEventListener

public class AvatarModel
extends java.lang.Object
implements ants.comm.RemoteEventListener

Implementation of Avatar Model.

Version:
1.47 Build 2001
Author:
Carles Pairot (cpairot@tinet.org), Oriol Montalà (omontala@tinet.org)

Constructor Summary
AvatarModel(ants.core.Place ch, java.util.Hashtable env)
          Sole & void constructor.
 
Method Summary
 void addAvatarListener(AvatarListener aList)
           
 void eventArrived(java.util.Hashtable evt)
          Moves non-pilot avatars, removes non-pilot avatars from the scene and answers the 'hello' event.
 float getActualOrientation(int index)
           
 float getActualPosition(int index)
           
 void leaveSession()
          Leaves Notification Service's session.
 void moveAvatar(java.lang.Float[] posNow, java.lang.Float[] oriNow)
           
 void newUser(java.lang.Float[] pos, java.lang.Float[] ori)
           
 void removeAvatarListener(AvatarListener aList)
           
 void setActualOrientation(java.lang.Float[] value)
           
 void setActualPosition(java.lang.Float[] value)
           
 float to1d(float n)
          Trims a float to an only decimal digit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvatarModel

public AvatarModel(ants.core.Place ch,
                   java.util.Hashtable env)
Sole & void constructor.
Parameters:
params - None
Throws:
exceptions - No exceptions thrown
Method Detail

addAvatarListener

public void addAvatarListener(AvatarListener aList)

removeAvatarListener

public void removeAvatarListener(AvatarListener aList)

to1d

public float to1d(float n)
Trims a float to an only decimal digit.
Parameters:
n - Number to trim
Returns:
Number trimmed
Throws:
exceptions - No exceptions thrown

newUser

public void newUser(java.lang.Float[] pos,
                    java.lang.Float[] ori)

moveAvatar

public void moveAvatar(java.lang.Float[] posNow,
                       java.lang.Float[] oriNow)

eventArrived

public void eventArrived(java.util.Hashtable evt)
Moves non-pilot avatars, removes non-pilot avatars from the scene and answers the 'hello' event. This method is executed whenever an avatar remote event is received by the Elvin4 client.
Specified by:
eventArrived in interface ants.comm.RemoteEventListener
Parameters:
evt - Context
Returns:
No return value
Throws:
exceptions - No exceptions thrown

getActualPosition

public float getActualPosition(int index)

getActualOrientation

public float getActualOrientation(int index)

setActualPosition

public void setActualPosition(java.lang.Float[] value)

setActualOrientation

public void setActualOrientation(java.lang.Float[] value)

leaveSession

public void leaveSession()
Leaves Notification Service's session.
Parameters:
params - None
Returns:
No return value
Throws:
exceptions - No exceptions thrown


Developers: Oriol Montala, Carles Pairot, Francesc Pinas2000 - 2002
Departament d'Enginyeria Informatica i Matematiques
Escola Tecnica Superior d'Enginyeria
Universitat Rovira i Virgili