mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-07-27 15:35:46 +00:00
45 lines
2.0 KiB
C++
45 lines
2.0 KiB
C++
#ifndef CMODELNODE_H
|
|
#define CMODELNODE_H
|
|
|
|
#include "CSceneNode.h"
|
|
#include "Core/Resource/Model/CModel.h"
|
|
|
|
class CModelNode : public CSceneNode
|
|
{
|
|
TResPtr<CModel> mpModel;
|
|
u32 mActiveMatSet;
|
|
bool mLightingEnabled;
|
|
bool mForceAlphaOn;
|
|
CColor mTintColor;
|
|
bool mEnableScanOverlay;
|
|
CColor mScanOverlayColor;
|
|
|
|
public:
|
|
explicit CModelNode(CScene *pScene, CSceneNode *pParent = 0, CModel *pModel = 0);
|
|
|
|
virtual ENodeType NodeType();
|
|
virtual void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo);
|
|
virtual void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo);
|
|
virtual void DrawSelection();
|
|
virtual void RayAABoxIntersectTest(CRayCollisionTester& Tester, const SViewInfo& ViewInfo);
|
|
virtual SRayIntersection RayNodeIntersectTest(const CRay &Ray, u32 AssetID, const SViewInfo& ViewInfo);
|
|
virtual CColor TintColor(const SViewInfo& rkViewInfo) const;
|
|
|
|
// Setters
|
|
void SetModel(CModel *pModel);
|
|
|
|
inline void SetMatSet(u32 MatSet) { mActiveMatSet = MatSet; }
|
|
inline void SetDynamicLighting(bool Enable) { mLightingEnabled = Enable; }
|
|
inline void ForceAlphaEnabled(bool Enable) { mForceAlphaOn = Enable; }
|
|
inline void SetTintColor(const CColor& rkTintColor) { mTintColor = rkTintColor; }
|
|
inline void ClearTintColor() { mTintColor = CColor::skWhite; }
|
|
inline void SetScanOverlayEnabled(bool Enable) { mEnableScanOverlay = Enable; }
|
|
inline void SetScanOverlayColor(const CColor& rkColor) { mScanOverlayColor = rkColor; }
|
|
inline CModel* Model() const { return mpModel; }
|
|
inline u32 MatSet() const { return mActiveMatSet; }
|
|
inline bool IsDynamicLightingEnabled() const { return mLightingEnabled; }
|
|
inline u32 FindMeshID() const { return mpModel->GetSurface(0)->MeshID; }
|
|
};
|
|
|
|
#endif // CMODELNODE_H
|