Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
GameObjectModel.h
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
#ifndef _GAMEOBJECT_MODEL_H
7
#define _GAMEOBJECT_MODEL_H
8
9
#include <G3D/Matrix3.h>
10
#include <G3D/Vector3.h>
11
#include <G3D/AABox.h>
12
#include <G3D/Ray.h>
13
14
#include "
Define.h
"
15
16
#include <memory>
17
namespace
VMAP
18
{
19
class
WorldModel
;
20
}
21
22
class
GameObject
;
23
struct
GameObjectDisplayInfoEntry
;
24
25
class
GameObjectModelOwnerBase
26
{
27
public
:
28
virtual
~GameObjectModelOwnerBase
() { }
29
virtual
bool
isSpawned
()
const
{
return
false
; }
30
virtual
uint32
GetDisplayId
()
const
{
return
0; }
31
virtual
uint32
GetPhaseMask
()
const
{
return
0; }
32
virtual
G3D::Vector3
GetPosition
()
const
{
return
G3D::Vector3::zero(); }
33
virtual
float
GetOrientation
()
const
{
return
0.0f; }
34
virtual
float
GetScale
()
const
{
return
1.0f; }
35
virtual
void
DebugVisualizeCorner
(G3D::Vector3
const
&
/*corner*/
)
const
{ }
36
};
37
38
class
GameObjectModel
/*, public Intersectable*/
39
{
40
GameObjectModel
() :
phasemask
(0),
iInvScale
(0),
iScale
(0),
iModel
(NULL) { }
41
private
:
42
bool
initialize
(std::unique_ptr<GameObjectModelOwnerBase> modelOwner, std::string
const
& dataPath);
43
44
uint32
phasemask
;
45
G3D::AABox
iBound
;
46
G3D::Matrix3
iInvRot
;
47
G3D::Vector3
iPos
;
48
float
iInvScale
;
49
float
iScale
;
50
VMAP::WorldModel
*
iModel
;
51
std::unique_ptr<GameObjectModelOwnerBase>
owner
;
52
53
public
:
54
std::string
name
;
55
56
const
G3D::AABox&
getBounds
()
const
{
return
iBound
; }
57
58
~GameObjectModel
();
59
60
const
G3D::Vector3&
getPosition
()
const
{
return
iPos
;}
61
63
void
disable
() {
phasemask
= 0;}
64
void
enable
(
uint32
ph_mask) {
phasemask
= ph_mask;}
65
66
bool
isEnabled
()
const
{
return
phasemask
!= 0;}
67
68
bool
intersectRay
(
const
G3D::Ray& Ray,
float
& MaxDist,
bool
StopAtFirstHit,
uint32
ph_mask)
const
;
69
70
static
GameObjectModel
*
Create
(std::unique_ptr<GameObjectModelOwnerBase> modelOwner, std::string
const
& dataPath);
71
bool
Relocate
();
72
};
73
74
#endif
// _GAMEOBJECT_MODEL_H
Define.h
uint32
std::uint32_t uint32
Definition
Define.h:77
GameObject
Definition
GameObject.h:629
GameObjectModel
Definition
GameObjectModel.h:39
GameObjectModel::disable
void disable()
Definition
GameObjectModel.h:63
GameObjectModel::Relocate
bool Relocate()
Definition
GameObjectModel.cpp:167
GameObjectModel::iPos
G3D::Vector3 iPos
Definition
GameObjectModel.h:47
GameObjectModel::isEnabled
bool isEnabled() const
Definition
GameObjectModel.h:66
GameObjectModel::getBounds
const G3D::AABox & getBounds() const
Definition
GameObjectModel.h:56
GameObjectModel::getPosition
const G3D::Vector3 & getPosition() const
Definition
GameObjectModel.h:60
GameObjectModel::iInvRot
G3D::Matrix3 iInvRot
Definition
GameObjectModel.h:46
GameObjectModel::iModel
VMAP::WorldModel * iModel
Definition
GameObjectModel.h:50
GameObjectModel::~GameObjectModel
~GameObjectModel()
Definition
GameObjectModel.cpp:78
GameObjectModel::name
std::string name
Definition
GameObjectModel.h:54
GameObjectModel::iBound
G3D::AABox iBound
Definition
GameObjectModel.h:45
GameObjectModel::iScale
float iScale
Definition
GameObjectModel.h:49
GameObjectModel::GameObjectModel
GameObjectModel()
Definition
GameObjectModel.h:40
GameObjectModel::Create
static GameObjectModel * Create(std::unique_ptr< GameObjectModelOwnerBase > modelOwner, std::string const &dataPath)
Definition
GameObjectModel.cpp:133
GameObjectModel::enable
void enable(uint32 ph_mask)
Definition
GameObjectModel.h:64
GameObjectModel::phasemask
uint32 phasemask
Definition
GameObjectModel.h:44
GameObjectModel::owner
std::unique_ptr< GameObjectModelOwnerBase > owner
Definition
GameObjectModel.h:51
GameObjectModel::iInvScale
float iInvScale
Definition
GameObjectModel.h:48
GameObjectModel::intersectRay
bool intersectRay(const G3D::Ray &Ray, float &MaxDist, bool StopAtFirstHit, uint32 ph_mask) const
Definition
GameObjectModel.cpp:145
GameObjectModel::initialize
bool initialize(std::unique_ptr< GameObjectModelOwnerBase > modelOwner, std::string const &dataPath)
Definition
GameObjectModel.cpp:84
GameObjectModelOwnerBase
Definition
GameObjectModel.h:26
GameObjectModelOwnerBase::~GameObjectModelOwnerBase
virtual ~GameObjectModelOwnerBase()
Definition
GameObjectModel.h:28
GameObjectModelOwnerBase::DebugVisualizeCorner
virtual void DebugVisualizeCorner(G3D::Vector3 const &) const
Definition
GameObjectModel.h:35
GameObjectModelOwnerBase::GetDisplayId
virtual uint32 GetDisplayId() const
Definition
GameObjectModel.h:30
GameObjectModelOwnerBase::GetPosition
virtual G3D::Vector3 GetPosition() const
Definition
GameObjectModel.h:32
GameObjectModelOwnerBase::GetOrientation
virtual float GetOrientation() const
Definition
GameObjectModel.h:33
GameObjectModelOwnerBase::GetScale
virtual float GetScale() const
Definition
GameObjectModel.h:34
GameObjectModelOwnerBase::GetPhaseMask
virtual uint32 GetPhaseMask() const
Definition
GameObjectModel.h:31
GameObjectModelOwnerBase::isSpawned
virtual bool isSpawned() const
Definition
GameObjectModel.h:29
VMAP::WorldModel
Definition
WorldModel.h:95
VMAP
Definition
IVMapManager.h:19
GameObjectDisplayInfoEntry
Definition
DBCStructure.h:1545
src
server
collision
Models
GameObjectModel.h
Generated on
for Project SkyFire Core by
1.17.0