class_vector3 - dragonsoulz/godot GitHub Wiki
Vector3
####Category: Built-In Types
Brief Description
Vector class, which performs basic 3D vector math operations.
Member Functions
- Vector3 abs ( )
- Vector3 cross ( Vector3 b )
- Vector3 cubic_interpolate ( Vector3 b, Vector3 pre_a, Vector3 post_b, float t )
- float distance_squared_to ( Vector3 b )
- float distance_to ( Vector3 b )
- float dot ( Vector3 b )
- Vector3 inverse ( )
- float length ( )
- float length_squared ( )
- Vector3 linear_interpolate ( Vector3 b, float t )
- int max_axis ( )
- int min_axis ( )
- Vector3 normalized ( )
- Vector3 reflect ( Vector3 by )
- Vector3 rotated ( Vector3 axis, float phi )
- Vector3 slide ( Vector3 by )
- Vector3 snapped ( float by )
- void Vector3 ( float x, float y, float z )
Member Variables
Numeric Constants
- AXIS_X = 0
- AXIS_Y = 1
- AXIS_Z = 2
Description
Vector3 is one of the core classes of the engine, and includes several built-in helper functions to perform basic vecor math operations.
Member Function Description
cross
Return the cross product with b.
cubic_interpolate
Perform a cubic interpolation between vectors a,b,c,d (b is current), by the given amount (i).
distance_squared_to
Return the squared distance (distance minus the last square root) to b.
distance_to
Return the distance to b.
dot
Return the dot product with b.
inverse
- Vector3 inverse ( )
Returns the inverse of the vector. this is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )
length
- float length ( )
Return the length of the vector.
length_squared
- float length_squared ( )
Return the length of the vector, without the square root step.
linear_interpolate
Linearly interpolates the vector to a given one (b), by the given amount (i)
normalized
- Vector3 normalized ( )
Return a copy of the normalized vector to unit length. This is the same as v / v.length()
snapped
Return a copy of the vector, snapped to the lowest neared multiple.