mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-20 03:45:26 +00:00
commit
3082bb3adc
28 changed files with 132 additions and 74 deletions
|
|
@ -99,7 +99,6 @@ DebrisData::DebrisData()
|
|||
friction = 0.2f;
|
||||
numBounces = 0;
|
||||
bounceVariance = 0;
|
||||
minSpinSpeed = maxSpinSpeed = 0.0;
|
||||
staticOnMaxBounce = false;
|
||||
explodeOnMaxBounce = false;
|
||||
snapOnMaxBounce = false;
|
||||
|
|
@ -659,11 +658,7 @@ void Debris::onRemove()
|
|||
}
|
||||
}
|
||||
|
||||
if( getSceneManager() )
|
||||
getSceneManager()->removeObjectFromScene(this);
|
||||
|
||||
if( getContainer() )
|
||||
getContainer()->removeObject(this);
|
||||
removeFromScene();
|
||||
|
||||
Parent::onRemove();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -964,10 +964,7 @@ void Explosion::onRemove()
|
|||
mMainEmitter = NULL;
|
||||
}
|
||||
|
||||
if (getSceneManager() != NULL)
|
||||
getSceneManager()->removeObjectFromScene(this);
|
||||
if (getContainer() != NULL)
|
||||
getContainer()->removeObject(this);
|
||||
removeFromScene();
|
||||
|
||||
Parent::onRemove();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -415,11 +415,7 @@ void Splash::onRemove()
|
|||
|
||||
ringList.clear();
|
||||
|
||||
if( getSceneManager() )
|
||||
getSceneManager()->removeObjectFromScene(this);
|
||||
|
||||
if( getContainer() )
|
||||
getContainer()->removeObject(this);
|
||||
removeFromScene();
|
||||
|
||||
Parent::onRemove();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ GuiObjectView::GuiObjectView()
|
|||
{
|
||||
mCameraMatrix.identity();
|
||||
mCameraRot.set( 0.0f, 0.0f, 3.9f );
|
||||
mCameraPos.set( 0.0f, 1.75f, 1.25f );
|
||||
mCameraPos.set( 0.0f, 0.0f, 0.0f );
|
||||
mCameraMatrix.setColumn( 3, mCameraPos );
|
||||
mOrbitPos.set( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
|
|
@ -520,9 +520,9 @@ void GuiObjectView::renderWorld( const RectI& updateRect )
|
|||
(
|
||||
gClientSceneGraph,
|
||||
SPT_Diffuse,
|
||||
SceneCameraState( GFX->getViewport(), frust, GFX->getWorldMatrix(), GFX->getProjectionMatrix() ),
|
||||
SceneCameraState( GFX->getViewport(), frust, MatrixF::Identity, GFX->getProjectionMatrix() ),
|
||||
renderPass,
|
||||
false
|
||||
true
|
||||
);
|
||||
|
||||
// Set up our TS render state here.
|
||||
|
|
|
|||
|
|
@ -356,6 +356,7 @@ PlayerData::PlayerData()
|
|||
decalID = 0;
|
||||
decalOffset = 0.0f;
|
||||
|
||||
actionCount = 0;
|
||||
lookAction = 0;
|
||||
|
||||
// size of bounding box
|
||||
|
|
@ -3691,7 +3692,7 @@ bool Player::setActionThread(const char* sequence,bool hold,bool wait,bool fsp)
|
|||
|
||||
void Player::setActionThread(U32 action,bool forward,bool hold,bool wait,bool fsp, bool forceSet)
|
||||
{
|
||||
if (!mDataBlock || (mActionAnimation.action == action && mActionAnimation.forward == forward && !forceSet))
|
||||
if (!mDataBlock || !mDataBlock->actionCount || (mActionAnimation.action == action && mActionAnimation.forward == forward && !forceSet))
|
||||
return;
|
||||
|
||||
if (action >= PlayerData::NumActionAnims)
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ ConsoleDocClass( RigidShapeData,
|
|||
"@see RigidShape\n"
|
||||
"@see ShapeBase\n\n"
|
||||
|
||||
"@ingroup Platform\n"
|
||||
"@ingroup Physics\n"
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ ConsoleDocClass( RigidShape,
|
|||
"@see RigidShapeData\n"
|
||||
"@see ShapeBase\n\n"
|
||||
|
||||
"@ingroup Platform\n"
|
||||
"@ingroup Physics\n"
|
||||
);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,9 @@ void SFX3DObject::getEarTransform( MatrixF& transform ) const
|
|||
if ( !shapeInstance )
|
||||
{
|
||||
// Just in case.
|
||||
transform = mObject->getTransform();
|
||||
GameConnection* connection = dynamic_cast<GameConnection *>(NetConnection::getConnectionToServer());
|
||||
if ( !connection || !connection->getControlCameraTransform( 0.0f, &transform ) )
|
||||
transform = mObject->getTransform();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -702,41 +702,9 @@ bool TSStatic::castRay(const Point3F &start, const Point3F &end, RayInfo* info)
|
|||
|
||||
if ( mCollisionType == Bounds )
|
||||
{
|
||||
F32 st, et, fst = 0.0f, fet = 1.0f;
|
||||
F32 *bmin = &mObjBox.minExtents.x;
|
||||
F32 *bmax = &mObjBox.maxExtents.x;
|
||||
F32 const *si = &start.x;
|
||||
F32 const *ei = &end.x;
|
||||
|
||||
for ( U32 i = 0; i < 3; i++ )
|
||||
{
|
||||
if (*si < *ei)
|
||||
{
|
||||
if ( *si > *bmax || *ei < *bmin )
|
||||
return false;
|
||||
F32 di = *ei - *si;
|
||||
st = ( *si < *bmin ) ? ( *bmin - *si ) / di : 0.0f;
|
||||
et = ( *ei > *bmax ) ? ( *bmax - *si ) / di : 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( *ei > *bmax || *si < *bmin )
|
||||
return false;
|
||||
F32 di = *ei - *si;
|
||||
st = ( *si > *bmax ) ? ( *bmax - *si ) / di : 0.0f;
|
||||
et = ( *ei < *bmin ) ? ( *bmin - *si ) / di : 1.0f;
|
||||
}
|
||||
if ( st > fst ) fst = st;
|
||||
if ( et < fet ) fet = et;
|
||||
if ( fet < fst )
|
||||
return false;
|
||||
bmin++; bmax++;
|
||||
si++; ei++;
|
||||
}
|
||||
|
||||
info->normal = start - end;
|
||||
info->normal.normalizeSafe();
|
||||
getTransform().mulV( info->normal );
|
||||
F32 fst;
|
||||
if (!mObjBox.collideLine(start, end, &fst, &info->normal))
|
||||
return false;
|
||||
|
||||
info->t = fst;
|
||||
info->object = this;
|
||||
|
|
|
|||
|
|
@ -1155,7 +1155,7 @@ void TurretShape::unpackUpdate(NetConnection *connection, BitStream *stream)
|
|||
void TurretShape::getWeaponMountTransform( S32 index, const MatrixF &xfm, MatrixF *outMat )
|
||||
{
|
||||
// Returns mount point to world space transform
|
||||
if ( index >= 0 && index < SceneObject::NumMountPoints) {
|
||||
if ( index >= 0 && index < ShapeBase::MaxMountedImages) {
|
||||
S32 ni = mDataBlock->weaponMountNode[index];
|
||||
if (ni != -1) {
|
||||
MatrixF mountTransform = mShapeInstance->mNodeTransforms[ni];
|
||||
|
|
@ -1180,7 +1180,7 @@ void TurretShape::getWeaponMountTransform( S32 index, const MatrixF &xfm, Matrix
|
|||
void TurretShape::getRenderWeaponMountTransform( F32 delta, S32 mountPoint, const MatrixF &xfm, MatrixF *outMat )
|
||||
{
|
||||
// Returns mount point to world space transform
|
||||
if ( mountPoint >= 0 && mountPoint < SceneObject::NumMountPoints) {
|
||||
if ( mountPoint >= 0 && mountPoint < ShapeBase::MaxMountedImages) {
|
||||
S32 ni = mDataBlock->weaponMountNode[mountPoint];
|
||||
if (ni != -1) {
|
||||
MatrixF mountTransform = mShapeInstance->mNodeTransforms[ni];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue