## Documentation

- Overview
- Website
- Tutorials
- Class Index

## Classes

- _global_
- CL3D
- CL3D.AnimatedMeshSceneNode
- CL3D.Animator
- CL3D.AnimatorAnimateTexture
- CL3D.AnimatorCameraFPS
- CL3D.AnimatorCameraModelViewer
- CL3D.AnimatorCollisionResponse
- CL3D.AnimatorFlyCircle
- CL3D.AnimatorFlyStraight
- CL3D.AnimatorFollowPath
- CL3D.AnimatorOnClick
- CL3D.AnimatorOnProximity
- CL3D.AnimatorRotation
- CL3D.BillboardSceneNode
- CL3D.BoundingBoxTriangleSelector
- CL3D.Box3d
- CL3D.CameraSceneNode
- CL3D.ColorF
- CL3D.CopperCubeVariable
- CL3D.CopperLicht
- CL3D.CubeSceneNode
- CL3D.HotspotSceneNode
- CL3D.Light
- CL3D.LightSceneNode
- CL3D.Line3d
- CL3D.Material
- CL3D.Matrix4
- CL3D.Mesh
- CL3D.MeshBuffer
- CL3D.MeshSceneNode
- CL3D.MeshTriangleSelector
- CL3D.MetaTriangleSelector
- CL3D.Mobile2DInputSceneNode
- CL3D.OctTreeTriangleSelector
- CL3D.Overlay2DSceneNode
- CL3D.ParticleSystemSceneNode
- CL3D.PathSceneNode
- CL3D.Plane3d
- CL3D.Quaternion
- CL3D.Renderer
- CL3D.Scene
- CL3D.SceneNode
- CL3D.SkyBoxSceneNode
- CL3D.SoundSceneNode
- CL3D.TerrainSceneNode
- CL3D.Texture
- CL3D.TextureManager
- CL3D.Triangle3d
- CL3D.TriangleSelector
- CL3D.Vect2d
- CL3D.Vect3d
- CL3D.Vertex3D
- CL3D.WaterSurfaceSceneNode

CopperLicht API Documentation

# Class CL3D.Vect3d

3d vector class with lots of operators and methods

Class Overview
CL3D.Vect3d(x, y, z)
3d vector class with lots of operators and methods. Usually used to store 3d positions and directions.

Parameters:
{Number} x
  x coordinate, can be null.
{Number} y
  y coordinate, can be null.
{Number} z
  z coordinate, can be null.

Field Summary
Field Attributes | Field Name and Description
--- | ---
| X X coordinate of the vector
| Y Y coordinate of the vector
| Z Z coordinate of the vector

Method Summary
Method Attributes | Method Name and Description
--- | ---
| add(other) Adds another vector to this vector and returns a new vector param other {CL3D.Vect3d} other vector
| addToThis(other) Adds another vector to this vector, modifying this vector param other {CL3D.Vect3d} other vector
| clone() Creates a copy of this vector and returns it
| copyTo(tgt) Copies the content of this vector to another vector
| crossProduct(p) returns the cross product of this vector with another vector as new vector.
| divideThisThroughVect(v) Divides each coordinate with the coordinate of another vector, modifying this vector.
| divideThroughVect(v) Divides each coordinate with the coordinate of another vector, returning the result as a new vector.
| dotProduct(other) returns the dot procduct of this vector with another vector
| equals(other) Returns true if this vector equals another vector.
| equalsByNumbers(x, y, z) Returns true if this vector equals x, y, and z given as argument.
| equalsZero() Returns true if this vector equals zero.
| getDistanceFromSQ(v) Returns the squared distance to another point
| getDistanceTo(v) Returns the distance to another point
| getHorizontalAngle() Get the rotations that would make a (0,0,1) direction vector point in the same direction as this direction vector.
| getInterpolated(other, d) returns a new interpolated vector, between this and another vector.
| getLength() Returns the lenght of this vector
| getLengthSQ() Returns the squared lenght of this vector, is faster than Vect3d.getLength.
| getNormalized() Creates a new vector which is the normalized version of this vector (set to a length of 1) param other {CL3D.Vect3d} other vector
| isZero() Returns true if this vector == zero.
| multiplyThisWithScal(v) Multiplies this vector with a scalar value (= a number), modifying this vector
| multiplyThisWithVect(v) Multiplies each coordinate with the coordinate of another vector, modifying this vector.
| multiplyWithScal(v) Multiplies this vector with a scalar value (= a number) and returns the result as a new vector
| multiplyWithVect(v) Multiplies each coordinate with the coordinate of another vector, returning the result as a new vector.
| normalize() Normalizes this vector, setting it to a length of 1, modifying this vector
| rotateXYBy(degrees) Rotates the vector around XY by a specic angle
| rotateXZBy(degrees) Rotates the vector around XZ by a specic angle
| rotateYZBy(degrees) Rotates the vector around YZ by a specic angle
| set(x, y, z) Sets all 3 coordinates to new values
| setLength(n) Sets the lengthh of this vector to the specified value
| setTo(other) Sets all coordinates of this vector to the coordinates of the other vector
| substract(other) Substracts another vector from this vector and returns a new vector param other {CL3D.Vect3d} other vector
| substractFromThis(other) Substracts another vector from this vector, modifying this vector param other {CL3D.Vect3d} other vector
| toString() Returns a string representation of this vector.

Field Detail
{Number} X
X coordinate of the vector

{Number} Y
Y coordinate of the vector

{Number} Z
Z coordinate of the vector
Method Detail
{CL3D.Vect3d} add(other)
Adds another vector to this vector and returns a new vector param other {CL3D.Vect3d} other vector

Parameters:
other

Returns:
  {CL3D.Vect3d} new vector with the result

addToThis(other)
Adds another vector to this vector, modifying this vector param other {CL3D.Vect3d} other vector

Parameters:
other

{Vect3d} clone()
Creates a copy of this vector and returns it

copyTo(tgt)
Copies the content of this vector to another vector

Parameters:
{CL3D.Vect3d} tgt
  Target vector

{CL3D.Vect3d} crossProduct(p)
returns the cross product of this vector with another vector as new vector.

Parameters:
p

Returns:
  {CL3D.Vect3d} a new vector with the result cross product

divideThisThroughVect(v)
Divides each coordinate with the coordinate of another vector, modifying this vector.

Parameters:
v

divideThroughVect(v)
Divides each coordinate with the coordinate of another vector, returning the result as a new vector.

Parameters:
v

dotProduct(other)
returns the dot procduct of this vector with another vector

Parameters:
other

equals(other)
Returns true if this vector equals another vector. Doesn't use the comparison operator but the CL3D.equals function.

Parameters:
other
  {CL3D.Vect3d} other vector

equalsByNumbers(x, y, z)
Returns true if this vector equals x, y, and z given as argument. Doesn't use the comparison operator but the CL3D.equals function.

Parameters:
x
y
z

equalsZero()
Returns true if this vector equals zero. Doesn't use the comparison operator but the CL3D.iszero function.

getDistanceFromSQ(v)
Returns the squared distance to another point

Parameters:
{CL3D.Vect3d} v
  another point

getDistanceTo(v)
Returns the distance to another point

Parameters:
{CL3D.Vect3d} v
  another point

getHorizontalAngle()
Get the rotations that would make a (0,0,1) direction vector point in the same direction as this direction vector. This utility method is very useful for orienting scene nodes towards specific targets. For example, if this vector represents the difference between two scene nodes, then applying the result of getHorizontalAngle() to one scene node will point it at the other one.

getInterpolated(other, d)
returns a new interpolated vector, between this and another vector.

Parameters:
{CL3D.Vect3d} other
  another point or vector
{Number} d
  value between 0 and 1, specifying the interpolation

getLength()
Returns the lenght of this vector

getLengthSQ()
Returns the squared lenght of this vector, is faster than Vect3d.getLength.

{CL3D.Vect3d} getNormalized()
Creates a new vector which is the normalized version of this vector (set to a length of 1) param other {CL3D.Vect3d} other vector

Returns:
  {CL3D.Vect3d} Returns a new vector with the result

isZero()
Returns true if this vector == zero.

multiplyThisWithScal(v)
Multiplies this vector with a scalar value (= a number), modifying this vector

Parameters:
v

multiplyThisWithVect(v)
Multiplies each coordinate with the coordinate of another vector, modifying this vector.

Parameters:
v

multiplyWithScal(v)
Multiplies this vector with a scalar value (= a number) and returns the result as a new vector

Parameters:
v

multiplyWithVect(v)
Multiplies each coordinate with the coordinate of another vector, returning the result as a new vector.

Parameters:
v

normalize()
Normalizes this vector, setting it to a length of 1, modifying this vector

rotateXYBy(degrees)
Rotates the vector around XY by a specic angle

Parameters:
degrees

rotateXZBy(degrees)
Rotates the vector around XZ by a specic angle

Parameters:
degrees

rotateYZBy(degrees)
Rotates the vector around YZ by a specic angle

Parameters:
degrees

set(x, y, z)
Sets all 3 coordinates to new values

Parameters:
x
y
z

setLength(n)
Sets the lengthh of this vector to the specified value

Parameters:
n

setTo(other)
Sets all coordinates of this vector to the coordinates of the other vector

Parameters:
{CL3D.Vect3d} other
  other vector

{CL3D.Vect3d} substract(other)
Substracts another vector from this vector and returns a new vector param other {CL3D.Vect3d} other vector

Parameters:
other

Returns:
  {CL3D.Vect3d} new vector with the result

substractFromThis(other)
Substracts another vector from this vector, modifying this vector param other {CL3D.Vect3d} other vector

Parameters:
other

toString()
Returns a string representation of this vector.

© 2011-2018 N.Gebhardt, Ambiera
Documentation generated by JsDoc Toolkit