Skip to content
Chuck Walbourn edited this page Apr 26, 2022 · 8 revisions
DirectXTK SimpleMath

Ray class modeled after the XNA Game Studio 4 (Microsoft.Xna.Framework.Ray) math library.

Header

#include <SimpleMath.h>

Initialization

using namespace DirectX::SimpleMath;

Ray r;                                // Create a ray starting at the origin
                                      // pointing in positive Z
Ray( Vector3(1,2,3), Vector3(0,1,0 ); // Creates a ray at 1,2,3
                                      // pointing in positive Y

Fields

  • position: Position of the ray
  • direction: Direction vector of the ray

Methods

  • Comparison operators: == and !=
  • Intersects: Performs intersection tests of the ray against a collision type, a triangle, or a Plane.

Further reading

Ray

For Use

  • Universal Windows Platform apps
  • Windows desktop apps
  • Windows 11
  • Windows 10
  • Windows 8.1
  • Windows 7 Service Pack 1
  • Xbox One

Architecture

  • x86
  • x64
  • ARM64

For Development

  • Visual Studio 2022
  • Visual Studio 2019 (16.11)
  • clang/LLVM v12 - v18
  • MinGW 12.2, 13.2
  • CMake 3.20

Related Projects

DirectX Tool Kit for DirectX 12

DirectXMesh

DirectXTex

DirectXMath

Win2D

Tools

Test Suite

Model Viewer

Content Exporter

DxCapsViewer

Clone this wiki locally