gwnavruntime/math/triangle3f.h Source File

triangle3f.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 // primary contact: MAMU - secondary contact: NOBODY
9 #ifndef Navigation_Triangle3f_H
10 #define Navigation_Triangle3f_H
11 
13 
14 
15 namespace Kaim
16 {
17 
18 
21 class Triangle3f
22 {
23  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
24 
25 public:
26  // ---------------------------------- Public Member Functions ----------------------------------
27 
32  void Set(const Vec3f& _a, const Vec3f& _b, const Vec3f& _c) { A = _a; B = _b; C = _c; }
33 
35  Vec3f& operator[](KyInt32 i) { return (&A)[i]; }
36 
38  const Vec3f& operator[](KyInt32 i) const { return (&A)[i]; }
39 
40 
41  // ---------------------------------- Public Data Members ----------------------------------
42 
43  Vec3f A;
44  Vec3f B;
45  Vec3f C;
46 };
47 
50 inline void SwapEndianness(Endianness::Target e, Triangle3f& self)
51 {
52  SwapEndianness(e, self.A);
53  SwapEndianness(e, self.B);
54  SwapEndianness(e, self.C);
55 }
56 
57 
58 }
59 
60 
61 #endif
62 
Vec3f & operator[](KyInt32 i)
Retrieves the coordinates of the specified corner of the triangle. Use only [0], [1], or [2].
Definition: triangle3f.h:41
Vec3f B
The position of the second corner of the triangle.
Definition: triangle3f.h:54
This class represents a triangle in three-dimensional space, whose dimensions are stored using float ...
Definition: triangle3f.h:22
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
void Set(const Vec3f &_a, const Vec3f &_b, const Vec3f &_c)
Sets the coordinates of the three points that make up the triangle.
Definition: triangle3f.h:38
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
Vec3f A
The position of the first corner of the triangle.
Definition: triangle3f.h:53
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
Vec3f C
The position of the third corner of the triangle.
Definition: triangle3f.h:55
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23