mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-27 07:15:37 +00:00
Merge branch 'development' of https://github.com/GarageGames/Torque3D into andOrMaybe
Conflicts: Engine/source/T3D/staticShape.cpp
This commit is contained in:
commit
dd071484da
517 changed files with 87707 additions and 178465 deletions
|
|
@ -91,9 +91,9 @@ ConsoleSetType(TypeComponentAssetPtr)
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
ComponentAsset::ComponentAsset() :
|
||||
mAcquireReferenceCount(0),
|
||||
mpOwningAssetManager(NULL),
|
||||
mAssetInitialized(false)
|
||||
mAssetInitialized(false),
|
||||
mAcquireReferenceCount(0)
|
||||
{
|
||||
// Generate an asset definition.
|
||||
mpAssetDefinition = new AssetDefinition();
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ ConsoleSetType(TypeExampleAssetPtr)
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
ExampleAsset::ExampleAsset() :
|
||||
mAcquireReferenceCount(0),
|
||||
mpOwningAssetManager(NULL),
|
||||
mAssetInitialized(false)
|
||||
mAssetInitialized(false),
|
||||
mAcquireReferenceCount(0)
|
||||
{
|
||||
// Generate an asset definition.
|
||||
mpAssetDefinition = new AssetDefinition();
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ ConsoleSetType(TypeGameObjectAssetPtr)
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
GameObjectAsset::GameObjectAsset() :
|
||||
mAcquireReferenceCount(0),
|
||||
mpOwningAssetManager(NULL),
|
||||
mAssetInitialized(false)
|
||||
mAssetInitialized(false),
|
||||
mAcquireReferenceCount(0)
|
||||
{
|
||||
// Generate an asset definition.
|
||||
mpAssetDefinition = new AssetDefinition();
|
||||
|
|
|
|||
|
|
@ -45,9 +45,6 @@
|
|||
// Debug Profiling.
|
||||
#include "platform/profiler.h"
|
||||
|
||||
static U32 execDepth = 0;
|
||||
static U32 journalDepth = 1;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_CONOBJECT(ShapeAsset);
|
||||
|
|
@ -96,9 +93,9 @@ ConsoleSetType(TypeShapeAssetPtr)
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
ShapeAsset::ShapeAsset() :
|
||||
mAcquireReferenceCount(0),
|
||||
mpOwningAssetManager(NULL),
|
||||
mAssetInitialized(false)
|
||||
mAssetInitialized(false),
|
||||
mAcquireReferenceCount(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,14 +39,14 @@ class WaterObject;
|
|||
struct ContainerQueryInfo
|
||||
{
|
||||
ContainerQueryInfo()
|
||||
: waterCoverage(0.0f),
|
||||
: box(-1,-1,-1,1,1,1),
|
||||
mass(1.0f),
|
||||
waterCoverage(0.0f),
|
||||
waterHeight(0.0f),
|
||||
waterDensity(0.0f),
|
||||
waterViscosity(0.0f),
|
||||
gravityScale(1.0f),
|
||||
appliedForce(0,0,0),
|
||||
box(-1,-1,-1,1,1,1),
|
||||
mass(1.0f),
|
||||
waterObject(NULL)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,12 +227,12 @@ bool ConvexShape::protectedSetSurface( void *object, const char *index, const ch
|
|||
|
||||
|
||||
ConvexShape::ConvexShape()
|
||||
: mMaterialInst( NULL ),
|
||||
mNormalLength( 0.3f ),
|
||||
: mMaterialName( "Grid512_OrangeLines_Mat" ),
|
||||
mMaterialInst( NULL ),
|
||||
mVertCount( 0 ),
|
||||
mPrimCount( 0 ),
|
||||
mMaterialName( "Grid512_OrangeLines_Mat" ),
|
||||
mPhysicsRep( NULL )
|
||||
mPhysicsRep( NULL ),
|
||||
mNormalLength( 0.3f )
|
||||
{
|
||||
mNetFlags.set( Ghostable | ScopeAlways );
|
||||
|
||||
|
|
@ -1102,8 +1102,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
|
|||
const Vector< ConvexShape::Triangle > &triangles = face.triangles;
|
||||
const ColorI &faceColor = sgConvexFaceColors[ i % sgConvexFaceColorCount ];
|
||||
|
||||
const Point3F binormal = mCross( face.normal, face.tangent );
|
||||
|
||||
for ( S32 j = 0; j < triangles.size(); j++ )
|
||||
{
|
||||
for ( S32 k = 0; k < 3; k++ )
|
||||
|
|
|
|||
|
|
@ -43,9 +43,6 @@
|
|||
|
||||
const U32 csmStaticCollisionMask = TerrainObjectType | StaticShapeObjectType | StaticObjectType;
|
||||
|
||||
const U32 csmDynamicCollisionMask = StaticShapeObjectType;
|
||||
|
||||
|
||||
IMPLEMENT_CO_DATABLOCK_V1(DebrisData);
|
||||
|
||||
ConsoleDocClass( DebrisData,
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ struct DebrisData : public GameBaseData
|
|||
F32 elasticity;
|
||||
F32 lifetime;
|
||||
F32 lifetimeVariance;
|
||||
U32 numBounces;
|
||||
U32 bounceVariance;
|
||||
S32 numBounces;
|
||||
S32 bounceVariance;
|
||||
F32 minSpinSpeed;
|
||||
F32 maxSpinSpeed;
|
||||
bool explodeOnMaxBounce; // explodes after it has bounced max times
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ class GuiHealthBarHud : public GuiControl
|
|||
bool mShowFrame;
|
||||
bool mShowFill;
|
||||
bool mDisplayEnergy;
|
||||
bool mFlip;
|
||||
|
||||
ColorF mFillColor;
|
||||
ColorF mFrameColor;
|
||||
|
|
@ -105,6 +106,8 @@ GuiHealthBarHud::GuiHealthBarHud()
|
|||
mPulseRate = 0;
|
||||
mPulseThreshold = 0.3f;
|
||||
mValue = 0.2f;
|
||||
|
||||
mFlip = false;
|
||||
}
|
||||
|
||||
void GuiHealthBarHud::initPersistFields()
|
||||
|
|
@ -124,6 +127,7 @@ void GuiHealthBarHud::initPersistFields()
|
|||
addField( "showFill", TypeBool, Offset( mShowFill, GuiHealthBarHud ), "If true, we draw the background color of the control." );
|
||||
addField( "showFrame", TypeBool, Offset( mShowFrame, GuiHealthBarHud ), "If true, we draw the frame of the control." );
|
||||
addField( "displayEnergy", TypeBool, Offset( mDisplayEnergy, GuiHealthBarHud ), "If true, display the energy value rather than the damage value." );
|
||||
addField( "flip", TypeBool, Offset( mFlip, GuiHealthBarHud), "If true, will fill bar in opposite direction.");
|
||||
endGroup("Misc");
|
||||
|
||||
Parent::initPersistFields();
|
||||
|
|
@ -163,6 +167,7 @@ void GuiHealthBarHud::onRender(Point2I offset, const RectI &updateRect)
|
|||
|
||||
// Pulse the damage fill if it's below the threshold
|
||||
if (mPulseRate != 0)
|
||||
{
|
||||
if (mValue < mPulseThreshold)
|
||||
{
|
||||
U32 time = Platform::getVirtualMilliseconds();
|
||||
|
|
@ -171,16 +176,25 @@ void GuiHealthBarHud::onRender(Point2I offset, const RectI &updateRect)
|
|||
}
|
||||
else
|
||||
mDamageFillColor.alpha = 1;
|
||||
|
||||
}
|
||||
// Render damage fill %
|
||||
RectI rect(updateRect);
|
||||
if(getWidth() > getHeight())
|
||||
{
|
||||
rect.extent.x = (S32)(rect.extent.x * mValue);
|
||||
|
||||
if(mFlip)
|
||||
rect.point.x = (S32)(updateRect.point.x + (updateRect.extent.x - rect.extent.x));
|
||||
}
|
||||
else
|
||||
{
|
||||
S32 bottomY = rect.point.y + rect.extent.y;
|
||||
rect.extent.y = (S32)(rect.extent.y * mValue);
|
||||
rect.point.y = bottomY - rect.extent.y;
|
||||
|
||||
if(mFlip)
|
||||
rect.extent.y = (S32)(updateRect.extent.y - (updateRect.extent.y - rect.extent.y));
|
||||
else
|
||||
rect.point.y = bottomY - rect.extent.y;
|
||||
}
|
||||
GFX->getDrawUtil()->drawRectFill(rect, mDamageFillColor);
|
||||
|
||||
|
|
|
|||
|
|
@ -110,9 +110,6 @@ ConsoleDocClass( GuiShapeNameHud,
|
|||
"@ingroup GuiGame\n"
|
||||
);
|
||||
|
||||
/// Default distance for object's information to be displayed.
|
||||
static const F32 cDefaultVisibleDistance = 500.0f;
|
||||
|
||||
GuiShapeNameHud::GuiShapeNameHud()
|
||||
{
|
||||
mFillColor.set( 0.25f, 0.25f, 0.25f, 0.25f );
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@ ConsoleDocClass( fxFoliageReplicator,
|
|||
// Trig Table Lookups.
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
const F32 PeriodLen = (F32) 2.0f * (F32) M_PI;
|
||||
const F32 PeriodLenMinus = (F32) (2.0f * M_PI) - 0.01f;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -60,14 +60,14 @@ GFXImplementVertexFormat( GCVertex )
|
|||
};
|
||||
|
||||
GroundCoverShaderConstHandles::GroundCoverShaderConstHandles()
|
||||
: mTypeRectsSC( NULL ),
|
||||
: mGroundCover( NULL ),
|
||||
mTypeRectsSC( NULL ),
|
||||
mFadeSC( NULL ),
|
||||
mWindDirSC( NULL ),
|
||||
mGustInfoSC( NULL ),
|
||||
mTurbInfoSC( NULL ),
|
||||
mCamRightSC( NULL ),
|
||||
mCamUpSC( NULL ),
|
||||
mGroundCover( NULL )
|
||||
mCamUpSC( NULL )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class ParticleEmitterData : public GameBaseData
|
|||
/// of the ambient color on the particle.
|
||||
F32 ambientFactor;
|
||||
|
||||
U32 lifetimeMS; ///< Lifetime of particles
|
||||
S32 lifetimeMS; ///< Lifetime of particles
|
||||
U32 lifetimeVarianceMS; ///< Varience in lifetime from 0 to n
|
||||
|
||||
bool overrideAdvance; ///<
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ void Ribbon::addSegmentPoint(Point3F &point, MatrixF &mat) {
|
|||
U32 segmentsToDelete = checkRibbonDistance(mDataBlock->segmentsPerUpdate);
|
||||
|
||||
for (U32 i = 0; i < segmentsToDelete; i++) {
|
||||
U32 last = mSegmentPoints.size() - 1;
|
||||
S32 last = mSegmentPoints.size() - 1;
|
||||
if (last < 0)
|
||||
break;
|
||||
mTravelledDistance += last ? (mSegmentPoints[last] - mSegmentPoints[last-1]).len() : 0;
|
||||
|
|
|
|||
|
|
@ -97,14 +97,14 @@ IMPLEMENT_CALLBACK( GameBaseData, onRemove, void, ( GameBase* obj ), ( obj ),
|
|||
"@param obj the GameBase object\n\n"
|
||||
"@see onAdd for an example\n" );
|
||||
|
||||
IMPLEMENT_CALLBACK( GameBaseData, onMount, void, ( GameBase* obj, SceneObject* mountObj, S32 node ), ( obj, mountObj, node ),
|
||||
IMPLEMENT_CALLBACK( GameBaseData, onMount, void, ( SceneObject* obj, SceneObject* mountObj, S32 node ), ( obj, mountObj, node ),
|
||||
"@brief Called when the object is mounted to another object in the scene.\n\n"
|
||||
"@param obj the GameBase object being mounted\n"
|
||||
"@param mountObj the object we are mounted to\n"
|
||||
"@param node the mountObj node we are mounted to\n\n"
|
||||
"@see onAdd for an example\n" );
|
||||
|
||||
IMPLEMENT_CALLBACK( GameBaseData, onUnmount, void, ( GameBase* obj, SceneObject* mountObj, S32 node ), ( obj, mountObj, node ),
|
||||
IMPLEMENT_CALLBACK( GameBaseData, onUnmount, void, ( SceneObject* obj, SceneObject* mountObj, S32 node ), ( obj, mountObj, node ),
|
||||
"@brief Called when the object is unmounted from another object in the scene.\n\n"
|
||||
"@param obj the GameBase object being unmounted\n"
|
||||
"@param mountObj the object we are unmounted from\n"
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ public:
|
|||
DECLARE_CALLBACK( void, onAdd, ( GameBase* obj ) );
|
||||
DECLARE_CALLBACK( void, onRemove, ( GameBase* obj ) );
|
||||
DECLARE_CALLBACK( void, onNewDataBlock, ( GameBase* obj ) );
|
||||
DECLARE_CALLBACK( void, onMount, ( GameBase* obj, SceneObject* mountObj, S32 node ) );
|
||||
DECLARE_CALLBACK( void, onUnmount, ( GameBase* obj, SceneObject* mountObj, S32 node ) );
|
||||
DECLARE_CALLBACK( void, onMount, ( SceneObject* obj, SceneObject* mountObj, S32 node ) );
|
||||
DECLARE_CALLBACK( void, onUnmount, ( SceneObject* obj, SceneObject* mountObj, S32 node ) );
|
||||
/// @}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,12 @@ class BitStream;
|
|||
|
||||
struct Move
|
||||
{
|
||||
enum { ChecksumBits = 16, ChecksumMask = ((1<<ChecksumBits)-1), ChecksumMismatch = U32(-1) };
|
||||
enum : U32
|
||||
{
|
||||
ChecksumBits = 16,
|
||||
ChecksumMask = ((1<<ChecksumBits)-1),
|
||||
ChecksumMismatch = U32(-1)
|
||||
};
|
||||
|
||||
// packed storage rep, set in clamp
|
||||
S32 px, py, pz;
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@ GroundPlane::GroundPlane()
|
|||
mScaleU( 1.0f ),
|
||||
mScaleV( 1.0f ),
|
||||
mMaterial( NULL ),
|
||||
mPhysicsRep( NULL ),
|
||||
mMin( 0.0f, 0.0f ),
|
||||
mMax( 0.0f, 0.0f ),
|
||||
mPhysicsRep( NULL )
|
||||
mMax( 0.0f, 0.0f )
|
||||
{
|
||||
mTypeMask |= StaticObjectType | StaticShapeObjectType;
|
||||
mNetFlags.set( Ghostable | ScopeAlways );
|
||||
|
|
|
|||
|
|
@ -36,15 +36,15 @@
|
|||
|
||||
// GuiMaterialPreview
|
||||
GuiMaterialPreview::GuiMaterialPreview()
|
||||
: mMaxOrbitDist(5.0f),
|
||||
mMinOrbitDist(0.0f),
|
||||
mOrbitDist(5.0f),
|
||||
mMouseState(None),
|
||||
: mMouseState(None),
|
||||
mModel(NULL),
|
||||
mLastMousePoint(0, 0),
|
||||
lastRenderTime(0),
|
||||
runThread(0),
|
||||
mFakeSun(NULL)
|
||||
lastRenderTime(0),
|
||||
mLastMousePoint(0, 0),
|
||||
mFakeSun(NULL),
|
||||
mMaxOrbitDist(5.0f),
|
||||
mMinOrbitDist(0.0f),
|
||||
mOrbitDist(5.0f)
|
||||
{
|
||||
mActive = true;
|
||||
mCameraMatrix.identity();
|
||||
|
|
|
|||
|
|
@ -89,21 +89,21 @@ IMPLEMENT_CALLBACK( GuiObjectView, onMouseLeave, void, (),(),
|
|||
//------------------------------------------------------------------------------
|
||||
|
||||
GuiObjectView::GuiObjectView()
|
||||
: mMaxOrbitDist( 5.0f ),
|
||||
mMinOrbitDist( 0.0f ),
|
||||
mOrbitDist( 5.0f ),
|
||||
mMouseState( None ),
|
||||
mModel( NULL ),
|
||||
mMountedModel( NULL ),
|
||||
: mMouseState( None ),
|
||||
mLastMousePoint( 0, 0 ),
|
||||
mLastRenderTime( 0 ),
|
||||
mRunThread( NULL ),
|
||||
mLight( NULL ),
|
||||
mAnimationSeq( -1 ),
|
||||
mMountNodeName( "mount0" ),
|
||||
mMountNode( -1 ),
|
||||
mModel( NULL ),
|
||||
mMaxOrbitDist( 5.0f ),
|
||||
mMinOrbitDist( 0.0f ),
|
||||
mCameraRotation( 0.0f, 0.0f, 0.0f ),
|
||||
mOrbitDist( 5.0f ),
|
||||
mCameraSpeed( 0.01f ),
|
||||
mCameraRotation( 0.0f, 0.0f, 0.0f ),
|
||||
mMountNode( -1 ),
|
||||
mMountNodeName( "mount0" ),
|
||||
mMountedModel( NULL ),
|
||||
mAnimationSeq( -1 ),
|
||||
mRunThread( NULL ),
|
||||
mLastRenderTime( 0 ),
|
||||
mLight( NULL ),
|
||||
mLightColor( 1.0f, 1.0f, 1.0f ),
|
||||
mLightAmbient( 0.5f, 0.5f, 0.5f ),
|
||||
mLightDirection( 0.f, 0.707f, -0.707f )
|
||||
|
|
|
|||
|
|
@ -79,16 +79,16 @@ static SFXAmbience sDefaultAmbience;
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
LevelInfo::LevelInfo()
|
||||
: mNearClip( 0.1f ),
|
||||
: mWorldSize( 10000.0f ),
|
||||
mNearClip( 0.1f ),
|
||||
mVisibleDistance( 1000.0f ),
|
||||
mVisibleGhostDistance ( 0 ),
|
||||
mDecalBias( 0.0015f ),
|
||||
mCanvasClearColor( 255, 0, 255, 255 ),
|
||||
mAmbientLightBlendPhase( 1.f ),
|
||||
mSoundAmbience( NULL ),
|
||||
mSoundscape( NULL ),
|
||||
mSoundDistanceModel( SFXDistanceModelLinear ),
|
||||
mWorldSize( 10000.0f ),
|
||||
mAmbientLightBlendPhase( 1.f )
|
||||
mSoundscape( NULL )
|
||||
{
|
||||
mFogData.density = 0.0f;
|
||||
mFogData.densityOffset = 0.0f;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ void LightBase::initPersistFields()
|
|||
addField( "brightness", TypeF32, Offset( mBrightness, LightBase ), "Adjusts the lights power, 0 being off completely." );
|
||||
addField( "castShadows", TypeBool, Offset( mCastShadows, LightBase ), "Enables/disabled shadow casts by this light." );
|
||||
addField( "staticRefreshFreq", TypeS32, Offset( mStaticRefreshFreq, LightBase ), "static shadow refresh rate (milliseconds)" );
|
||||
addField( "dynamicRefreshFreq", TypeS32, Offset( mDynamicRefreshFreq, LightBase ), "dynamic shadow refresh rate (milliseconds)" );
|
||||
addField( "dynamicRefreshFreq", TypeS32, Offset( mDynamicRefreshFreq, LightBase ), "dynamic shadow refresh rate (milliseconds)", AbstractClassRep::FieldFlags::FIELD_HideInInspectors);
|
||||
addField( "priority", TypeF32, Offset( mPriority, LightBase ), "Used for sorting of lights by the light manager. "
|
||||
"Priority determines if a light has a stronger effect than, those with a lower value" );
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ void LightDescription::initPersistFields()
|
|||
addField( "range", TypeF32, Offset( range, LightDescription ), "Controls the size (radius) of the light" );
|
||||
addField( "castShadows", TypeBool, Offset( castShadows, LightDescription ), "Enables/disabled shadow casts by this light." );
|
||||
addField( "staticRefreshFreq", TypeS32, Offset( mStaticRefreshFreq, LightDescription ), "static shadow refresh rate (milliseconds)" );
|
||||
addField( "dynamicRefreshFreq", TypeS32, Offset( mDynamicRefreshFreq, LightDescription ), "dynamic shadow refresh rate (milliseconds)" );
|
||||
addField( "dynamicRefreshFreq", TypeS32, Offset( mDynamicRefreshFreq, LightDescription ), "dynamic shadow refresh rate (milliseconds)", AbstractClassRep::FieldFlags::FIELD_HideInInspectors);
|
||||
|
||||
endGroup( "Light" );
|
||||
|
||||
|
|
|
|||
|
|
@ -118,11 +118,11 @@ ConsoleDocClass( LightFlareData,
|
|||
);
|
||||
|
||||
LightFlareData::LightFlareData()
|
||||
: mFlareEnabled( true ),
|
||||
mElementCount( 0 ),
|
||||
mScale( 1.0f ),
|
||||
: mScale( 1.0f ),
|
||||
mFlareEnabled( true ),
|
||||
mOcclusionRadius( 0.0f ),
|
||||
mRenderReflectPass( true )
|
||||
mRenderReflectPass( true ),
|
||||
mElementCount( 0 )
|
||||
{
|
||||
dMemset( mElementRect, 0, sizeof( RectF ) * MAX_ELEMENTS );
|
||||
dMemset( mElementScale, 0, sizeof( F32 ) * MAX_ELEMENTS );
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ enum SceneObjectTypes
|
|||
/// @}
|
||||
};
|
||||
|
||||
enum SceneObjectTypeMasks
|
||||
enum SceneObjectTypeMasks : U32
|
||||
{
|
||||
STATIC_COLLISION_TYPEMASK = (StaticShapeObjectType |
|
||||
EntityObjectType),
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ struct PhysicsState
|
|||
momentum( Point3F::Zero ),
|
||||
orientation( QuatF::Identity ),
|
||||
angularMomentum( Point3F::Zero ),
|
||||
sleeping( false ),
|
||||
linVelocity( Point3F::Zero ),
|
||||
angVelocity( Point3F::Zero ),
|
||||
sleeping( false )
|
||||
angVelocity( Point3F::Zero )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -312,11 +312,11 @@ PhysicsDebris* PhysicsDebris::create( PhysicsDebrisData *datablock,
|
|||
}
|
||||
|
||||
PhysicsDebris::PhysicsDebris()
|
||||
: mDataBlock( NULL ),
|
||||
mLifetime( 0.0f ),
|
||||
: mLifetime( 0.0f ),
|
||||
mInitialLinVel( Point3F::Zero ),
|
||||
mDataBlock( NULL ),
|
||||
mShapeInstance( NULL ),
|
||||
mWorld( NULL ),
|
||||
mInitialLinVel( Point3F::Zero )
|
||||
mWorld( NULL )
|
||||
{
|
||||
mTypeMask |= DebrisObjectType | DynamicShapeObjectType;
|
||||
|
||||
|
|
|
|||
|
|
@ -41,9 +41,10 @@ ConsoleDocClass( PhysicsForce,
|
|||
|
||||
|
||||
PhysicsForce::PhysicsForce()
|
||||
: mWorld( NULL ),
|
||||
mBody( NULL ),
|
||||
mPhysicsTick( false )
|
||||
:
|
||||
mWorld( NULL ),
|
||||
mPhysicsTick( false ),
|
||||
mBody( NULL )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -401,12 +401,12 @@ ConsoleDocClass( PhysicsShape,
|
|||
PhysicsShape::PhysicsShape()
|
||||
: mPhysicsRep( NULL ),
|
||||
mWorld( NULL ),
|
||||
mShapeInst( NULL ),
|
||||
mResetPos( MatrixF::Identity ),
|
||||
mShapeInst( NULL ),
|
||||
mDestroyed( false ),
|
||||
mPlayAmbient( false ),
|
||||
mAmbientThread( NULL ),
|
||||
mAmbientSeq( -1 )
|
||||
mAmbientSeq( -1 ),
|
||||
mAmbientThread( NULL )
|
||||
{
|
||||
mNetFlags.set( Ghostable | ScopeAlways );
|
||||
mTypeMask |= DynamicShapeObjectType;
|
||||
|
|
|
|||
|
|
@ -55,11 +55,12 @@ public:
|
|||
|
||||
/// The constructor.
|
||||
PhysicsUserData()
|
||||
: mObject( NULL ),
|
||||
:
|
||||
#ifdef TORQUE_DEBUG
|
||||
mTypeId( smTypeName ),
|
||||
#endif
|
||||
mObject( NULL ),
|
||||
mBody( NULL )
|
||||
#ifdef TORQUE_DEBUG
|
||||
, mTypeId( smTypeName )
|
||||
#endif
|
||||
{}
|
||||
|
||||
/// The destructor.
|
||||
|
|
@ -117,4 +118,4 @@ protected:
|
|||
PhysicsBody *mBody;
|
||||
};
|
||||
|
||||
#endif // _PHYSICS_PHYSICSUSERDATA_H_
|
||||
#endif // _PHYSICS_PHYSICSUSERDATA_H_
|
||||
|
|
|
|||
|
|
@ -109,8 +109,6 @@ static S32 sMaxPredictionTicks = 30; // Number of ticks to predict
|
|||
|
||||
S32 Player::smExtendedMoveHeadPosRotIndex = 0; // The ExtendedMove position/rotation index used for head movements
|
||||
|
||||
// Anchor point compression
|
||||
const F32 sAnchorMaxDistance = 32.0f;
|
||||
|
||||
//
|
||||
static U32 sCollisionMoveMask = TerrainObjectType |
|
||||
|
|
@ -3835,11 +3833,13 @@ void Player::updateActionThread()
|
|||
// Select an action animation sequence, this assumes that
|
||||
// this function is called once per tick.
|
||||
if(mActionAnimation.action != PlayerData::NullAnimation)
|
||||
{
|
||||
if (mActionAnimation.forward)
|
||||
mActionAnimation.atEnd = mShapeInstance->getPos(mActionAnimation.thread) == 1;
|
||||
else
|
||||
mActionAnimation.atEnd = mShapeInstance->getPos(mActionAnimation.thread) == 0;
|
||||
|
||||
}
|
||||
|
||||
// Only need to deal with triggers on the client
|
||||
if( isGhost() )
|
||||
{
|
||||
|
|
@ -4514,7 +4514,7 @@ void Player::onImageAnimThreadUpdate(U32 imageSlot, S32 imageShapeIndex, F32 dt)
|
|||
}
|
||||
}
|
||||
|
||||
void Player::onUnmount( ShapeBase *obj, S32 node )
|
||||
void Player::onUnmount( SceneObject *obj, S32 node )
|
||||
{
|
||||
// Reset back to root position during dismount.
|
||||
setActionThread(PlayerData::RootAnim,true,false,false);
|
||||
|
|
@ -4581,6 +4581,7 @@ void Player::updateAnimationTree(bool firstPerson)
|
|||
{
|
||||
S32 mode = 0;
|
||||
if (firstPerson)
|
||||
{
|
||||
if (mActionAnimation.firstPerson)
|
||||
mode = 0;
|
||||
// TSShapeInstance::MaskNodeRotation;
|
||||
|
|
@ -4588,7 +4589,7 @@ void Player::updateAnimationTree(bool firstPerson)
|
|||
// TSShapeInstance::MaskNodePosY;
|
||||
else
|
||||
mode = TSShapeInstance::MaskNodeAllButBlend;
|
||||
|
||||
}
|
||||
for (U32 i = 0; i < PlayerData::NumSpineNodes; i++)
|
||||
if (mDataBlock->spineNode[i] != -1)
|
||||
mShapeInstance->setNodeAnimationState(mDataBlock->spineNode[i],mode);
|
||||
|
|
|
|||
|
|
@ -484,7 +484,7 @@ protected:
|
|||
/// @{
|
||||
|
||||
struct ActionAnimation {
|
||||
U32 action;
|
||||
S32 action;
|
||||
TSThread* thread;
|
||||
S32 delayTicks; // before picking another.
|
||||
bool forward;
|
||||
|
|
@ -628,7 +628,7 @@ protected:
|
|||
|
||||
/// @name Mounted objects
|
||||
/// @{
|
||||
virtual void onUnmount( ShapeBase *obj, S32 node );
|
||||
virtual void onUnmount( SceneObject *obj, S32 node );
|
||||
virtual void unmount();
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -525,6 +525,19 @@ bool Prefab::isValidChild( SimObject *simobj, bool logWarnings )
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Prefab::buildPolyList(PolyListContext context, AbstractPolyList* polyList, const Box3F &box, const SphereF& sphere)
|
||||
{
|
||||
Vector<SceneObject*> foundObjects;
|
||||
mChildGroup->findObjectByType(foundObjects);
|
||||
|
||||
for (S32 i = 0; i < foundObjects.size(); i++)
|
||||
{
|
||||
foundObjects[i]->buildPolyList(context, polyList, box, sphere);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
ExplodePrefabUndoAction::ExplodePrefabUndoAction( Prefab *prefab )
|
||||
: UndoAction( "Explode Prefab" )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -96,6 +96,8 @@ public:
|
|||
/// which is added to the MissionGroup and returned to the caller.
|
||||
SimGroup* explode();
|
||||
|
||||
bool buildPolyList(PolyListContext context, AbstractPolyList* polyList, const Box3F &box, const SphereF& sphere);
|
||||
|
||||
protected:
|
||||
|
||||
void _closeFile( bool removeFileNotify );
|
||||
|
|
|
|||
|
|
@ -551,14 +551,14 @@ S32 ProjectileData::scaleValue( S32 value, bool down )
|
|||
Projectile::Projectile()
|
||||
: mPhysicsWorld( NULL ),
|
||||
mDataBlock( NULL ),
|
||||
mParticleEmitter( NULL ),
|
||||
mParticleWaterEmitter( NULL ),
|
||||
mSound( NULL ),
|
||||
mCurrPosition( 0, 0, 0 ),
|
||||
mCurrVelocity( 0, 0, 1 ),
|
||||
mSourceObjectId( -1 ),
|
||||
mSourceObjectSlot( -1 ),
|
||||
mCurrTick( 0 ),
|
||||
mParticleEmitter( NULL ),
|
||||
mParticleWaterEmitter( NULL ),
|
||||
mSound( NULL ),
|
||||
mProjectileShape( NULL ),
|
||||
mActivateThread( NULL ),
|
||||
mMaintainThread( NULL ),
|
||||
|
|
|
|||
|
|
@ -187,8 +187,6 @@ IMPLEMENT_CALLBACK( RigidShape, onLeaveLiquid, void, ( const char* objId, const
|
|||
|
||||
namespace {
|
||||
|
||||
const U32 sMoveRetryCount = 3;
|
||||
|
||||
// Client prediction
|
||||
const S32 sMaxWarpTicks = 3; // Max warp duration in ticks
|
||||
const S32 sMaxPredictionTicks = 30; // Number of ticks to predict
|
||||
|
|
|
|||
|
|
@ -95,9 +95,9 @@ SFXEmitter::SFXEmitter()
|
|||
: SceneObject(),
|
||||
mSource( NULL ),
|
||||
mTrack( NULL ),
|
||||
mUseTrackDescriptionOnly( false ),
|
||||
mLocalProfile( &mDescription ),
|
||||
mPlayOnAdd( true ),
|
||||
mUseTrackDescriptionOnly( false )
|
||||
mPlayOnAdd( true )
|
||||
{
|
||||
mTypeMask |= MarkerObjectType;
|
||||
mNetFlags.set( Ghostable | ScopeAlways );
|
||||
|
|
|
|||
|
|
@ -168,12 +168,9 @@ ShapeBaseData::ShapeBaseData()
|
|||
density( 1.0f ),
|
||||
maxEnergy( 0.0f ),
|
||||
maxDamage( 1.0f ),
|
||||
destroyedLevel( 1.0f ),
|
||||
disabledLevel( 1.0f ),
|
||||
repairRate( 0.0033f ),
|
||||
eyeNode( -1 ),
|
||||
earNode( -1 ),
|
||||
cameraNode( -1 ),
|
||||
disabledLevel( 1.0f ),
|
||||
destroyedLevel( 1.0f ),
|
||||
cameraMaxDist( 0.0f ),
|
||||
cameraMinDist( 0.2f ),
|
||||
cameraDefaultFov( 75.0f ),
|
||||
|
|
@ -181,6 +178,11 @@ ShapeBaseData::ShapeBaseData()
|
|||
cameraMaxFov( 120.f ),
|
||||
cameraCanBank( false ),
|
||||
mountedImagesBank( false ),
|
||||
mCRC( 0 ),
|
||||
computeCRC( false ),
|
||||
eyeNode( -1 ),
|
||||
earNode( -1 ),
|
||||
cameraNode( -1 ),
|
||||
debrisDetail( -1 ),
|
||||
damageSequence( -1 ),
|
||||
hulkSequence( -1 ),
|
||||
|
|
@ -189,9 +191,7 @@ ShapeBaseData::ShapeBaseData()
|
|||
useEyePoint( false ),
|
||||
isInvincible( false ),
|
||||
renderWhenDestroyed( true ),
|
||||
computeCRC( false ),
|
||||
inheritEnergyFromMount( false ),
|
||||
mCRC( 0 )
|
||||
inheritEnergyFromMount( false )
|
||||
{
|
||||
dMemset( mountPointNode, -1, sizeof( S32 ) * SceneObject::NumMountPoints );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -491,8 +491,8 @@ struct ShapeBaseImageData: public GameBaseData {
|
|||
|
||||
/// @name Callbacks
|
||||
/// @{
|
||||
DECLARE_CALLBACK( void, onMount, ( ShapeBase* obj, S32 slot, F32 dt ) );
|
||||
DECLARE_CALLBACK( void, onUnmount, ( ShapeBase* obj, S32 slot, F32 dt ) );
|
||||
DECLARE_CALLBACK( void, onMount, ( SceneObject* obj, S32 slot, F32 dt ) );
|
||||
DECLARE_CALLBACK( void, onUnmount, ( SceneObject* obj, S32 slot, F32 dt ) );
|
||||
/// @}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -97,14 +97,14 @@ ConsoleDocClass( ShapeBaseImageData,
|
|||
"@ingroup gameObjects\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK( ShapeBaseImageData, onMount, void, ( ShapeBase* obj, S32 slot, F32 dt ), ( obj, slot, dt ),
|
||||
IMPLEMENT_CALLBACK( ShapeBaseImageData, onMount, void, ( SceneObject* obj, S32 slot, F32 dt ), ( obj, slot, dt ),
|
||||
"@brief Called when the Image is first mounted to the object.\n\n"
|
||||
|
||||
"@param obj object that this Image has been mounted to\n"
|
||||
"@param slot Image mount slot on the object\n"
|
||||
"@param dt time remaining in this Image update\n" );
|
||||
|
||||
IMPLEMENT_CALLBACK( ShapeBaseImageData, onUnmount, void, ( ShapeBase* obj, S32 slot, F32 dt ), ( obj, slot, dt ),
|
||||
IMPLEMENT_CALLBACK( ShapeBaseImageData, onUnmount, void, ( SceneObject* obj, S32 slot, F32 dt ), ( obj, slot, dt ),
|
||||
"@brief Called when the Image is unmounted from the object.\n\n"
|
||||
|
||||
"@param obj object that this Image has been unmounted from\n"
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class StaticShape: public ShapeBase
|
|||
StaticShapeData* mDataBlock;
|
||||
bool mPowered;
|
||||
|
||||
void onUnmount(ShapeBase* obj,S32 node);
|
||||
void onUnmount(SceneObject* obj,S32 node);
|
||||
|
||||
protected:
|
||||
enum MaskBits {
|
||||
|
|
|
|||
|
|
@ -228,6 +228,7 @@ public:
|
|||
|
||||
Resource<TSShape> getShape() const { return mShape; }
|
||||
StringTableEntry getShapeFileName() { return mShapeName; }
|
||||
void setShapeFileName(StringTableEntry shapeName) { mShapeName = shapeName; }
|
||||
|
||||
TSShapeInstance* getShapeInstance() const { return mShapeInstance; }
|
||||
|
||||
|
|
|
|||
|
|
@ -36,15 +36,6 @@
|
|||
//----------------------------------------------------------------------------
|
||||
|
||||
// Client prediction
|
||||
static F32 sMinWarpTicks = 0.5 ; // Fraction of tick at which instant warp occures
|
||||
static S32 sMaxWarpTicks = 3; // Max warp duration in ticks
|
||||
|
||||
const U32 sClientCollisionMask = (TerrainObjectType |
|
||||
StaticShapeObjectType |
|
||||
VehicleObjectType);
|
||||
|
||||
const U32 sServerCollisionMask = (sClientCollisionMask);
|
||||
|
||||
// Trigger objects that are not normally collided with.
|
||||
static U32 sTriggerMask = ItemObjectType |
|
||||
TriggerObjectType |
|
||||
|
|
@ -69,7 +60,7 @@ ConsoleDocClass( TurretShapeData,
|
|||
"@ingroup gameObjects\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK( TurretShapeData, onMountObject, void, ( TurretShape* turret, SceneObject* obj, S32 node ),( turret, obj, node ),
|
||||
IMPLEMENT_CALLBACK( TurretShapeData, onMountObject, void, ( SceneObject* turret, SceneObject* obj, S32 node ),( turret, obj, node ),
|
||||
"@brief Informs the TurretShapeData object that a player is mounting it.\n\n"
|
||||
"@param turret The TurretShape object.\n"
|
||||
"@param obj The player that is mounting.\n"
|
||||
|
|
@ -77,7 +68,7 @@ IMPLEMENT_CALLBACK( TurretShapeData, onMountObject, void, ( TurretShape* turret,
|
|||
"@note Server side only.\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK( TurretShapeData, onUnmountObject, void, ( TurretShape* turret, SceneObject* obj ),( turret, obj ),
|
||||
IMPLEMENT_CALLBACK( TurretShapeData, onUnmountObject, void, ( SceneObject* turret, SceneObject* obj ),( turret, obj ),
|
||||
"@brief Informs the TurretShapeData object that a player is unmounting it.\n\n"
|
||||
"@param turret The TurretShape object.\n"
|
||||
"@param obj The player that is unmounting.\n"
|
||||
|
|
@ -933,7 +924,7 @@ void TurretShape::unmountObject( SceneObject *obj )
|
|||
}
|
||||
}
|
||||
|
||||
void TurretShape::onUnmount(ShapeBase*,S32)
|
||||
void TurretShape::onUnmount(SceneObject*,S32)
|
||||
{
|
||||
// Make sure the client get's the final server pos of this turret.
|
||||
setMaskBits(PositionMask);
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ public:
|
|||
|
||||
virtual bool preload(bool server, String &errorStr);
|
||||
|
||||
DECLARE_CALLBACK( void, onMountObject, ( TurretShape* turret, SceneObject* obj, S32 node ) );
|
||||
DECLARE_CALLBACK( void, onUnmountObject, ( TurretShape* turret, SceneObject* obj ) );
|
||||
DECLARE_CALLBACK( void, onMountObject, ( SceneObject* turret, SceneObject* obj, S32 node ) );
|
||||
DECLARE_CALLBACK( void, onUnmountObject, ( SceneObject* turret, SceneObject* obj ) );
|
||||
DECLARE_CALLBACK( void, onStickyCollision, ( TurretShape* obj ) );
|
||||
};
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ protected:
|
|||
void _applyLimits(Point3F& rot);
|
||||
bool _outsideLimits(Point3F& rot); ///< Return true if any angle is outside of the limits
|
||||
|
||||
void onUnmount(ShapeBase* obj,S32 node);
|
||||
void onUnmount(SceneObject* obj,S32 node);
|
||||
|
||||
// Script level control
|
||||
bool allowManualRotation;
|
||||
|
|
|
|||
|
|
@ -69,8 +69,6 @@ ConsoleDocClass( HoverVehicle,
|
|||
);
|
||||
|
||||
namespace {
|
||||
|
||||
const U32 sIntergrationsPerTick = 1;
|
||||
const F32 sHoverVehicleGravity = -20;
|
||||
|
||||
const U32 sCollisionMoveMask = (TerrainObjectType | PlayerObjectType |
|
||||
|
|
|
|||
|
|
@ -63,8 +63,6 @@ static F32 sWorkingQueryBoxSizeMultiplier = 2.0f; // How much larger should the
|
|||
// will be updated due to motion, but any non-static shape
|
||||
// that moves into the query box will not be noticed.
|
||||
|
||||
const U32 sMoveRetryCount = 3;
|
||||
|
||||
// Client prediction
|
||||
const S32 sMaxWarpTicks = 3; // Max warp duration in ticks
|
||||
const S32 sMaxPredictionTicks = 30; // Number of ticks to predict
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue