mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Merge branch 'spawnsphere-transform' of https://github.com/eightyeight/Torque3D into eightyeight-spawnsphere-transform
This commit is contained in:
commit
394d87cd54
2 changed files with 12 additions and 0 deletions
|
|
@ -382,6 +382,7 @@ ConsoleDocClass( SpawnSphere,
|
||||||
SpawnSphere::SpawnSphere()
|
SpawnSphere::SpawnSphere()
|
||||||
{
|
{
|
||||||
mAutoSpawn = false;
|
mAutoSpawn = false;
|
||||||
|
mSpawnTransform = false;
|
||||||
|
|
||||||
mRadius = 100.f;
|
mRadius = 100.f;
|
||||||
mSphereWeight = 100.f;
|
mSphereWeight = 100.f;
|
||||||
|
|
@ -420,6 +421,12 @@ SimObject* SpawnSphere::spawnObject(String additionalProps)
|
||||||
// If we have a spawnObject add it to the MissionCleanup group
|
// If we have a spawnObject add it to the MissionCleanup group
|
||||||
if (spawnObject)
|
if (spawnObject)
|
||||||
{
|
{
|
||||||
|
if (mSpawnTransform)
|
||||||
|
{
|
||||||
|
if(SceneObject *s = dynamic_cast<SceneObject*>(spawnObject))
|
||||||
|
s->setTransform(getTransform());
|
||||||
|
}
|
||||||
|
|
||||||
SimObject* cleanup = Sim::findObject("MissionCleanup");
|
SimObject* cleanup = Sim::findObject("MissionCleanup");
|
||||||
|
|
||||||
if (cleanup)
|
if (cleanup)
|
||||||
|
|
@ -447,6 +454,7 @@ U32 SpawnSphere::packUpdate(NetConnection * con, U32 mask, BitStream * stream)
|
||||||
if(stream->writeFlag(mask & UpdateSphereMask))
|
if(stream->writeFlag(mask & UpdateSphereMask))
|
||||||
{
|
{
|
||||||
stream->writeFlag(mAutoSpawn);
|
stream->writeFlag(mAutoSpawn);
|
||||||
|
stream->writeFlag(mSpawnTransform);
|
||||||
|
|
||||||
stream->write(mSpawnClass);
|
stream->write(mSpawnClass);
|
||||||
stream->write(mSpawnDataBlock);
|
stream->write(mSpawnDataBlock);
|
||||||
|
|
@ -463,6 +471,7 @@ void SpawnSphere::unpackUpdate(NetConnection * con, BitStream * stream)
|
||||||
if(stream->readFlag())
|
if(stream->readFlag())
|
||||||
{
|
{
|
||||||
mAutoSpawn = stream->readFlag();
|
mAutoSpawn = stream->readFlag();
|
||||||
|
mSpawnTransform = stream->readFlag();
|
||||||
|
|
||||||
stream->read(&mSpawnClass);
|
stream->read(&mSpawnClass);
|
||||||
stream->read(&mSpawnDataBlock);
|
stream->read(&mSpawnDataBlock);
|
||||||
|
|
@ -505,6 +514,8 @@ void SpawnSphere::initPersistFields()
|
||||||
"Command to execute immediately after spawning an object. New object id is stored in $SpawnObject. Max 255 characters." );
|
"Command to execute immediately after spawning an object. New object id is stored in $SpawnObject. Max 255 characters." );
|
||||||
addField( "autoSpawn", TypeBool, Offset(mAutoSpawn, SpawnSphere),
|
addField( "autoSpawn", TypeBool, Offset(mAutoSpawn, SpawnSphere),
|
||||||
"Flag to spawn object as soon as SpawnSphere is created, true to enable or false to disable." );
|
"Flag to spawn object as soon as SpawnSphere is created, true to enable or false to disable." );
|
||||||
|
addField( "spawnTransform", TypeBool, Offset(mSpawnTransform, SpawnSphere),
|
||||||
|
"Flag to set the spawned object's transform to the SpawnSphere's transform." );
|
||||||
endGroup( "Spawn" );
|
endGroup( "Spawn" );
|
||||||
|
|
||||||
addGroup( "Dimensions" );
|
addGroup( "Dimensions" );
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,7 @@ class SpawnSphere : public MissionMarker
|
||||||
String mSpawnProperties;
|
String mSpawnProperties;
|
||||||
String mSpawnScript;
|
String mSpawnScript;
|
||||||
bool mAutoSpawn;
|
bool mAutoSpawn;
|
||||||
|
bool mSpawnTransform;
|
||||||
|
|
||||||
// Radius/weight info
|
// Radius/weight info
|
||||||
F32 mRadius;
|
F32 mRadius;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue