es.ucm.look.ar.math.collision
Class SphericalArmature

java.lang.Object
  extended by es.ucm.look.ar.math.collision.SphericalArmature
All Implemented Interfaces:
Armature
Direct Known Subclasses:
SphericalDebugArmature

public class SphericalArmature
extends java.lang.Object
implements Armature

A Spherical Armature. It's created from a point (sphere's center) and a radius (sphere's radius)


Constructor Summary
SphericalArmature(Point3 center, float radius)
          Constructs a spherical armature from its center and its radius
 
Method Summary
 boolean contains(Point3 p)
          Returns true if the given point is contained by the armature.
 Point3 getIntersectionPoint(Ray r)
          Test whether a ray intersects with the armature.
 float getRadius()
           
 boolean intersects(Ray r)
          Return if the given ray intersects with the armature
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SphericalArmature

public SphericalArmature(Point3 center,
                         float radius)
Constructs a spherical armature from its center and its radius

Parameters:
center - Center point
radius - Sphere radius
Method Detail

contains

public boolean contains(Point3 p)
Description copied from interface: Armature
Returns true if the given point is contained by the armature. false otherwise

Specified by:
contains in interface Armature
Parameters:
p - the point
Returns:
true if the given point is contained by the armature. false otherwise

getIntersectionPoint

public Point3 getIntersectionPoint(Ray r)
Description copied from interface: Armature
Test whether a ray intersects with the armature. If it does, returns the intersection point. If it doesn't, returns null

Specified by:
getIntersectionPoint in interface Armature
Parameters:
r - the ray
Returns:
the intersection point. null if there is no intersection

getRadius

public float getRadius()

intersects

public boolean intersects(Ray r)
Description copied from interface: Armature
Return if the given ray intersects with the armature

Specified by:
intersects in interface Armature
Parameters:
r - the ray
Returns:
true if there is intersection. false otherwise