ncsa.j3d
Class CollidableTransformGroup
java.lang.Object
|
+--javax.media.j3d.SceneGraphObject
|
+--javax.media.j3d.Node
|
+--javax.media.j3d.Group
|
+--javax.media.j3d.TransformGroup
|
+--ncsa.j3d.SimpleTransformGroup
|
+--ncsa.j3d.PickableTransformGroup
|
+--ncsa.j3d.CollidableTransformGroup
- public class CollidableTransformGroup
- extends PickableTransformGroup
This PickableTransformGroup extension adds collision detection and
reporting.
This is implemented using the the WakeupCriterions. Specifically
WakeupOnCollisionEntry, WakeupOnCollsionExit, WakeupOnCollisionMovement.
The receiver is specified in the constructor or set using setReceiver will
receive an ncsa.j3d.ui.events.CollisionEvent upon collision entry and
exit. Movement is currently not reported but is supported in the code.
See CollisionEvent for description of fields.
Fields inherited from class javax.media.j3d.TransformGroup |
ALLOW_TRANSFORM_READ,
ALLOW_TRANSFORM_WRITE |
Fields inherited from class javax.media.j3d.Group |
ALLOW_CHILDREN_EXTEND,
ALLOW_CHILDREN_READ,
ALLOW_CHILDREN_WRITE,
ALLOW_COLLISION_BOUNDS_READ,
ALLOW_COLLISION_BOUNDS_WRITE |
Fields inherited from class javax.media.j3d.Node |
ALLOW_AUTO_COMPUTE_BOUNDS_READ,
ALLOW_AUTO_COMPUTE_BOUNDS_WRITE,
ALLOW_BOUNDS_READ,
ALLOW_BOUNDS_WRITE,
ALLOW_COLLIDABLE_READ,
ALLOW_COLLIDABLE_WRITE,
ALLOW_LOCAL_TO_VWORLD_READ,
ALLOW_PICK,
ALLOW_PICKABLE_READ,
ALLOW_PICKABLE_WRITE,
ENABLE_COLLISION_REPORTING,
ENABLE_PICK_REPORTING |
Method Summary |
java.lang.String |
getDescription()
Returns a string describing the object. |
void |
setDescription(java.lang.String string)
Allows the description to be modified. |
boolean |
setReceiver(java.lang.Object ser)
Allows the object to notify on collision to be modified. |
void |
signal(int value)
Signals that an event(collision) has occured. |
Methods inherited from class ncsa.j3d.SimpleTransformGroup |
get,
get,
get,
move,
move,
reset,
rotX,
rotY,
rotZ,
scale,
scale,
set,
set,
set,
set,
set |
Methods inherited from class javax.media.j3d.TransformGroup |
cloneNode,
duplicateNode,
getTransform,
setTransform |
Methods inherited from class javax.media.j3d.Group |
addChild,
getAllChildren,
getAlternateCollisionTarget,
getChild,
getCollisionBounds,
insertChild,
moveTo,
numChildren,
removeChild,
setAlternateCollisionTarget,
setChild,
setCollisionBounds |
Methods inherited from class javax.media.j3d.Node |
cloneTree,
cloneTree,
cloneTree,
getBounds,
getBoundsAutoCompute,
getCollidable,
getLocalToVworld,
getLocalToVworld,
getParent,
getPickable,
setBounds,
setBoundsAutoCompute,
setCollidable,
setPickable |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability,
getCapability,
getUserData,
isCompiled,
isLive,
setCapability,
setUserData |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
CollidableTransformGroup
public CollidableTransformGroup(javax.vecmath.Vector3f initial,
PortfolioEventReceiver receiver,
java.lang.String desc)
- Allows the object to have an initial(permanent) offset and default object to
notify on collision, and a string describing the group.
- Parameters:
initial
- the inital and irrevocable transformreceiver
- the object to report the collision todesc
- a string describing this group
CollidableTransformGroup
public CollidableTransformGroup(PortfolioEventReceiver receiver)
- Allows specification of the object to notify when a collision event occurs.
- Parameters:
receiver
- The object to report the collision to.
CollidableTransformGroup
public CollidableTransformGroup(PortfolioEventReceiver receiver,
java.lang.String desc)
- Allows specification of the object to notify when a collision event occurs.
Allows a string description to be given to the TransformGroup.
- Parameters:
receiver
- The object to report the collision to.desc
- A string describing this group.
setReceiver
public boolean setReceiver(java.lang.Object ser)
- Allows the object to notify on collision to be modified.
- Parameters:
Object
- the object to notify.
getDescription
public java.lang.String getDescription()
- Returns a string describing the object.
- Returns:
- A string describing the object.
setDescription
public void setDescription(java.lang.String string)
- Allows the description to be modified.
- Parameters:
String
- The new description.
signal
public void signal(int value)
- Signals that an event(collision) has occured.
This method notifies the reciever of the collision. i.e. It sends a
CollsionEvent object to the receiver.
- Parameters:
int
- A value describing the incident.
NCSA Portfolio, Copyright 1997-1999, National Center for Supercomputing Applications, University of Illinois Urbana-Champaign, All Rights Reserved