mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 23:24:41 +00:00
Engine directory for ticket #1
This commit is contained in:
parent
352279af7a
commit
7dbfe6994d
3795 changed files with 1363358 additions and 0 deletions
149
Engine/source/forest/ts/tsForestCellBatch.cpp
Normal file
149
Engine/source/forest/ts/tsForestCellBatch.cpp
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "platform/platform.h"
|
||||
#include "forest/ts/tsForestCellBatch.h"
|
||||
|
||||
#include "forest/ts/tsForestItemData.h"
|
||||
#include "scene/sceneManager.h"
|
||||
#include "ts/tsLastDetail.h"
|
||||
|
||||
|
||||
TSForestCellBatch::TSForestCellBatch( TSLastDetail *detail )
|
||||
: mDetail( detail )
|
||||
{
|
||||
}
|
||||
|
||||
TSForestCellBatch::~TSForestCellBatch()
|
||||
{
|
||||
}
|
||||
|
||||
bool TSForestCellBatch::_prepBatch( const ForestItem &item )
|
||||
{
|
||||
// Make sure it's our item type!
|
||||
TSForestItemData* data = dynamic_cast<TSForestItemData*>( item.getData() );
|
||||
if ( !data )
|
||||
return false;
|
||||
|
||||
// TODO: Eventually we should atlas multiple details into
|
||||
// a single combined texture map. Till then we have to
|
||||
// do one batch per-detail type.
|
||||
|
||||
// If the detail type doesn't match then
|
||||
// we need to start a new batch.
|
||||
if ( data->getLastDetail() != mDetail )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void TSForestCellBatch::_rebuildBatch()
|
||||
{
|
||||
// Clean up first.
|
||||
mVB = NULL;
|
||||
if ( mItems.empty() )
|
||||
return;
|
||||
|
||||
// How big do we need to make this?
|
||||
U32 verts = mItems.size() * 6;
|
||||
mVB.set( GFX, verts, GFXBufferTypeStatic );
|
||||
if ( !mVB.isValid() )
|
||||
{
|
||||
// If we failed it is probably because we requested
|
||||
// a size bigger than a VB can be. Warn the user.
|
||||
AssertWarn( false, "TSForestCellBatch::_rebuildBatch: Batch too big... try reducing the forest cell size!" );
|
||||
return;
|
||||
}
|
||||
|
||||
// Fill this puppy!
|
||||
ImposterState *vertPtr = mVB.lock();
|
||||
Vector<ForestItem>::const_iterator item = mItems.begin();
|
||||
|
||||
const F32 radius = mDetail->getRadius();
|
||||
ImposterState state;
|
||||
|
||||
for ( ; item != mItems.end(); item++ )
|
||||
{
|
||||
item->getWorldBox().getCenter( &state.center );
|
||||
state.halfSize = radius * item->getScale();
|
||||
state.alpha = 1.0f;
|
||||
item->getTransform().getColumn( 2, &state.upVec );
|
||||
item->getTransform().getColumn( 0, &state.rightVec );
|
||||
|
||||
*vertPtr = state;
|
||||
vertPtr->corner = 0;
|
||||
++vertPtr;
|
||||
|
||||
*vertPtr = state;
|
||||
vertPtr->corner = 1;
|
||||
++vertPtr;
|
||||
|
||||
*vertPtr = state;
|
||||
vertPtr->corner = 2;
|
||||
++vertPtr;
|
||||
|
||||
*vertPtr = state;
|
||||
vertPtr->corner = 2;
|
||||
++vertPtr;
|
||||
|
||||
*vertPtr = state;
|
||||
vertPtr->corner = 3;
|
||||
++vertPtr;
|
||||
|
||||
*vertPtr = state;
|
||||
vertPtr->corner = 0;
|
||||
++vertPtr;
|
||||
}
|
||||
|
||||
mVB.unlock();
|
||||
}
|
||||
|
||||
void TSForestCellBatch::_render( const SceneRenderState *state )
|
||||
{
|
||||
if ( !mVB.isValid() ||
|
||||
( state->isShadowPass() && !TSLastDetail::smCanShadow ) )
|
||||
return;
|
||||
|
||||
// Make sure we have a material to render with.
|
||||
BaseMatInstance *mat = state->getOverrideMaterial( mDetail->getMatInstance() );
|
||||
if ( mat == NULL )
|
||||
return;
|
||||
|
||||
// We don't really render here... we submit it to
|
||||
// the render manager which collects all the batches
|
||||
// in the scene, sorts them by texture, sets up the
|
||||
// shader, and then renders them all at once.
|
||||
|
||||
ImposterBatchRenderInst *inst = state->getRenderPass()->allocInst<ImposterBatchRenderInst>();
|
||||
inst->mat = mat;
|
||||
inst->vertBuff = &mVB;
|
||||
|
||||
// We sort by the imposter type first so that RIT_Imposter and
|
||||
// RIT_ImposterBatches do not get mixed together.
|
||||
//
|
||||
// We then sort by material.
|
||||
//
|
||||
inst->defaultKey = 0;
|
||||
inst->defaultKey2 = mat->getStateHint();
|
||||
|
||||
state->getRenderPass()->addInst( inst );
|
||||
}
|
||||
68
Engine/source/forest/ts/tsForestCellBatch.h
Normal file
68
Engine/source/forest/ts/tsForestCellBatch.h
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _TSFORESTCELLBATCH_H_
|
||||
#define _TSFORESTCELLBATCH_H_
|
||||
|
||||
#ifndef _FORESTCELLBATCH_H_
|
||||
#include "renderInstance/renderImposterMgr.h"
|
||||
#endif
|
||||
#ifndef _FORESTCELLBATCH_H_
|
||||
#include "forest/forestCellBatch.h"
|
||||
#endif
|
||||
#ifndef _GFXTEXTUREHANDLE_H_
|
||||
#include "gfx/gfxTextureHandle.h"
|
||||
#endif
|
||||
#ifndef _GFXVERTEXBUFFER_H_
|
||||
#include "gfx/gfxVertexBuffer.h"
|
||||
#endif
|
||||
#ifndef _GFXSTRUCTS_H_
|
||||
#include "gfx/gfxStructs.h"
|
||||
#endif
|
||||
|
||||
class GFXShader;
|
||||
|
||||
|
||||
class TSForestCellBatch : public ForestCellBatch
|
||||
{
|
||||
protected:
|
||||
|
||||
/// We use the same shader and vertex format as TSLastDetail.
|
||||
GFXVertexBufferHandle<ImposterState> mVB;
|
||||
|
||||
TSLastDetail *mDetail;
|
||||
|
||||
// ForestCellBatch
|
||||
virtual bool _prepBatch( const ForestItem &item );
|
||||
virtual void _rebuildBatch();
|
||||
virtual void _render( const SceneRenderState *state );
|
||||
|
||||
public:
|
||||
|
||||
TSForestCellBatch( TSLastDetail *detail );
|
||||
|
||||
virtual ~TSForestCellBatch();
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // _TSFORESTCELLBATCH_H_
|
||||
252
Engine/source/forest/ts/tsForestItemData.cpp
Normal file
252
Engine/source/forest/ts/tsForestItemData.cpp
Normal file
|
|
@ -0,0 +1,252 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "platform/platform.h"
|
||||
#include "forest/ts/tsForestItemData.h"
|
||||
|
||||
#include "forest/ts/tsForestCellBatch.h"
|
||||
#include "core/resourceManager.h"
|
||||
#include "ts/tsShapeInstance.h"
|
||||
#include "ts/tsLastDetail.h"
|
||||
#include "sim/netConnection.h"
|
||||
#include "materials/materialManager.h"
|
||||
#include "forest/windDeformation.h"
|
||||
|
||||
|
||||
IMPLEMENT_CO_DATABLOCK_V1(TSForestItemData);
|
||||
|
||||
ConsoleDocClass( TSForestItemData,
|
||||
"@brief Concrete implementation of ForestItemData which loads and renders "
|
||||
"dts format shapeFiles.\n\n"
|
||||
"@ingroup Forest"
|
||||
);
|
||||
|
||||
TSForestItemData::TSForestItemData()
|
||||
: mShapeInstance( NULL ),
|
||||
mIsClientObject( false )
|
||||
{
|
||||
}
|
||||
|
||||
TSForestItemData::~TSForestItemData()
|
||||
{
|
||||
}
|
||||
|
||||
bool TSForestItemData::preload( bool server, String &errorBuffer )
|
||||
{
|
||||
mIsClientObject = !server;
|
||||
|
||||
if ( !SimDataBlock::preload( server, errorBuffer ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void TSForestItemData::_updateCollisionDetails()
|
||||
{
|
||||
mCollisionDetails.clear();
|
||||
mLOSDetails.clear();
|
||||
mShape->findColDetails( false, &mCollisionDetails, &mLOSDetails );
|
||||
}
|
||||
|
||||
bool TSForestItemData::onAdd()
|
||||
{
|
||||
if ( !Parent::onAdd() )
|
||||
return false;
|
||||
|
||||
// Register for the resource change signal.
|
||||
ResourceManager::get().getChangedSignal().notify( this, &TSForestItemData::_onResourceChanged );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void TSForestItemData::onRemove()
|
||||
{
|
||||
// Remove the resource change signal.
|
||||
ResourceManager::get().getChangedSignal().remove( this, &TSForestItemData::_onResourceChanged );
|
||||
|
||||
SAFE_DELETE( mShapeInstance );
|
||||
|
||||
Parent::onRemove();
|
||||
}
|
||||
|
||||
void TSForestItemData::inspectPostApply()
|
||||
{
|
||||
Parent::inspectPostApply();
|
||||
|
||||
SAFE_DELETE( mShapeInstance );
|
||||
_loadShape();
|
||||
}
|
||||
|
||||
void TSForestItemData::_onResourceChanged( const Torque::Path &path )
|
||||
{
|
||||
if ( path != Path( mShapeFile ) )
|
||||
return;
|
||||
|
||||
SAFE_DELETE( mShapeInstance );
|
||||
_loadShape();
|
||||
|
||||
getReloadSignal().trigger();
|
||||
}
|
||||
|
||||
void TSForestItemData::_loadShape()
|
||||
{
|
||||
mShape = ResourceManager::get().load(mShapeFile);
|
||||
if ( !(bool)mShape )
|
||||
return;
|
||||
|
||||
if ( mIsClientObject &&
|
||||
!mShape->preloadMaterialList( mShapeFile ) )
|
||||
return;
|
||||
|
||||
// Lets add an autobillboard detail if don't have one.
|
||||
//_checkLastDetail();
|
||||
|
||||
_updateCollisionDetails();
|
||||
}
|
||||
|
||||
TSShapeInstance* TSForestItemData::_getShapeInstance() const
|
||||
{
|
||||
// Create the shape instance if we haven't already.
|
||||
if ( !mShapeInstance && mShape )
|
||||
{
|
||||
// Create the instance.
|
||||
mShapeInstance = new TSShapeInstance( mShape, true );
|
||||
|
||||
// So we can make OpCode collision calls.
|
||||
mShapeInstance->prepCollision();
|
||||
|
||||
// Get the material features adding the wind effect if
|
||||
// we have a positive wind scale and have vertex color
|
||||
// data which is used for the weighting.
|
||||
FeatureSet features = MATMGR->getDefaultFeatures();
|
||||
if ( mWindScale > 0.0f && mShape->getVertexFormat()->hasColor() )
|
||||
{
|
||||
// We create our own cloned material list to
|
||||
// enable the wind effects.
|
||||
features.addFeature( MFT_WindEffect );
|
||||
mShapeInstance->cloneMaterialList( &features );
|
||||
}
|
||||
}
|
||||
|
||||
return mShapeInstance;
|
||||
}
|
||||
|
||||
void TSForestItemData::_checkLastDetail()
|
||||
{
|
||||
const S32 dl = mShape->mSmallestVisibleDL;
|
||||
const TSDetail *detail = &mShape->details[dl];
|
||||
|
||||
// TODO: Expose some real parameters to the datablock maybe?
|
||||
if ( detail->subShapeNum != -1 )
|
||||
{
|
||||
mShape->addImposter( mShapeFile, 10, 4, 0, 0, 256, 0, 0 );
|
||||
|
||||
// HACK: If i don't do this it crashes!
|
||||
while ( mShape->detailCollisionAccelerators.size() < mShape->details.size() )
|
||||
mShape->detailCollisionAccelerators.push_back( NULL );
|
||||
}
|
||||
}
|
||||
|
||||
TSLastDetail* TSForestItemData::getLastDetail() const
|
||||
{
|
||||
// Gotta call this first of the last detail isn't created!
|
||||
if (!_getShapeInstance())
|
||||
return NULL;
|
||||
|
||||
const S32 dl = mShape->mSmallestVisibleDL;
|
||||
const TSDetail* detail = &mShape->details[dl];
|
||||
if ( detail->subShapeNum >= 0 ||
|
||||
mShape->billboardDetails.size() <= dl )
|
||||
return NULL;
|
||||
|
||||
return mShape->billboardDetails[dl];
|
||||
}
|
||||
|
||||
ForestCellBatch* TSForestItemData::allocateBatch() const
|
||||
{
|
||||
TSLastDetail* lastDetail = getLastDetail();
|
||||
if ( !lastDetail )
|
||||
return NULL;
|
||||
|
||||
return new TSForestCellBatch( lastDetail );
|
||||
}
|
||||
|
||||
bool TSForestItemData::canBillboard( const SceneRenderState *state, const ForestItem &item, F32 distToCamera ) const
|
||||
{
|
||||
PROFILE_SCOPE( TSForestItemData_canBillboard );
|
||||
|
||||
if ( !mShape )
|
||||
return false;
|
||||
|
||||
// Use the shape instance to do the work it normally does.
|
||||
TSShapeInstance *shapeInstance = _getShapeInstance();
|
||||
const S32 dl = shapeInstance->setDetailFromDistance( state, distToCamera / item.getScale() );
|
||||
|
||||
// This item has a null LOD... lets consider
|
||||
// that as being billboarded.
|
||||
if ( dl < 0 )
|
||||
return true;
|
||||
|
||||
const TSDetail *detail = &mShape->details[dl];
|
||||
if ( detail->subShapeNum < 0 && dl < mShape->billboardDetails.size() )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TSForestItemData::render( TSRenderState *rdata, const ForestItem &item ) const
|
||||
{
|
||||
PROFILE_SCOPE( TSForestItemData_render );
|
||||
|
||||
// This shouldn't happen normally at runtime, but during
|
||||
// development a file change notification on a bad file
|
||||
// can cause us to get here without a shape.
|
||||
TSShapeInstance *shapeInst = _getShapeInstance();
|
||||
if ( !shapeInst )
|
||||
return false;
|
||||
|
||||
const F32 scale = item.getScale();
|
||||
|
||||
// Figure out the distance of this item to the camera.
|
||||
const SceneRenderState *state = rdata->getSceneState();
|
||||
F32 dist = ( item.getPosition() - state->getDiffuseCameraPosition() ).len();
|
||||
|
||||
// TODO: Selecting the lod seems more expensive than
|
||||
// it should be... we should look to optimize this.
|
||||
if ( shapeInst->setDetailFromDistance( state, dist / scale ) < 0 )
|
||||
return false;
|
||||
|
||||
// TSShapeInstance::render() uses the
|
||||
// world matrix for the RenderInst.
|
||||
MatrixF worldMat = item.getTransform();
|
||||
worldMat.scale( scale );
|
||||
GFX->setWorldMatrix( worldMat );
|
||||
rdata->setMaterialHint( (void*)&item );
|
||||
|
||||
// This isn't documented well, but these calls
|
||||
// don't really render... rather they batch the
|
||||
// shape to be rendered by the render instance
|
||||
// manager later on.
|
||||
shapeInst->animate();
|
||||
shapeInst->render( *rdata );
|
||||
return true;
|
||||
}
|
||||
98
Engine/source/forest/ts/tsForestItemData.h
Normal file
98
Engine/source/forest/ts/tsForestItemData.h
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _TSFORESTITEMDATA_H_
|
||||
#define _TSFORESTITEMDATA_H_
|
||||
|
||||
#ifndef _FORESTITEM_H_
|
||||
#include "forest/forestItem.h"
|
||||
#endif
|
||||
#ifndef _TSSHAPE_H_
|
||||
#include "ts/tsShape.h"
|
||||
#endif
|
||||
#ifndef _RESOURCEMANAGER_H_
|
||||
#include "core/resourceManager.h"
|
||||
#endif
|
||||
|
||||
|
||||
class TSShapeInstance;
|
||||
class TSLastDetail;
|
||||
|
||||
|
||||
class TSForestItemData : public ForestItemData
|
||||
{
|
||||
protected:
|
||||
|
||||
typedef ForestItemData Parent;
|
||||
|
||||
bool mIsClientObject;
|
||||
|
||||
// This is setup during forest creation.
|
||||
mutable TSShapeInstance *mShapeInstance;
|
||||
|
||||
Resource<TSShape> mShape;
|
||||
|
||||
Vector<S32> mCollisionDetails;
|
||||
Vector<S32> mLOSDetails;
|
||||
|
||||
TSShapeInstance* _getShapeInstance() const;
|
||||
|
||||
void _loadShape();
|
||||
|
||||
void _onResourceChanged( const Torque::Path &path );
|
||||
|
||||
void _checkLastDetail();
|
||||
|
||||
void _updateCollisionDetails();
|
||||
|
||||
// ForestItemData
|
||||
void _preload() { _loadShape(); }
|
||||
|
||||
public:
|
||||
|
||||
DECLARE_CONOBJECT(TSForestItemData);
|
||||
TSForestItemData();
|
||||
virtual ~TSForestItemData();
|
||||
|
||||
bool preload( bool server, String &errorBuffer );
|
||||
void onRemove();
|
||||
bool onAdd();
|
||||
|
||||
virtual void inspectPostApply();
|
||||
|
||||
TSLastDetail* getLastDetail() const;
|
||||
|
||||
// JCF: need access to this to build convex(s) in ForestConvex
|
||||
TSShapeInstance* getShapeInstance() const { return _getShapeInstance(); }
|
||||
|
||||
const Vector<S32>& getCollisionDetails() const { return mCollisionDetails; }
|
||||
const Vector<S32>& getLOSDetails() const { return mLOSDetails; }
|
||||
|
||||
// ForestItemData
|
||||
const Box3F& getObjBox() const { return mShape ? mShape->bounds : Box3F::Invalid; }
|
||||
bool render( TSRenderState *rdata, const ForestItem& item ) const;
|
||||
ForestCellBatch* allocateBatch() const;
|
||||
bool canBillboard( const SceneRenderState *state, const ForestItem &item, F32 distToCamera ) const;
|
||||
bool buildPolyList( const ForestItem& item, AbstractPolyList *polyList, const Box3F *box ) const { return false; }
|
||||
};
|
||||
|
||||
#endif // _TSFORESTITEMDATA_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue