/////////////////////////////////////////////////////////////////////// // // *** INTERACTIVE DATA VISUALIZATION (IDV) CONFIDENTIAL AND PROPRIETARY INFORMATION *** // // This software is supplied under the terms of a license agreement or // nondisclosure agreement with Interactive Data Visualization, Inc. and // may not be copied, disclosed, or exploited except in accordance with // the terms of that agreement. // // Copyright (c) 2003-2017 IDV, Inc. // All rights reserved in all media. // // IDV, Inc. // http://www.idvinc.com /////////////////////////////////////////////////////////////////////// // Preprocessor / Includes #pragma once #include "DataBuffer.h" /////////////////////////////////////////////////////////////////////// // Packing #ifdef ST_SETS_PACKING_INTERNALLY #pragma pack(push, 4) #endif /////////////////////////////////////////////////////////////////////// // namespace SpeedTreeDataBuffer namespace SpeedTreeDataBuffer { namespace GameEngine9 { /////////////////////////////////////////////////////////////////////// // Data Structs struct Vec2 { st_float32 x, y; }; struct Vec3 { st_float32 x, y, z; }; struct Vec4 { st_float32 x, y, z, w; }; struct SVertex { Vec3 m_vAnchor; Vec3 m_vOffset; Vec3 m_vLodOffset; Vec3 m_vNormal; Vec3 m_vTangent; Vec3 m_vBinormal; Vec2 m_vTexCoord; Vec2 m_vLightmapTexCoord; Vec3 m_vColor; st_float32 m_fAmbientOcclusion; st_float32 m_fBlendWeight; Vec3 m_vBranchWind1; // pos, dir, weight Vec3 m_vBranchWind2; st_float32 m_fRippleWeight; st_bool m_bCameraFacing; st_uint32 m_uiBoneID; }; struct SDrawCall { st_uint32 m_uiMaterialIndex; st_bool m_bContainsFacingGeometry; st_uint32 m_uiIndexStart; st_uint32 m_uiIndexCount; }; struct SBone { st_uint32 m_uiID; st_uint32 m_uiParentID; Vec3 m_vStart; Vec3 m_vEnd; float m_fRadius; }; /////////////////////////////////////////////////////////////////////// // Data Tables class CLod : public CTable { public: ST_INLINE CArray Vertices(void) { return GetContainer >(0); } ST_INLINE CArray Indices(void) { return GetContainer >(1); } ST_INLINE CArray DrawCalls(void) { return GetContainer >(2); } }; class CMaterialMap : public CTable { public: ST_INLINE st_bool Used(void) { return GetValue(0); } ST_INLINE CString Path(void) { return GetContainer(1); } ST_INLINE Vec4 Color(void) { return GetValue(2); } }; class CMaterial : public CTable { public: ST_INLINE CString Name(void) { return GetContainer(0); } ST_INLINE st_bool TwoSided(void) { return GetValue(1); } ST_INLINE st_bool FlipNormalsOnBackside(void) { return GetValue(2); } ST_INLINE st_bool Billboard(void) { return GetValue(3); } ST_INLINE CTableArray Maps(void) { return GetContainer >(4); } }; class CBillboardInfo : public CTable { public: ST_INLINE st_bool LastLodIsBillboard(void) { return GetValue(0); } ST_INLINE st_bool IncludesTopDown(void) { return GetValue(1); } ST_INLINE st_uint32 SideViewCount(void) { return GetValue(2); } }; class CCollisionObject : public CTable { public: ST_INLINE Vec3 Position(void) { return GetValue(0); } ST_INLINE Vec3 Position2(void) { return GetValue(1); } ST_INLINE float Radius(void) { return GetValue(2); } ST_INLINE CString UserData(void) { return GetContainer(3); } }; /////////////////////////////////////////////////////////////////////// // Wind Data Tables class CWindConfigCommon : public CTable { public: ST_INLINE st_float32 StrengthResponse(void) { return GetValue(0); } ST_INLINE st_float32 DirectionResponse(void) { return GetValue(1); } ST_INLINE st_float32 GustFrequency(void) { return GetValue(5); } ST_INLINE st_float32 GustStrengthMin(void) { return GetValue(6); } ST_INLINE st_float32 GustStrengthMax(void) { return GetValue(7); } ST_INLINE st_float32 GustDurationMin(void) { return GetValue(8); } ST_INLINE st_float32 GustDurationMax(void) { return GetValue(9); } ST_INLINE st_float32 GustRiseScalar(void) { return GetValue(10); } ST_INLINE st_float32 GustFallScalar(void) { return GetValue(11); } ST_INLINE st_float32 CurrentStrength(void) { return GetValue(15); } }; class CWindConfigSDK : public CTable { public: class CBranch : public CTable { public: ST_INLINE CArray Bend(void) { return GetContainer >(0); } ST_INLINE CArray Oscillation(void) { return GetContainer >(1); } ST_INLINE CArray Speed(void) { return GetContainer >(2); } ST_INLINE CArray Turbulence(void) { return GetContainer >(3); } ST_INLINE CArray Flexibility(void) { return GetContainer >(4); } ST_INLINE st_float32 Independence(void) { return GetValue(5); } }; class CRipple : public CTable { public: ST_INLINE CArray Planar(void) { return GetContainer >(0); } ST_INLINE CArray Directional(void) { return GetContainer >(1); } ST_INLINE CArray Speed(void) { return GetContainer >(2); } ST_INLINE CArray Flexibility(void) { return GetContainer >(3); } ST_INLINE st_float32 Shimmer(void) { return GetValue(4); } ST_INLINE st_float32 Independence(void) { return GetValue(5); } }; ST_INLINE CWindConfigCommon Common(void) { return GetContainer(0); } ST_INLINE CBranch Shared(void) { return GetContainer(1); } ST_INLINE CBranch Branch1(void) { return GetContainer(2); } ST_INLINE CBranch Branch2(void) { return GetContainer(3); } ST_INLINE CRipple Ripple(void) { return GetContainer(4); } ST_INLINE st_float32 SharedStartHeight(void) { return GetValue(10); } ST_INLINE st_float32 Branch1StretchLimit(void) { return GetValue(11); } ST_INLINE st_float32 Branch2StretchLimit(void) { return GetValue(12); } ST_INLINE st_bool DoShared(void) { return GetValue(15); } ST_INLINE st_bool DoBranch1(void) { return GetValue(16); } ST_INLINE st_bool DoBranch2(void) { return GetValue(17); } ST_INLINE st_bool DoRipple(void) { return GetValue(18); } ST_INLINE st_bool DoShimmer(void) { return GetValue(19); } }; /////////////////////////////////////////////////////////////////////// // class CTree class CTree : public CReader { public: // file info ST_INLINE st_uint32 VersionMajor(void) { return GetValue(0); } ST_INLINE st_uint32 VersionMinor(void) { return GetValue(1); } // geometry info ST_INLINE CTableArray Lods(void) { return GetContainer >(5); } ST_INLINE CBillboardInfo BillboardInfo(void) { return GetContainer(6); } ST_INLINE CTableArray CollisionObjects(void) { return GetContainer >(7); } // material info ST_INLINE CTableArray Materials(void) { return GetContainer >(10); } ST_INLINE st_uint32 LightmapSize(void) { return GetValue(11); } ST_INLINE CString TexturePacker(void) { return GetContainer(12); } // wind ST_INLINE CWindConfigSDK Wind(void) { return GetContainer(15); } // bones/skeleton ST_INLINE CArray Bones(void) { return GetContainer >(20); } protected: ST_INLINE const st_char* FileToken(void) const { return "SpeedTree9______"; } }; } // end namespace GameEngine9 } // end namespace SpeedTree #ifdef ST_SETS_PACKING_INTERNALLY #pragma pack(pop) #endif