Files
firestorm/Gameleap/code/mw4/Libraries/elementrenderer/GroupElement.hpp
T
Cyd 2b8ca921cb Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS
Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
2026-06-24 21:28:16 -05:00

161 lines
3.8 KiB
C++

#pragma once
#include "ElementRenderer.hpp"
#include "Element.hpp"
namespace ElementProxies {
class ElementGroupProxy;
class ElementSceneProxy;
}
namespace ElementRenderer {
//#########################################################################
//######################### GroupElement ################################
//#########################################################################
class GroupElement:
public Element
{
friend class ElementProxies::ElementGroupProxy;
friend class ElementProxies::ElementSceneProxy;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Initialization
//
public:
static void InitializeClass();
static void TerminateClass();
static ClassData *DefaultData;
typedef Element BaseClass;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Constructors/Destructors
//
protected:
GroupElement(
ClassData *class_data,
Stuff::MemoryStream *stream,
int version,
ShapeHolder shapes
);
public:
GroupElement(ClassData *class_data=DefaultData);
~GroupElement();
static GroupElement* Make(
Stuff::MemoryStream *stream,
int version,
ShapeHolder shapes=NULL
);
void Save(Stuff::MemoryStream *stream);
static HGOSHEAP s_Heap;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Testing
//
public:
void TestInstance();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Hierarchy
//
public:
void AttachChild(Element *child);
void DetachChild(Element *child);
void DetachChildren();
Stuff::ChainIteratorOf<Element*>* MakeIterator()
{
Check_Object(this);
return new Stuff::ChainIteratorOf<Element*>(&m_group);
}
protected:
Stuff::ChainOf<Element*> m_group;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Sync support
//
protected:
void SetSyncState();
static SyncMethod SyncMethods[SyncStateCount];
void CleanRootSyncMethod();
void DirtyRootSyncMethod();
void CleanSyncMethod();
void DirtySyncMethod();
void CleanSphereSyncMethod();
void MatrixDirtySphereSyncMethod();
void BoundsWrongSphereSyncMethod();
void FullSphereSyncMethod();
void CleanOBBSyncMethod();
void MatrixDirtyOBBSyncMethod();
void BoundsWrongOBBSyncMethod();
void FullOBBSyncMethod();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Collision
//
protected:
bool CastCulledRay(CollisionQuery *query);
Element* FindSmallestElementContainingCulled(SphereTest *test);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Drawing
//
protected:
void SetDrawState();
static DrawMethod DrawMethods[DrawStateCount];
void InheritDrawMethod(
CameraElement *camera,
const StateChange *inherited_state,
int clipping_state
);
void OverrideDrawMethod(
CameraElement *camera,
const StateChange *inherited_state,
int clipping_state
);
public:
void CleanDamage();
void ApplyDamage(
const Stuff::LinearMatrix4D &damage_spot,
Stuff::Scalar radius
);
void ApplyDamageDecal(
const Stuff::LinearMatrix4D &damage_spot,
Stuff::Scalar radius,
MidLevelRenderer::MLRTexture *texture
);
void CastShadow(
const Stuff::LinearMatrix4D &shadow_to_world,
const Stuff::UnitVector3D &sun_in_world,
Stuff::Scalar radius
);
void MakeFootStep(
MidLevelRenderer::MLRShape *shape,
const Stuff::LinearMatrix4D &foot,
Stuff::Scalar radius,
MidLevelRenderer::MLRTexture *tex
);
public:
int CountTriangles();
void GetCoordData(Stuff::DynamicArrayOf<Stuff::Point3D> *array);
};
}