OpenBarnyard
 
Loading...
Searching...
No Matches
AWorld.h
Go to the documentation of this file.
1#pragma once
2#include <Render/TMesh.h>
3#include <Math/TVector2.h>
4#include <Math/TVector3.h>
5#include <Math/TPlane.h>
6#include <Math/TSphere.h>
7#include <Math/TMatrix44.h>
8
16
23
30
32{
33 Toshi::TPlane oPlane;
35};
36
43
45{
46public:
47 Frustum();
48
49 void InitReduce();
50 FrustumIntersectSphereResult IntersectSphereReduce( const Toshi::TSphere& a_rSphere );
51
52 void Transform( const Frustum& a_rFrustum, const Toshi::TMatrix44& a_rMatrix );
53
54public:
57 Toshi::TPlane* apActivePlanes[ 6 ];
59};
60
62{
63 Toshi::TVector3 Position;
64 Toshi::TVector3 Normal;
65 Toshi::TVector3 Color;
66 Toshi::TVector2 UV;
67};
68
79
85
87{
89
91 {
92 TASSERT( a_uiIndex < m_uiNumMeshes );
93 return *( (TUINT16*)( this + 1 ) + a_uiIndex );
94 }
95
97 {
98 return (struct CellSphereTreeBranchNode*)TAlignPointerUp( ( (TUINT16*)( this + 1 ) ) + m_uiNumMeshes );
99 }
100};
101
103{
104 Toshi::TSphere m_BoundingSphere;
106
107 TBOOL IsLeaf() const { return m_pRight == TNULL; }
108
110 {
111 TASSERT( IsLeaf() );
112 return (CellSphereTreeLeafNode*)( this + 1 );
113 }
114
116 {
117 TASSERT( !IsLeaf() );
118 return (CellSphereTreeBranchNode*)( this + 1 );
119 }
120
122 {
123 return (CellSphereTreeBranchNode*)( this - 1 );
124 }
125};
126
144
150
156
4x4 matrix implementation for the Toshi engine
3D vector implementation for the Toshi engine
#define TASSERT(X,...)
Definition Defines.h:138
#define BITFLAG(x)
Definition Defines.h:10
TFORCEINLINE constexpr T * TAlignPointerUp(T *a_pMem, TSIZE a_uiAlignment=sizeof(T *))
Definition Helpers.h:41
uint16_t TUINT16
Definition Typedefs.h:15
int32_t TINT32
Definition Typedefs.h:12
unsigned int TUINT
Definition Typedefs.h:8
char TCHAR
Definition Typedefs.h:20
float TFLOAT
Definition Typedefs.h:4
#define TNULL
Definition Typedefs.h:23
uint32_t TUINT32
Definition Typedefs.h:13
int TINT
Definition Typedefs.h:7
bool TBOOL
Definition Typedefs.h:6
FrustumIntersectSphereResult
Definition AWorld.h:38
@ FISR_NOT_VISIBLE
Definition AWorld.h:40
@ FISR_PARTIALLY_VISIBLE
Definition AWorld.h:41
@ FISR_ALL_VISIBLE
Definition AWorld.h:39
TFLOAT y
Definition AWorld.h:12
TFLOAT x
Definition AWorld.h:11
TFLOAT width
Definition AWorld.h:13
TFLOAT height
Definition AWorld.h:14
TINT Unknown
Definition AWorld.h:21
CullBox oCullBox
Definition AWorld.h:20
CellSettings * pNext
Definition AWorld.h:19
TINT Unknown
Definition AWorld.h:28
TINT iCellIndex
Definition AWorld.h:26
CellSettings * pCellSettings
Definition AWorld.h:27
Toshi::TPlane oPlane
Definition AWorld.h:33
TUINT uiClipFlag
Definition AWorld.h:34
Frustum()
Definition AWorld.cpp:12
TINT iActivePlaneCount
Definition AWorld.h:58
Toshi::TPlane * apActivePlanes[6]
Definition AWorld.h:57
FrustumIntersectSphereResult IntersectSphereReduce(const Toshi::TSphere &a_rSphere)
Definition AWorld.cpp:33
void Transform(const Frustum &a_rFrustum, const Toshi::TMatrix44 &a_rMatrix)
Definition AWorld.cpp:59
TUINT16 aUnknown[6]
Definition AWorld.h:55
void InitReduce()
Definition AWorld.cpp:23
FrustumPlane aFrustumPlanes[6]
Definition AWorld.h:56
Toshi::TVector3 Color
Definition AWorld.h:65
Toshi::TVector2 UV
Definition AWorld.h:66
Toshi::TVector3 Position
Definition AWorld.h:63
Toshi::TVector3 Normal
Definition AWorld.h:64
TUINT32 uiNumVertices1
Definition AWorld.h:73
WorldVertex * pVertices
Definition AWorld.h:76
Toshi::TMesh * pMesh
Definition AWorld.h:71
TUINT32 uiNumIndices
Definition AWorld.h:72
TUINT16 * pIndices
Definition AWorld.h:77
TUINT16 uiNumVertices2
Definition AWorld.h:74
TCHAR * szMaterialName
Definition AWorld.h:75
CellMesh * m_pCellMesh
Definition AWorld.h:83
Toshi::TSphere m_BoundingSphere
Definition AWorld.h:82
struct CellSphereTreeBranchNode * End()
Definition AWorld.h:96
TUINT32 m_uiNumMeshes
Definition AWorld.h:88
TUINT16 & GetMeshIndex(TUINT32 a_uiIndex)
Definition AWorld.h:90
CellSphereTreeLeafNode * GetLeafNode()
Definition AWorld.h:109
CellSphereTreeBranchNode * m_pRight
Definition AWorld.h:105
CellSphereTreeBranchNode * GetPrevNode()
Definition AWorld.h:121
Toshi::TSphere m_BoundingSphere
Definition AWorld.h:104
CellSphereTreeBranchNode * GetSubNode()
Definition AWorld.h:115
TBOOL IsLeaf() const
Definition AWorld.h:107
Definition AWorld.h:128
FLAGS uiFlags
Definition AWorld.h:135
TCHAR UNKNOWNDATA2[12]
Definition AWorld.h:138
TUINT FLAGS
Definition AWorld.h:129
TCHAR UNKNOWNDATA1[108]
Definition AWorld.h:136
TINT m_iSomeCount
Definition AWorld.h:137
CellNode * pNode
Definition AWorld.h:139
TUINT32 uiNumMeshes
Definition AWorld.h:140
CellSphereTreeBranchNode * pTreeBranchNodes
Definition AWorld.h:142
CellMeshSphere ** ppCellMeshSpheres
Definition AWorld.h:141
FLAGS_
Definition AWorld.h:131
@ FLAGS_BUILDING
Definition AWorld.h:132
Cell ** m_ppCells
Definition AWorld.h:148
TINT32 m_iNumCells
Definition AWorld.h:147
TUINT32 m_uiNumWorlds
Definition AWorld.h:153
World ** m_ppWorlds
Definition AWorld.h:154
Cell * pCell
Definition AWorld.h:159
Frustum * pFrustum
Definition AWorld.h:160