MCPcopy Create free account
hub / github.com/EricLengyel/Terathon-Math-Library / MakeRotation

Method MakeRotation

TSMatrix4D.cpp:640–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638}
639
640Transform3D Transform3D::MakeRotation(float angle, const Bivector3D& axis)
641{
642 Vector2D v = CosSin(angle);
643 const float& c = v.x;
644 const float& s = v.y;
645 float d = 1.0F - c;
646
647 float x = axis.x * d;
648 float y = axis.y * d;
649 float z = axis.z * d;
650 float axay = x * axis.y;
651 float axaz = x * axis.z;
652 float ayaz = y * axis.z;
653
654 return (Transform3D(c + x * axis.x, axay - s * axis.z, axaz + s * axis.y, 0.0F,
655 axay + s * axis.z, c + y * axis.y, ayaz - s * axis.x, 0.0F,
656 axaz - s * axis.y, ayaz + s * axis.x, c + z * axis.z, 0.0F));
657}
658
659Transform3D Transform3D::MakeReflection(const Vector3D& a)
660{

Callers

nothing calls this directly

Calls 2

CosSinFunction · 0.85
Transform3DClass · 0.70

Tested by

no test coverage detected