mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-06-20 12:25:16 +00:00
Cleans up ShapeAsset of some unnecessary/redundant elements like extra material and animations tracking
Removed the old SHAPE_ASSET macros Implements AssetRef struct that acts as a universal wrapper for an templated AssetPtr and AssetId pair Adds Type handling for AssetRef for ShapeAsset to unify handling in classes that utilize a shapeAsset, so assigning an assetPtr or an assetId will keep a record of the assignment in the event the assetPtr is invalid. Update all classes that utilized the old SHAPE_ASSET macros to utilize the AssetRef struct and updated the class code to utilize it to provide much more clean and concise code that isn't blocked behind macro definitions Added a new example class: shapeDatablockExample which allows render of a simple shape object utilizing a simple example datablock.
This commit is contained in:
parent
c2c5674fe9
commit
b44158cb89
52 changed files with 1860 additions and 1086 deletions
|
|
@ -657,11 +657,18 @@ void Item::setTransform(const MatrixF& mat)
|
|||
//----------------------------------------------------------------------------
|
||||
void Item::updateWorkingCollisionSet(const U32 mask, const F32 dt)
|
||||
{
|
||||
if (mDataBlock->shapeAssetRef.isNull())
|
||||
return;
|
||||
|
||||
Resource<TSShape> shape = mDataBlock->shapeAssetRef.assetPtr->getShapeResource();
|
||||
if (!shape)
|
||||
return;
|
||||
|
||||
// It is assumed that we will never accelerate more than 10 m/s for gravity...
|
||||
//
|
||||
Point3F scaledVelocity = mVelocity * dt * TickSec;
|
||||
F32 len = scaledVelocity.len();
|
||||
F32 newLen = len + (mDataBlock->getShape()->mRadius * dt * TickSec);
|
||||
F32 newLen = len + (shape->mRadius * dt * TickSec);
|
||||
|
||||
// Check to see if it is actually necessary to construct the new working list,
|
||||
// or if we can use the cached version from the last query. We use the x
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue