2015-07-26 21:39:49 +00:00
|
|
|
#ifndef CSCRIPTNODE_H
|
|
|
|
#define CSCRIPTNODE_H
|
|
|
|
|
|
|
|
#include "CSceneNode.h"
|
|
|
|
#include "CModelNode.h"
|
2015-09-26 22:55:14 +00:00
|
|
|
#include "CCollisionNode.h"
|
2015-10-26 05:36:53 +00:00
|
|
|
#include <Core/CLightParameters.h>
|
2015-07-26 21:39:49 +00:00
|
|
|
#include <Resource/script/CScriptObject.h>
|
|
|
|
|
|
|
|
class CScriptNode : public CSceneNode
|
|
|
|
{
|
|
|
|
CScriptObject *mpInstance;
|
2015-11-27 18:49:20 +00:00
|
|
|
class CScriptExtra *mpExtra;
|
|
|
|
|
2015-12-13 20:52:17 +00:00
|
|
|
TResPtr<CModel> mpActiveModel;
|
|
|
|
TResPtr<CTexture> mpBillboard;
|
2015-09-26 22:55:14 +00:00
|
|
|
CCollisionNode *mpCollisionNode;
|
2015-07-26 21:39:49 +00:00
|
|
|
|
|
|
|
bool mHasValidPosition;
|
|
|
|
bool mHasVolumePreview;
|
2015-12-07 04:23:52 +00:00
|
|
|
float mScaleMultiplier;
|
2015-07-26 21:39:49 +00:00
|
|
|
CModelNode *mpVolumePreviewNode;
|
|
|
|
|
2015-10-26 05:36:53 +00:00
|
|
|
CLightParameters *mpLightParameters;
|
|
|
|
|
2015-07-26 21:39:49 +00:00
|
|
|
public:
|
|
|
|
CScriptNode(CSceneManager *pScene, CSceneNode *pParent = 0, CScriptObject *pObject = 0);
|
|
|
|
ENodeType NodeType();
|
2015-11-25 21:37:34 +00:00
|
|
|
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo);
|
2015-11-27 23:28:35 +00:00
|
|
|
void Draw(ERenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo);
|
2015-07-26 21:39:49 +00:00
|
|
|
void DrawSelection();
|
2015-11-28 18:37:22 +00:00
|
|
|
void RayAABoxIntersectTest(CRayCollisionTester& Tester, const SViewInfo& ViewInfo);
|
2015-11-25 21:37:34 +00:00
|
|
|
SRayIntersection RayNodeIntersectTest(const CRay &Ray, u32 AssetID, const SViewInfo& ViewInfo);
|
2015-12-07 05:44:56 +00:00
|
|
|
bool AllowsRotate() const;
|
|
|
|
bool AllowsScale() const;
|
2015-07-26 21:39:49 +00:00
|
|
|
bool IsVisible() const;
|
2015-11-27 18:49:20 +00:00
|
|
|
CColor TintColor(const SViewInfo &ViewInfo) const;
|
2015-11-26 10:42:42 +00:00
|
|
|
CColor WireframeColor() const;
|
|
|
|
|
2015-07-26 21:39:49 +00:00
|
|
|
void GeneratePosition();
|
2015-12-07 04:23:52 +00:00
|
|
|
CScriptObject* Object() const;
|
|
|
|
CModel* ActiveModel() const;
|
|
|
|
bool UsesModel() const;
|
|
|
|
bool HasPreviewVolume() const;
|
|
|
|
CAABox PreviewVolumeAABox() const;
|
|
|
|
CVector2f BillboardScale() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void CalculateTransform(CTransform4f& rOut) const;
|
2015-07-26 21:39:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CSCRIPTNODE_H
|