Trait geo_nd::Geometry3D
source · pub trait Geometry3D<Scalar: Float> {
type Vec3: Vector<Scalar, 3>;
type Vec4: Vector<Scalar, 4>;
type Mat3: SqMatrix3<Self::Vec3, Scalar>;
type Mat4: SqMatrix4<Scalar, Self::Vec3, Self::Vec4>;
type Quat: Quaternion<Scalar, Self::Vec3, Self::Vec4>;
type Trans: Transform<Scalar, Self::Vec3, Self::Vec4, Self::Mat4, Self::Quat>;
}
Expand description
The Geometry3D trait supplies a framework for implementing 3D vector and matrix operations, and should also include the quaternion type.
An implementation of Geometry3D can be used for OpenGL and Vulkan graphics, for example.
Required Associated Types§
sourcetype Vec4: Vector<Scalar, 4>
type Vec4: Vector<Scalar, 4>
The type of a 3D vector with an additional ‘1’ expected in its extra element if it is a position
sourcetype Mat4: SqMatrix4<Scalar, Self::Vec3, Self::Vec4>
type Mat4: SqMatrix4<Scalar, Self::Vec3, Self::Vec4>
The type of a 3D matrix which allows for translations, that can transform Vec4
sourcetype Quat: Quaternion<Scalar, Self::Vec3, Self::Vec4>
type Quat: Quaternion<Scalar, Self::Vec3, Self::Vec4>
The quaternion type that provides for rotations in 3D