Class iicm.utils3d.Vec3f
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iicm.utils3d.Vec3f

java.lang.Object
   |
   +----iicm.utils3d.Vec3f

public final class Vec3f
extends Object
Vec3f - small utilities for 3D vectors. Copyright (c) 1997 IICM

Variable Index

 o value_
3D vector of values
 o X
 o Y
 o Z

Constructor Index

 o Vec3f()
constructor (0, 0, 0)
 o Vec3f(float, float, float)
constructor (x, y, z)
 o Vec3f(float[])
constructor (a[0], a[1], a[2]).

Method Index

 o assign(float, float, float)
assignment (x, y, z)
 o assign(float[])
assignment (a[0], a[1], a[2]).
 o assign(Vec3f)
assignment (copying, v = b)
 o cross(float[], float[])
 o cross(Vec3f, Vec3f)
assign cross product a X b to this vector.
 o decrease(float[])
 o decrease(Vec3f)
decrease (v -= b)
 o dot(float[], float[])
 o dot(Vec3f, Vec3f)
dot product.
 o getOrthogonalVector(float[], float[])
find a vector that is orthogonal to non-zero vector v.
 o getRotationAngle(Vec3f)
get the angle which the xy plane must be rotatated about the Y-axis (unchanged) such that the new normal vector (Z-axis) points towards start
 o increase(float[])
 o increase(Vec3f)
increase (v += b)
 o negate()
negate (v = -v)
 o normalize()
normalize.
 o print(float[])
print a 3D float array (debugging tool)
 o rayat(float[], float, float[])
ray equation (a + t * b)
 o scale(float)
scale by a scalar
 o scale(float[], float)
 o sincrease(float, float[])
 o sincrease(float, Vec3f)
sincrease (v += f * b).
 o slerpNorm(float[], int, float[], int, float, float[], int)
spherical linear interpolation of 3D vector.
 o toString()
conversion to string: "(x, y, z)".

Variables

 o value_
  public float value_[]
3D vector of values
 o X
  public final static int X
 o Y
  public final static int Y
 o Z
  public final static int Z

Constructors

 o Vec3f
  public Vec3f()
constructor (0, 0, 0)
 o Vec3f
  public Vec3f(float x,
               float y,
               float z)
constructor (x, y, z)
 o Vec3f
  public Vec3f(float a[])
constructor (a[0], a[1], a[2]). values are copied into internal array.

Methods

 o assign
  public void assign(float x,
                     float y,
                     float z)
assignment (x, y, z)
 o assign
  public void assign(float a[])
assignment (a[0], a[1], a[2]). values are copied into internal array.
 o assign
  public void assign(Vec3f b)
assignment (copying, v = b)
 o negate
  public void negate()
negate (v = -v)
 o increase
  public void increase(Vec3f b)
increase (v += b)
 o increase
  public void increase(float w[])
 o decrease
  public void decrease(Vec3f b)
decrease (v -= b)
 o decrease
  public void decrease(float w[])
 o sincrease
  public void sincrease(float f,
                        Vec3f b)
sincrease (v += f * b). increase by a scaled vector
 o sincrease
  public void sincrease(float f,
                        float w[])
 o rayat
  public void rayat(float a[],
                    float t,
                    float b[])
ray equation (a + t * b)
 o scale
  public void scale(float f)
scale by a scalar
 o scale
  public static void scale(float v[],
                           float f)
 o dot
  public static float dot(Vec3f a,
                          Vec3f b)
dot product. < a . b > E.g. dot (a, a) is the square norm of a
 o dot
  public static float dot(float u[],
                          float v[])
 o cross
  public void cross(Vec3f a,
                    Vec3f b)
assign cross product a X b to this vector. do not call with "this" as either argument.
 o cross
  public void cross(float u[],
                    float v[])
 o normalize
  public float normalize()
normalize. return old length
 o getOrthogonalVector
  public static void getOrthogonalVector(float v[],
                                         float axis[])
find a vector that is orthogonal to non-zero vector v. write result (normalized) into axis
 o getRotationAngle
  public static float getRotationAngle(Vec3f start)
get the angle which the xy plane must be rotatated about the Y-axis (unchanged) such that the new normal vector (Z-axis) points towards start
Returns:
angle off rotation
 o slerpNorm
  public static void slerpNorm(float a1[],
                               int a1offs,
                               float a2[],
                               int a2offs,
                               float t,
                               float a[],
                               int aoffs)
spherical linear interpolation of 3D vector. return a vector that lies "at t between a1 and a2", i.e. a1 for t == 0, a2 for t == 1 and an interpolation of a1 and a2 for values between 0 and 1. a1offs and a2offs allow a1 and a2 to start at an offset. result is written at aoffs into array a.
 o toString
  public String toString()
conversion to string: "(x, y, z)". E.g.: System.out.println (v);
Overrides:
toString in class Object
 o print
  public static String print(float v[])
print a 3D float array (debugging tool)

All Packages  Class Hierarchy  This Package  Previous  Next  Index