True Axis Physics SDK 1.2.0.1 Beta Documentation
www.trueaxis.com

PhysicsRender.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------------
00002 // File Name: PhysicsRender.h
00003 // Description:
00006 //
00007 // Copyright (C) 2004 - 2006 True Axis Pty Ltd, Australia. 
00008 // All Rights Reserved.
00009 //
00010 // History:
00011 //      Created File.
00012 //---------------------------------------------------------------------------------
00013 
00014 #ifndef TA_PHYSICSRENDER_H
00015 #define TA_PHYSICSRENDER_H
00016 
00017 #ifndef TA_TYPES_H
00018 #include "../Common/Types.h"
00019 #endif // TA_TYPES_H
00020 
00021 #ifndef TA_PHYSICSCOMMON_H
00022 #include "PhysicsCommon.h"
00023 #endif // TA_PHYSICSCOMMON_H
00024 
00025 TA_OBFUSCATION_SKIP_PASS_2
00026 
00027 namespace TA
00028 {
00029 
00030 struct Vec3;
00031 struct MFrame;
00032 
00033 class TAPHYSICS_CLASS PhysicsRender
00034 {
00035 public:
00036     TA_OBFUSCATION_RESERVED_ON
00037 
00038     typedef void (TAC_CALL *RenderLineCallBack)(const Vec3& v3PosA, const Vec3& v3PosB, u32 nColour);
00039     typedef void (TAC_CALL *RenderArrowCallBack)(const Vec3& v3Pos, const Vec3& v3Vector, u32 nColour);
00040     typedef void (TAC_CALL *RenderPolygonCallBack)(int nNumVertices, const Vec3* pv3VertexList, const Vec3* pv3NormalList);
00041 
00042     static inline void TAC_CALL RenderLine(
00043         const Vec3& v3PosA, 
00044         const Vec3& v3PosB,
00045         u32 nColour = 0xFFFFFFFF);
00046     static inline void TAC_CALL RenderArrow(
00047         const Vec3& v3Pos, 
00048         const Vec3& v3Vector,
00049         u32 nColour = 0xFFFFFFFF);
00050     static inline void TAC_CALL RenderPolygon(
00051         int nNumVertices,
00052         const Vec3* pv3VertexList,
00053         const Vec3* pv3NormalList);
00054     static inline void TAC_CALL SetRenderLineCallback(
00055         RenderLineCallBack pRenderLineCallBack);
00056     static inline void TAC_CALL SetRenderArrowCallback(
00057         RenderArrowCallBack pRenderArrowCallBack);
00058     static inline void TAC_CALL SetRenderPolygonCallback(
00059         RenderPolygonCallBack pRenderPolygonCallBack);
00060     static void TAC_CALL PhysicsRender::RenderBox(
00061         const MFrame& mFrame,
00062         const Vec3& v3Center,
00063         const Vec3& v3Extent,
00064         u32 nColour);
00065     TA_OBFUSCATION_RESERVED_OFF
00066 
00067 
00068 private:
00069     static RenderLineCallBack s_pRenderLineCallBack;
00070     static RenderArrowCallBack s_pRenderArrowCallBack;
00071     static RenderPolygonCallBack s_pRenderPolygonCallBack;  
00072 };
00073 
00074 
00075 //---------------------------------------------------------------------------------
00076 //---------------------------------------------------------------------------------
00077 inline void TAC_CALL PhysicsRender::RenderLine(
00078     const Vec3& v3PosA, 
00079     const Vec3& v3PosB,
00080     u32 nColour)
00081 {
00082     if (s_pRenderLineCallBack)
00083         s_pRenderLineCallBack(v3PosA, v3PosB, nColour);
00084 }
00085 
00086 //---------------------------------------------------------------------------------
00087 //---------------------------------------------------------------------------------
00088 inline void TAC_CALL PhysicsRender::RenderArrow(
00089     const Vec3& v3Pos, 
00090     const Vec3& v3Vector,
00091     u32 nColour)
00092 {
00093     if (s_pRenderArrowCallBack)
00094         s_pRenderArrowCallBack(v3Pos, v3Vector, nColour);
00095 }
00096 
00097 //---------------------------------------------------------------------------------
00098 //--------------------------------------------------------------------------------- 
00099 inline void TAC_CALL PhysicsRender::RenderPolygon(
00100     int nNumVertices,
00101     const Vec3* pv3VertexList,
00102     const Vec3* pv3NormalList)
00103 {
00104     if (s_pRenderPolygonCallBack)
00105         s_pRenderPolygonCallBack(nNumVertices, pv3VertexList, pv3NormalList);
00106 }
00107 
00108 //---------------------------------------------------------------------------------
00109 //---------------------------------------------------------------------------------
00110 inline void TAC_CALL PhysicsRender::SetRenderLineCallback(
00111     RenderLineCallBack pRenderLineCallBack)
00112 {
00113     s_pRenderLineCallBack = pRenderLineCallBack;
00114 }
00115 
00116 //---------------------------------------------------------------------------------
00117 //---------------------------------------------------------------------------------
00118 inline void TAC_CALL PhysicsRender::SetRenderArrowCallback(
00119     RenderArrowCallBack pRenderArrowCallBack)
00120 {
00121     s_pRenderArrowCallBack = pRenderArrowCallBack;
00122 }
00123 
00124 //---------------------------------------------------------------------------------
00125 //---------------------------------------------------------------------------------
00126 inline void TAC_CALL PhysicsRender::SetRenderPolygonCallback(
00127     RenderPolygonCallBack pRenderPolygonCallBack)
00128 {
00129     s_pRenderPolygonCallBack = pRenderPolygonCallBack;
00130 }
00131     
00132 
00133 }
00134 
00135 #endif // TA_PHYSICSRENDER_H


© Copyright 2004-2006 TRUE AXIS PTY LTD Australia. All rights reserved.