Skip to content
Chuck Walbourn edited this page Nov 3, 2015 · 3 revisions

Ray class modeled after the XNA Game Studio 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 8.1 Store apps
  • Windows desktop apps
  • Windows 7 Service Pack 1
  • Windows Vista Service Pack 2 with KB971644
  • Windows phone 8.1
  • Xbox One

For Development

  • Visual Studio 2015
  • Visual Studio 2013
  • Xbox One XDK

Related Projects

DirectX Tool Kit for DirectX 12

DirectXMesh

DirectXTex

DirectXMath

Content Exporter

Win2D

Clone this wiki locally