de.rico.adventure.entity.hotspot
Class SphericalHotspot

java.lang.Object
  extended by de.rico.adventure.entity.AbstractEntity
      extended by de.rico.adventure.entity.hotspot.AbstractInteractiveHotspot
          extended by de.rico.adventure.entity.hotspot.SphericalHotspot

public class SphericalHotspot
extends AbstractInteractiveHotspot

This class represents a spherial interactive hotspot.

Author:
Frank Bruns

Constructor Summary
SphericalHotspot(Point3D pos, float radius, boolean needsItem)
          Creates a new spherical hot spot with the specified radius at the specified position.
 
Method Summary
 void draw(javax.media.opengl.GL gl)
          Visualizes the interactive hotspot.
 Point3D getMouseOverHotspot(int screenX, int screenY)
          Returns the world coordinates of the mouse position over the hotspot.
 float getRadius()
          Returns the radius of the spherical hotspot.
 boolean isMouseOverHotspot(int screenX, int screenY)
          Determines whether the mouse is located over the interactive hotspot.
 boolean isWithinFrustum(ViewingFrustum frustum)
          Determines whether or not the hotspot volume is within the camera's viewing frustum.
 void setRadius(float radius)
          Sets the radius of the hotspot
 
Methods inherited from class de.rico.adventure.entity.hotspot.AbstractInteractiveHotspot
destroy, getMesh, getPosition, isEnabled, needsItem, setEnabled, setNeedsItem, setPosition, toString
 
Methods inherited from class de.rico.adventure.entity.AbstractEntity
drawScreenName, getScreenName, getScriptId, setScreenName, setScriptId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SphericalHotspot

public SphericalHotspot(Point3D pos,
                        float radius,
                        boolean needsItem)
Creates a new spherical hot spot with the specified radius at the specified position. You can specify, if the hotspot needs an item to be usable.

Parameters:
pos - position of the hotspot
radius - radius of the hotspots sphere
needsItem - needs item to use? --> true=yes, false=no
Method Detail

getRadius

public float getRadius()
Returns the radius of the spherical hotspot.

Returns:
radius of the hotspot

setRadius

public void setRadius(float radius)
Sets the radius of the hotspot

Parameters:
radius - radius of the hotspot

isMouseOverHotspot

public boolean isMouseOverHotspot(int screenX,
                                  int screenY)
Description copied from class: AbstractInteractiveHotspot
Determines whether the mouse is located over the interactive hotspot.

Specified by:
isMouseOverHotspot in class AbstractInteractiveHotspot
Parameters:
screenX - screen x-coordinate
screenY - screen y-coordinate
Returns:
is mouse on hotspot? --> true=yes, false=no

getMouseOverHotspot

public Point3D getMouseOverHotspot(int screenX,
                                   int screenY)
Description copied from class: AbstractInteractiveHotspot
Returns the world coordinates of the mouse position over the hotspot.

Specified by:
getMouseOverHotspot in class AbstractInteractiveHotspot
Parameters:
screenX - screen x-coordinate
screenY - screen y-coordinate
Returns:
world position of the mouse over the hotspot

isWithinFrustum

public boolean isWithinFrustum(ViewingFrustum frustum)
Description copied from class: AbstractInteractiveHotspot
Determines whether or not the hotspot volume is within the camera's viewing frustum.

Specified by:
isWithinFrustum in class AbstractInteractiveHotspot
Parameters:
frustum - the camera's viewing frustum
Returns:
is in frustum? --> true=yes, false=no

draw

public void draw(javax.media.opengl.GL gl)
Description copied from class: AbstractInteractiveHotspot
Visualizes the interactive hotspot.

Specified by:
draw in class AbstractInteractiveHotspot