SmartFrog 3.10.000

org.smartfrog.examples.pong
Class Racket

java.lang.Object
  extended by org.smartfrog.examples.pong.Mass
      extended by org.smartfrog.examples.pong.Obstacle
          extended by org.smartfrog.examples.pong.Racket

public class Racket
extends Obstacle

Defines the Racket object.


Field Summary
 
Fields inherited from class org.smartfrog.examples.pong.Obstacle
size
 
Constructor Summary
Racket(int mass, java.awt.geom.Point2D initialPosition, java.awt.Dimension initialSize)
          Constructor.
 
Method Summary
 void elasticCollision(Obstacle obs1, Obstacle obs2, int axis)
          Checks if elastic clooision takes palce between obstacle1 and obstacle2 in a given axis.
 
Methods inherited from class org.smartfrog.examples.pong.Obstacle
collide, collide, draw, getDimension, getLowerRightBound, getUpperLeftBound, setDimension, setDimension
 
Methods inherited from class org.smartfrog.examples.pong.Mass
getAccel, getMass, getPosition, getSpeed, setAccel, setMass, setPosition, setPosition, setSpeed, setSpeed, toString, updatePosition, updateSpeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Racket

public Racket(int mass,
              java.awt.geom.Point2D initialPosition,
              java.awt.Dimension initialSize)
Constructor.

Parameters:
mass - the mass of the ball
initialPosition - the initial position of the ball
initialSize - the dimwnsion size
Method Detail

elasticCollision

public void elasticCollision(Obstacle obs1,
                             Obstacle obs2,
                             int axis)
Checks if elastic clooision takes palce between obstacle1 and obstacle2 in a given axis.

Overrides:
elasticCollision in class Obstacle
Parameters:
obs1 - obstacle object 1
obs2 - obstacle object 2
axis - the axis

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP