mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
hybridize suggested approaches with older code style, passing along either a matrix or a null.
for network transmission purposes, send which along as a bool
This commit is contained in:
parent
b12cd00b74
commit
846cec8dff
3 changed files with 52 additions and 70 deletions
|
|
@ -1566,11 +1566,7 @@ void GameConnection::play2D(StringTableEntry assetId)
|
|||
{
|
||||
if (AssetDatabase.isDeclaredAsset(assetId))
|
||||
{
|
||||
AssetPtr<SoundAsset> tempSoundAsset = assetId;
|
||||
if (tempSoundAsset && tempSoundAsset->is3D())
|
||||
{
|
||||
postNetEvent(new SimSoundAssetEvent(assetId, SFX->getListener(0).getTransform()));
|
||||
}
|
||||
postNetEvent(new SimSoundAssetEvent(assetId));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1586,7 +1582,7 @@ void GameConnection::play3D(StringTableEntry assetId, const MatrixF *transform)
|
|||
tempSoundAsset = assetId;
|
||||
|
||||
if (!mControlObject)
|
||||
postNetEvent(new SimSoundAssetEvent(assetId, *transform));
|
||||
postNetEvent(new SimSoundAssetEvent(assetId, transform));
|
||||
else
|
||||
{
|
||||
// TODO: Maybe improve this to account for the duration
|
||||
|
|
@ -1600,7 +1596,7 @@ void GameConnection::play3D(StringTableEntry assetId, const MatrixF *transform)
|
|||
transform->getColumn(3, &pos);
|
||||
mControlObject->getTransform().getColumn(3, &ear);
|
||||
if ((ear - pos).len() < tempSoundAsset->getSfxDescription()->mMaxDistance)
|
||||
postNetEvent(new SimSoundAssetEvent(assetId, *transform));
|
||||
postNetEvent(new SimSoundAssetEvent(assetId, transform));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue