mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
truly a community project, this has been kicking around since 2003 in various forms. adds a path following shape that can be ridden.
This commit is contained in:
parent
f007700646
commit
f7f8faf47e
14 changed files with 1399 additions and 8 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include "core/stream/bitStream.h"
|
||||
#include "renderInstance/renderPassManager.h"
|
||||
#include "console/engineAPI.h"
|
||||
#include "T3D/pathShape.h"
|
||||
|
||||
#include "T3D/Scene.h"
|
||||
|
||||
|
|
@ -155,6 +156,11 @@ Path::Path()
|
|||
{
|
||||
mPathIndex = NoPathIndex;
|
||||
mIsLooping = true;
|
||||
mPathSpeed = 1.0f;
|
||||
mDataBlock = NULL;
|
||||
mSpawnCount = 1;
|
||||
mMinDelay = 0;
|
||||
mMaxDelay = 0;
|
||||
}
|
||||
|
||||
Path::~Path()
|
||||
|
|
@ -166,6 +172,13 @@ Path::~Path()
|
|||
void Path::initPersistFields()
|
||||
{
|
||||
addField("isLooping", TypeBool, Offset(mIsLooping, Path), "If this is true, the loop is closed, otherwise it is open.\n");
|
||||
addField("Speed", TypeF32, Offset(mPathSpeed, Path), "Speed.\n");
|
||||
addProtectedField("mPathShape", TYPEID< PathShapeData >(), Offset(mDataBlock, Path),
|
||||
&setDataBlockProperty, &defaultProtectedGetFn,
|
||||
"@brief Spawned PathShape.\n\n");
|
||||
addField("spawnCount", TypeS32, Offset(mSpawnCount, Path), "Spawn Count.\n");
|
||||
addField("minDelay", TypeS32, Offset(mMinDelay, Path), "Spawn Delay (min).\n");
|
||||
addField("maxDelay", TypeS32, Offset(mMaxDelay, Path), "Spawn Delay (max).\n");
|
||||
|
||||
Parent::initPersistFields();
|
||||
//
|
||||
|
|
@ -179,9 +192,14 @@ bool Path::onAdd()
|
|||
if(!Parent::onAdd())
|
||||
return false;
|
||||
|
||||
onAdd_callback(getId());
|
||||
return true;
|
||||
}
|
||||
|
||||
IMPLEMENT_CALLBACK(Path, onAdd, void, (SimObjectId ID), (ID),
|
||||
"Called when this ScriptGroup is added to the system.\n"
|
||||
"@param ID Unique object ID assigned when created (%this in script).\n"
|
||||
);
|
||||
|
||||
void Path::onRemove()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue