Expand description
Vec2, 3 and4, Quat and Matrix, Bounds, Plane and Ray related structs, enums and functions.
§Examples
which are also unit tests:
Modules§
Structs§
- Bounds
- Bounds is an axis aligned bounding box type that can be used for storing the sizes of objects, calculating containment, intersections, and more!
- Plane
- Planes are really useful for collisions, intersections, and visibility testing!
- Pose
- Pose represents a location and orientation in space, excluding scale! The default value of a Pose use Pose.Identity . https://stereokit.net/Pages/StereoKit/Pose.html
- Quat
- Quaternions are efficient and robust mathematical objects for representing rotations! Understanding the details of how a quaternion works is not generally necessary for using them effectively, so don’t worry too much if they seem weird to you. They’re weird to me too.
- Ray
- A position and a direction indicating a ray through space! This is a great tool for intersection testing with geometrical shapes. https://stereokit.net/Pages/StereoKit/Ray.html
- Rect
- A pretty straightforward 2D rectangle, defined by the top left corner of the rectangle, and its width/height. https://stereokit.net/Pages/StereoKit/Rect.html
- Sphere
- Represents a sphere in 3D space! Composed of a center point and a radius, can be used for raycasting, collision, visibility, and other things! https://stereokit.net/Pages/StereoKit/Sphere.html
- Vec2
- A vector with 2 components: x and y. This can represent a point in 2D space, a directional vector, or any other sort of value with 2 dimensions to it! https://stereokit.net/Pages/StereoKit/Vec2.html
- Vec3
- A vector with 3 components: x, y, z. This can represent a point in space, a directional vector, or any other sort of value with 3 dimensions to it!
- Vec4
- A vector with 4 components: x, y, z, and w. Can be useful for things like shaders, where the registers are aligned to 4 float vectors.
Functions§
- angle_
dist - Calculates the minimum angle ‘distance’ between two angles. This covers wraparound cases like: the minimum distance between 10 and 350 is 20. https://stereokit.net/Pages/StereoKit/SKMath/AngleDist.html
- bounds_
capsule_ ⚠contains - bounds_
grow_ ⚠to_ fit_ box - bounds_
grow_ ⚠to_ fit_ pt - bounds_
line_ ⚠contains - bounds_
point_ ⚠contains - bounds_
ray_ ⚠intersect - bounds_
transform ⚠ - lerp
- Blends (Linear Interpolation) between two scalars, based on a ‘blend’ value, where 0 is a, and 1 is b. Doesn’t clamp percent for you. https://stereokit.net/Pages/StereoKit/SKMath/Lerp.html
- matrix_
decompose ⚠ - matrix_
extract_ ⚠pose - matrix_
extract_ ⚠rotation - matrix_
extract_ ⚠scale - matrix_
extract_ ⚠translation - matrix_
inverse ⚠ - matrix_
invert ⚠ - matrix_
mul ⚠ - matrix_
mul_ ⚠direction - matrix_
orthographic ⚠ - matrix_
perspective ⚠ - matrix_
r ⚠ - matrix_
s ⚠ - matrix_
t ⚠ - matrix_
to_ ⚠angles - matrix_
transform_ ⚠dir - matrix_
transform_ ⚠pose - matrix_
transform_ ⚠pt - matrix_
transform_ ⚠pt4 - matrix_
transform_ ⚠quat - matrix_
transform_ ⚠ray - matrix_
transpose ⚠ - matrix_
trs ⚠ - matrix_
trs_ ⚠out - matrix_
ts ⚠ - plane_
from_ ⚠points - plane_
from_ ⚠ray - plane_
line_ ⚠intersect - plane_
point_ ⚠closest - plane_
ray_ ⚠intersect - pose_
matrix_ ⚠out - quat_
difference ⚠ - quat_
from_ ⚠angles - quat_
inverse ⚠ - quat_
lookat ⚠ - quat_
lookat_ ⚠up - quat_
mul ⚠ - quat_
mul_ ⚠vec - quat_
normalize ⚠ - quat_
slerp ⚠ - quat_
to_ ⚠axis_ angle - ray_
from_ ⚠mouse - ray_
intersect_ ⚠plane - ray_
point_ ⚠closest - sphere_
point_ ⚠contains - sphere_
ray_ ⚠intersect - vec3_
cross ⚠
Type Aliases§
- Bool32T
- Native code use this as bool
Unions§
- Matrix
- A Matrix in StereoKit is a 4x4 grid of numbers that is used to represent a transformation for any sort of position or vector! This is an oversimplification of what a matrix actually is, but it’s accurate in this case.