Here's the reference file for OCD (Obsessive camera direction). Hopefully this little library will make my life easier when it comes to manipulating the camera with the mouse! This one at least is straight forward =)
Construction
Camera
Camera Switching
feed()
//Multiple feeds could be cool with one of the mouse switches to change them?
Perspective Changes
zoom()
Linear Movements
truck()
boom()
dolly() //moving forward and backward... Scroll wheel?
Instantaneous Changes
aim()
jump()
Rotations
tilt()
pan()
roll()
Arc Movements
arc() //These would be the main movements from the mouseX and Y
circle()
Combinations
tumble()
look() //This could be another effect for the mouse buttons
track()
Infomative
position()
attitude()
target()
up()
fov()
Here is the vec3D library documentation...
public class Vec3D
extends java.lang.Object
Comprehensive 3D vector class with additional basic intersection and collision detection features.
Author:
Karsten Schmidt
Field Summary
static int ON_PLANE
Classifier constant for classifyPoint(Vec3D, Vec3D)
static int PLANE_BACK
Classifier constant for classifyPoint(Vec3D, Vec3D)
static int PLANE_FRONT
Classifier constant for classifyPoint(Vec3D, Vec3D)
float x
X coordinate
static Vec3D X_AXIS
Defines positive X axis
float y
Y coordinate
static Vec3D Y_AXIS
Defines positive Y axis
float z
Z coordinate
static Vec3D Z_AXIS
Defines positive Z axis
Constructor Summary
Vec3D()
Creates a new zero vect `or
Vec3D(float x, float y, float z)
Creates a new vector with the given coordinates
Vec3D(Vec3D v)
Creates a new vector with the coordinates of the given vector
Method Summary
Vec3D add(float a, float b, float c)
Adds vector {a,b,c} and returns result as new vector.
Vec3D add(Vec3D v)
Add vector v and returns result as new vector.
Vec3D addSelf(float a, float b, float c)
Adds vector {a,b,c} and overrides coordinates with result.
Vec3D addSelf(Vec3D v)
Adds vector v and overrides coordinates with result.
float angleBetween(Vec3D v)
Computes the angle between this vector and vector V.
float angleBetween(Vec3D v, boolean forceNormalize)
Computes the angle between this vector and vector V
int classifyPoint(Vec3D pO, Vec3D pN)
Checks and classifies the relative position of the point to the given plane.
Vec3D clear()
Sets all vector components to 0.
Vec3D closestPointOnLine(Vec3D a, Vec3D b)
Helper function for closestPointOnTriangle(Vec3D, Vec3D, Vec3D)
Vec3D closestPointOnTriangle(Vec3D a, Vec3D b, Vec3D c)
Finds and returns the closest point on any of the edges of the given triangle.
Vec3D closestPointTriangle(Vec3D a, Vec3D b, Vec3D c)
Computes the the point closest to the current vector on the surface of triangle abc.
Vec3D constrain(AABB box)
Forcefully fits the vector in the given AABB.
Vec3D copy()
Vec3D cross(Vec3D v)
Calculates cross-product with vector v.
Vec3D crossInto(Vec3D v, Vec3D result)
Calculates cross-product with vector v.
Vec3D crossSelf(Vec3D v)
Calculates cross-product with vector v.
float distanceTo(Vec3D v)
Calculates distance to another vector
float distanceToSquared(Vec3D v)
Calculates the squared distance to another vector
float dot(Vec3D v)
Computes the scalar product (dot product) with the given vector.
static Vec3D fromXYTheta(float theta)
static Vec3D fromXZTheta(float theta)
static Vec3D fromYZTheta(float theta)
Vec3D getConstrained(AABB box)
Creates a copy of the vector which forcefully fits in the given AABB.
Vec3D getInverted()
Scales vector uniformly by factor -1 ( v = -v )
Vec3D getLimited(float lim)
Creates a copy of the vector with its magnitude limited to the length given
Vec3D getNormalized()
Produces the normalized version as a new vector
float headingXY()
Computes the vector's direction in the XY plane (for example for 2D points).
float headingXZ()
Computes the vector's direction in the XZ plane.
float headingYZ()
Computes the vector's direction in the YZ plane.
Vec3D interpolateTo(Vec3D v, float f)
Interpolates the vector towards the given target vector, using linear interpolation
Vec3D interpolateTo(Vec3D v, float f, InterpolateStrategy s)
Interpolates the vector towards the given target vector, using the given InterpolateStrategy
Vec3D interpolateToSelf(Vec3D v, float f)
Interpolates the vector towards the given target vector, using linear interpolation
Vec3D interpolateToSelf(Vec3D v, float f, InterpolateStrategy s)
Interpolates the vector towards the given target vector, using the given InterpolateStrategy
float intersectRayPlane(Vec3D rayDir, Vec3D planeOrigin, Vec3D planeNormal)
Calculates the distance of the vector to the given plane in the specified direction.
float intersectRaySphere(Vec3D rayDir, Vec3D sphereOrigin, float sphereRadius)
Calculates the distance of the vector to the given sphere in the specified direction.
boolean intersectSphereTriangle(float r, Vec3D a, Vec3D b, Vec3D c, 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 invert()
Scales vector uniformly by factor -1 ( v = -v ), overrides coordinates with result
boolean isInAABB(AABB box)
Checks if the point is inside the given AABB.
boolean isInAABB(Vec3D bO, Vec3D bDim)
Checks if the point is inside the given axis-aligned bounding box.
boolean isInSphere(Sphere s)
Checks if the point is inside the given sphere.
boolean isInSphere(Vec3D sO, float sR)
Checks if the point is inside the given sphere.
boolean isInTriangle(Vec3D a, Vec3D b, Vec3D c)
Checks if point vector is inside the triangle created by the points a, b and c.
boolean isZeroVector()
Checks if vector has a magnitude of 0
Vec3D limit(float lim)
Limits the vector's magnitude to the length given
float magnitude()
Calculates the magnitude/eucledian length of the vector
float magSquared()
Calculates only the squared magnitude/length of the vector.
Vec3D normalize()
Normalizes the vector so that its magnitude = 1
static Vec3D randomVector()
Factory method.
Vec3D rotateAroundAxis(Vec3D axis, float theta)
Rotates the vector around the giving axis
Vec3D scale(float s)
Scales vector uniformly and returns result as new vector.
Vec3D scale(float a, float b, float c)
Scales vector non-uniformly and returns result as new vector.
Vec3D scale(Vec3D s)
Scales vector non-uniformly by vector v and returns result as new vector
Vec3D scaleSelf(float s)
Scales vector uniformly and overrides coordinates with result
Vec3D scaleSelf(float a, float b, float c)
Scales vector non-uniformly by vector {a,b,c} and overrides coordinates with result
Vec3D scaleSelf(Vec3D s)
Scales vector non-uniformly by vector v and overrides coordinates with result
Vec3D set(float x, float y, float z)
Overrides coordinates with the given values
Vec3D set(Vec3D v)
Overrides coordinates with the ones of the given vector
Vec3D sub(float a, float b, float c)
Subtracts vector {a,b,c} and returns result as new vector.
Vec3D sub(Vec3D v)
Subtracts vector v and returns result as new vector.
Vec3D subSelf(float a, float b, float c)
Subtracts vector {a,b,c} and overrides coordinates with result.
Vec3D subSelf(Vec3D v)
Subtracts vector v and overrides coordinates with result.
Vec3D tangentPlaneNormalOfEllipsoid(Vec3D eO, Vec3D eR)
Calculates the normal vector on the given ellipsoid in the direction of the current point.
java.lang.String toString()
Yeah....
From what little I understand of that this should be very useful for boids since the functions it returns are basically the very ones that I need to implement the boids pseudo code, ie. returning and changing such things as vector position and vector heading. See, exploring large chunks of code can save time AND be creative! blatant plaguerism therefore is for the unimaginative!
Labels:
Input Device,
Semester 2
Subscribe to:
Post Comments (Atom)
0 comments: