object Vector3 extends Serializable
- Source
- Vector3.scala
- Alphabetic
- By Inheritance
- Vector3
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def CrossProduct(vec1: Vector3, vec2: Vector3): Vector3
For two vectors, find a vector that is simultaneously parallel to both vectors.
The magnitude of the cross product is equal to the product of the magnitudes of both vectors and the sine of the angle between them.For two vectors, find a vector that is simultaneously parallel to both vectors.
The magnitude of the cross product is equal to the product of the magnitudes of both vectors and the sine of the angle between them. If the two original vectors are parallel or antiparallel, the cross product is a zero vector. Due to handiness rules, two non-zero cross product vectors that are antiparallel to each other can be calculated.- vec1
the first vector
- vec2
the second vector
- returns
the cross product
- def Distance(pos1: Vector3, pos2: Vector3): Float
Calculate the actual distance between two points.
Calculate the actual distance between two points.
- pos1
the first point
- pos2
the second point
- returns
the distance
- def DistanceSquared(pos1: Vector3, pos2: Vector3): Float
Calculate the squared distance between two points.
Calculate the squared distance between two points. Though some time is saved care must be taken that any comparative distance is also squared.
- pos1
the first point
- pos2
the second point
- returns
the distance
- def DotProduct(vec1: Vector3, vec2: Vector3): Float
Given two vectors, find their dot product.
The dot product is the sum of the products of the corresponding component parts of two vectors.Given two vectors, find their dot product.
The dot product is the sum of the products of the corresponding component parts of two vectors. It is equal to the product of the Euclidean magnitude of the vectors and cosine of the angle between them. If the dot product of two vectors of non-zero magnitude is 0, then the vectors are perpendicular to each other.- vec1
the first vector
- vec2
the second vector
- returns
the dot product
- def Magnitude(vec: Vector3): Float
Calculate the actual magnitude of a vector.
Calculate the actual magnitude of a vector.
- vec
the vector
- returns
the magnitude
- def MagnitudeSquared(vec: Vector3): Float
Calculate the squared magnitude of a vector.
Calculate the squared magnitude of a vector. Though some time is saved care must be taken that any comparative magnitude is also squared.
- vec
the vector
- returns
the magnitude
- def PlanarRotateAroundPoint(point: Vector3, axis: Vector3, radians: Float): Vector3
Perform a standard z-axis rotation of a
Vector3
element representing a point in space around aVector3
element representing a point representing an axis of rotation where the angle of rotation is assumed in radians.Perform a standard z-axis rotation of a
Vector3
element representing a point in space around aVector3
element representing a point representing an axis of rotation where the angle of rotation is assumed in radians. This follows number circle rotation (counterclockwise) instead of compass rose rotation (clockwise). It can not be substituted with(Rz(point - axis, radians) + center).xy + z(point.z)
.- point
a mathematical vector representing a point in space
- axis
a mathematical vector representing an axis of rotation
- radians
a rotation angle, in radians
- returns
the rotated point
- See also
Vector3.Rz(Vector3, Double)
- def Rx(vec: Vector3, ang: Double): Vector3
Perform the x-axis rotation of a
Vector3
element where the angle of rotation is assumed in radians.Perform the x-axis rotation of a
Vector3
element where the angle of rotation is assumed in radians.- vec
a mathematical vector representing direction
- ang
a rotation angle, in radians
- returns
the rotated vector
- See also
Vector3.Rx(Vector3, Float)
- def Rx(vec: Vector3, ang: Float): Vector3
Perform the x-axis rotation of a
Vector3
element where the angle of rotation is assumed in degrees.Perform the x-axis rotation of a
Vector3
element where the angle of rotation is assumed in degrees.- vec
a mathematical vector representing direction
- ang
a rotation angle, in degrees
- returns
the rotated vector
- See also
Vector3.RxRadians(Vector3, Double)
- def Ry(vec: Vector3, ang: Double): Vector3
Perform the y-axis rotation of a
Vector3
element where the angle of rotation is assumed in radians.Perform the y-axis rotation of a
Vector3
element where the angle of rotation is assumed in radians.- vec
a mathematical vector representing direction
- ang
a rotation angle, in radians
- returns
the rotated vector
- See also
Vector3.Ry(Vector3, Float)
- def Ry(vec: Vector3, ang: Float): Vector3
Perform the y-axis rotation of a
Vector3
element where the angle of rotation is assumed in degrees.Perform the y-axis rotation of a
Vector3
element where the angle of rotation is assumed in degrees.- vec
a mathematical vector representing direction
- ang
a rotation angle, in degrees
- returns
the rotated vector
- See also
Vector3.Ry(Vector3, Double)
- def Rz(vec: Vector3, ang: Double): Vector3
Perform the z-axis rotation of a
Vector3
element where the angle of rotation is assumed in radians.Perform the z-axis rotation of a
Vector3
element where the angle of rotation is assumed in radians.- vec
a mathematical vector representing direction
- ang
a rotation angle, in radians
- returns
the rotation vector
- See also
Vector3.Rz(Vector3, Float)
- def Rz(vec: Vector3, ang: Float): Vector3
Perform the z-axis rotation of a
Vector3
element where the angle of rotation is assumed in degrees.Perform the z-axis rotation of a
Vector3
element where the angle of rotation is assumed in degrees.- vec
a mathematical vector representing direction
- ang
a rotation angle, in degrees
- returns
the rotated vector
- See also
Vector3.Rz(Vector3, Double)
- def ScalarProjection(vec1: Vector3, vec2: Vector3): Float
Given two vectors, find the scalar value of the projection of one vector on the other.
The value of the resulting scalar is the magnitude of the vector resulting from a vector projection ofvec1
ontovec2
.Given two vectors, find the scalar value of the projection of one vector on the other.
The value of the resulting scalar is the magnitude of the vector resulting from a vector projection ofvec1
ontovec2
. For perpendicular vectors, the scalar projection result will be the same as the dot product result - zero. A positive value indicates a projected vector in the same direction asvec2
; a negative value indicates an antiparallel vector.- vec1
the vector being projected
- vec2
the vector projected onto
- returns
the magnitude of the resulting projected vector
- See also
VectorProjection
- def Unit(vec: Vector3): Vector3
Given a vector, find that's vector's unit vector.
A unit vector is a vector in the direction of the original vector but with a magnitude of 1.Given a vector, find that's vector's unit vector.
A unit vector is a vector in the direction of the original vector but with a magnitude of 1.- vec
the original vector
- returns
the unit vector; if the original vector has no magnitude, a zero-vector is returned
- def VectorProjection(vec1: Vector3, vec2: Vector3): Vector3
Given two vectors, find the projection of one vector on the other.
The vector projection ofvec1
onvec2
produces a vector that is the direction of (parallel to)vec2
with a magnitude equal to the product ofvec1
and the cosine of the angle between the two vectors.Given two vectors, find the projection of one vector on the other.
The vector projection ofvec1
onvec2
produces a vector that is the direction of (parallel to)vec2
with a magnitude equal to the product ofvec1
and the cosine of the angle between the two vectors.- vec1
the vector being projected
- vec2
the vector projected onto
- returns
the resulting projected vector
- See also
ScalarProjection
- final val Zero: Vector3
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- implicit val codec_float: Codec[Vector3]
- implicit val codec_pos: Codec[Vector3]
- implicit val codec_vel: Codec[Vector3]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def midpoint(p1: Vector3, p2: Vector3): Vector3
Find the center between two points.
Find the center between two points.
- p1
the first point
- p2
the second point
- returns
the point that is the mean position directly between the first point and the second point
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def neg(v: Vector3): Vector3
Calculate the negation of this vector, the same vector in the antiparallel direction.
Calculate the negation of this vector, the same vector in the antiparallel direction.
- v
the original vector
- returns
the negation of the original vector
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def relativeUp(orient: Vector3, up: Vector3): Vector3
Given a
Vector3
element composed of Euler angles and aVector3
element in the vector direction of "up", find a standard unit vector that points in the direction of the entity's "up" after rotating by the Euler angles.Given a
Vector3
element composed of Euler angles and aVector3
element in the vector direction of "up", find a standard unit vector that points in the direction of the entity's "up" after rotating by the Euler angles. Compass direction rules apply for the z-axis (North is 0 degrees, East is 90 degrees, etc.).- orient
three Euler angles representing rotation
- up
a mathematical vector representing "up"
- returns
a mathematical vector representing a relative "up" direction
- See also
Vector3.Rx(Float)
Vector3.Ry(Float)
Vector3.Rz(Float)
- def relativeUp(orient: Vector3): Vector3
Given a
Vector3
element composed of Euler angles, find a standard unit vector that points in the direction of "up" after rotating by the Euler angles.Given a
Vector3
element composed of Euler angles, find a standard unit vector that points in the direction of "up" after rotating by the Euler angles. Compass direction rules apply (North is 0 degrees, East is 90 degrees, etc.).- orient
three Euler angles representing rotation
- returns
a mathematical vector representing a relative "up" direction
- See also
Vector3.relativeUp(Vector3, Vector3)
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def z(value: Float): Vector3
A common vector object that only concerns itself with rotation around the world-up axis or the "world up" coordinate direction.
A common vector object that only concerns itself with rotation around the world-up axis or the "world up" coordinate direction.
- value
the third coordinate
- returns
a
Vector3
object