functions Methods 23

Abs ()
Vector3
Returns a new vector with all values positive. -5 becomes 5, etc.
AddClamped (toAdd, maxLength)
Vector3
Try to add to this vector. If we're already over max then don't add. If we're over max when we add, clamp in that direction so we're not.
AlmostEqual (v, delta)
bool
Returns true if we're nearly equal to the passed vector.
Angle (other)
float
Return the distance between the two direction vectors in degrees.
Approach (length, amount)
Vector3
Returns a new vector whose length is closer to given target length by given amount.
Clamp (otherMin, otherMax)
Vector3
Returns a vector each axis of which is clamped to between the 2 given vectors. Basically clamps a point to an Axis Aligned Bounding Box (AABB).
ClampLength (maxLength)
Vector3
Returns a vector whose length is limited to given maximum.
ComponentMax (other)
Vector3
Returns a vector that has the maximum values on each axis between this vector and given vector.
ComponentMin (other)
Vector3
Returns a vector that has the minimum values on each axis between this vector and given vector.
Distance (target)
float
Returns distance between this vector to given vector.
DistanceSquared (target)
float
Returns squared distance between this vector to given vector. This is faster than Distance, and can be used for things like comparing distances, as long as only squared values are used.
IsNearlyZero (tolerance)
bool
Returns true if value on every axis is less than tolerance away from zero
LerpTo (target, frac, clamp)
Vector3
Performs linear interpolation between this and given vectors.
ProjectOnNormal (normal)
Vector3
Projects this vector onto another vector. Basically extends the given normal/unit vector to be as long as necessary to make a right triangle (a triangle which has a 90 degree corner) between (0,0,0), this vector and the projected vector.
RotateAround (center, rot)
Vector3
Rotate this vector around given point by given rotation and return the result as a new vector.
See Transform.RotateAround(Vector3@,Rotation@) for similar method that also transforms rotation.
SlerpTo (target, frac, clamp)
Vector3
Performs spherical linear interpolation (Slerp) between this vector and a target vector.
SnapToGrid (gridSize, sx, sy, sz)
Vector3
Snap to grid along any of the 3 axes.
SubtractDirection (direction, strength)
Vector3
Given a vector like 1,1,1 and direction 1,0,0, will return 0,1,1. This is useful for velocity collision type events, where you want to cancel out velocity based on a normal. For this to work properly, direction should be a normal, but you can scale how much you want to subtract by scaling the direction. Ie, passing in a direction with a length of 0.5 will remove half the direction.
WithAcceleration (target, acceleration)
Vector3
Move to the target vector, by amount acceleration
WithFriction (frictionAmount, stopSpeed)
Vector3
Apply an amount of friction to the current velocity.
WithX (x)
Vector3
Returns this vector with given X component.
WithY (y)
Vector3
Returns this vector with given Y component.
WithZ (z)
Vector3
Returns this vector with given Z component.

functions Static Methods 22

CatmullRomSpline (p0, p1, p2, p3, t)
Vector3
Calculates a point on a Catmull-Rom spline given four control points and a parameter t.
Cross (a, b)
Vector3
Returns the cross product of the 2 given vectors. If the given vectors are linearly independent, the resulting vector is perpendicular to them both, also known as a normal of a plane.
CubicBezier (source, target, sourceTangent, targetTangent, t)
Vector3
Calculates position of a point on a cubic beizer curve at given fraction.
Direction (from, to)
Vector3
Calculates the normalized direction vector from one point to another in 3D space.
DistanceBetween (a, b)
float
Returns distance between the 2 given vectors.
DistanceBetweenSquared (a, b)
float
Returns squared distance between the 2 given vectors. This is faster than DistanceBetween, and can be used for things like comparing distances, as long as only squared values are used.
Dot (a, b)
float
Returns the scalar/dot product of the 2 given vectors.
GetAngle (v1, v2)
float
Return the distance between the two direction vectors in degrees.
InverseLerp (pos, a, b, clamp)
float
Given a position, and two other positions, calculate the inverse lerp position between those
Lerp (a, b, frac, clamp)
Vector3
Performs linear interpolation between 2 given vectors.
Max (a, b)
Vector3
Returns a vector that has the maximum values on each axis between the 2 given vectors.
Min (a, b)
Vector3
Returns a vector that has the minimum values on each axis between the 2 given vectors.
Parse (str, provider)
Vector3
Reflect (direction, normal)
Vector3
Returns a reflected vector based on incoming direction and plane normal. Like a ray reflecting off of a mirror.
Slerp (a, b, frac, clamp)
Vector3
Performs spherical linear interpolation (Slerp) between two vectors.
SmoothDamp (current, target, velocity, smoothTime, deltaTime)
Vector3
Smoothly move towards the target vector
Sort (min, max)
Sort these two vectors into min and max. This doesn't just swap the vectors, it sorts each component. So that min will come out containing the minimum x, y and z values.
SpringDamp (current, target, velocity, deltaTime, frequency, damping)
Vector3
Springly move towards the target vector
TcbSpline (p0, p1, p2, p3, tension, continuity, bias, u)
Vector3
Calculates an interpolated point using the Kochanek-Bartels spline (TCB spline).
TryParse (str, result)
bool
VectorAngle (vec)
Angles
Converts a direction vector to an angle.
VectorPlaneProject (v, planeNormal)
Vector3
Projects given vector on a plane defined by .
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.