|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttoxi.geom.Vec3D
toxi.geom.Sphere
public class Sphere
Nested Class Summary |
---|
Nested classes/interfaces inherited from class toxi.geom.Vec3D |
---|
Vec3D.Axis |
Field Summary | |
---|---|
float |
radius
|
Fields inherited from class toxi.geom.Vec3D |
---|
MAX_VALUE, MIN_VALUE, x, X_AXIS, y, Y_AXIS, z, Z_AXIS, ZERO |
Constructor Summary | |
---|---|
Sphere()
|
|
Sphere(float radius)
|
|
Sphere(ReadonlyVec3D v,
float r)
|
|
Sphere(Sphere s)
|
Method Summary | |
---|---|
boolean |
containsPoint(ReadonlyVec3D p)
Checks if the point is within the given shape/volume. |
float[] |
intersectRay(Ray3D ray)
Alternative to SphereIntersectorReflector . |
boolean |
intersectSphereTriangle(Triangle3D t,
Vec3D result)
Considers the current vector as centre of a collision sphere with radius r and checks if the triangle abc intersects with this sphere. |
Vec3D |
tangentPlaneNormalAt(ReadonlyVec3D q)
Calculates the normal vector on the sphere in the direction of the current point. |
Mesh3D |
toMesh(int res)
|
Mesh3D |
toMesh(Mesh3D mesh,
int res)
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public float radius
Constructor Detail |
---|
public Sphere()
public Sphere(float radius)
public Sphere(ReadonlyVec3D v, float r)
public Sphere(Sphere s)
Method Detail |
---|
public boolean containsPoint(ReadonlyVec3D p)
Shape3D
containsPoint
in interface Shape3D
public float[] intersectRay(Ray3D ray)
SphereIntersectorReflector
. Computes primary &
secondary intersection points of this sphere with the given ray. If no
intersection is found the method returns null. In all other cases, the
returned array will contain the distance to the primary intersection
point (i.e. the closest in the direction of the ray) as its first index
and the other one as its second. If any of distance values is negative,
the intersection point lies in the opposite ray direction (might be
useful to know). To get the actual intersection point coordinates, simply
pass the returned values to Ray3D.getPointAtDistance(float)
.
ray
-
public boolean intersectSphereTriangle(Triangle3D t, Vec3D result)
t
- triangle to check for intersectionresult
- a non-null vector for storing the result
public Vec3D tangentPlaneNormalAt(ReadonlyVec3D q)
q
-
public Mesh3D toMesh(int res)
public Mesh3D toMesh(Mesh3D mesh, int res)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |