/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see .
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __W3DMirror_H_
#define __W3DMirror_H_
#include "always.h"
#include "rendobj.h"
#include "w3d_file.h"
#include "dx8vertexbuffer.h"
#include "dx8indexbuffer.h"
#include "shader.h"
#include "vertmaterial.h"
#include "Lib/BaseType.h"
#include "Common/GameType.h"
/// Custom render object that draws mirrors, water, and skies.
/**
This render object handles drawing reflected W3D scenes. It will only work
with rectangular planar surfaces and was tuned with an emphasis on water.
Since skies are only visible in reflections, this code will also
render clouds and sky bodies.
*/
class MirrorRenderObjClass : public RenderObjClass
{
public:
MirrorRenderObjClass(void);
~MirrorRenderObjClass(void);
/////////////////////////////////////////////////////////////////////////////
// Render Object Interface (W3D methods)
/////////////////////////////////////////////////////////////////////////////
virtual RenderObjClass * Clone(void) const;
virtual int Class_ID(void) const;
virtual void Render(RenderInfoClass & rinfo);
/// @todo: Add methods for collision detection with mirror surface
// virtual Bool Cast_Ray(RayCollisionTestClass & raytest);
// virtual Bool Cast_AABox(AABoxCollisionTestClass & boxtest);
// virtual Bool Cast_OBBox(OBBoxCollisionTestClass & boxtest);
// virtual Bool Intersect_AABox(AABoxIntersectionTestClass & boxtest);
// virtual Bool Intersect_OBBox(OBBoxIntersectionTestClass & boxtest);
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const;
virtual void Get_Obj_Space_Bounding_Box(AABoxClass & aabox) const;
///allocate W3D resources needed to render mirror
Int init(Real waterLevel, Real dx, Real dy, SceneClass *parentScene);
static void setTimeOfDay(TimeOfDay tod) {m_tod=tod;} ///