mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
core -- heartbeat call to arcaneFX::advanceTime() from within clientProcess().
misc -- various other function references
This commit is contained in:
parent
ace877b409
commit
9391fcad4e
4 changed files with 100 additions and 0 deletions
|
|
@ -20,6 +20,11 @@
|
||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
|
||||||
|
// Copyright (C) 2015 Faust Logic, Inc.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
|
||||||
#ifndef _PARTICLE_H_
|
#ifndef _PARTICLE_H_
|
||||||
#define _PARTICLE_H_
|
#define _PARTICLE_H_
|
||||||
|
|
||||||
|
|
@ -97,6 +102,9 @@ class ParticleData : public SimDataBlock
|
||||||
static void initPersistFields();
|
static void initPersistFields();
|
||||||
|
|
||||||
bool reload(char errorBuffer[256]);
|
bool reload(char errorBuffer[256]);
|
||||||
|
public:
|
||||||
|
bool loadParameters();
|
||||||
|
bool reload(String &errorStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@
|
||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
|
||||||
|
// Copyright (C) 2015 Faust Logic, Inc.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
#include "T3D/player.h"
|
#include "T3D/player.h"
|
||||||
|
|
||||||
|
|
@ -1656,6 +1660,8 @@ Player::Player()
|
||||||
mLastAbsoluteYaw = 0.0f;
|
mLastAbsoluteYaw = 0.0f;
|
||||||
mLastAbsolutePitch = 0.0f;
|
mLastAbsolutePitch = 0.0f;
|
||||||
mLastAbsoluteRoll = 0.0f;
|
mLastAbsoluteRoll = 0.0f;
|
||||||
|
|
||||||
|
afx_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
Player::~Player()
|
Player::~Player()
|
||||||
|
|
@ -6188,6 +6194,7 @@ U32 Player::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
|
||||||
mArmAnimation.action != mDataBlock->lookAction))) {
|
mArmAnimation.action != mDataBlock->lookAction))) {
|
||||||
stream->writeInt(mArmAnimation.action,PlayerData::ActionAnimBits);
|
stream->writeInt(mArmAnimation.action,PlayerData::ActionAnimBits);
|
||||||
}
|
}
|
||||||
|
retMask = afx_packUpdate(con, mask, stream, retMask);
|
||||||
|
|
||||||
// The rest of the data is part of the control object packet update.
|
// The rest of the data is part of the control object packet update.
|
||||||
// If we're controlled by this client, we don't need to send it.
|
// If we're controlled by this client, we don't need to send it.
|
||||||
|
|
@ -6292,6 +6299,7 @@ void Player::unpackUpdate(NetConnection *con, BitStream *stream)
|
||||||
mArmAnimation.action = action;
|
mArmAnimation.action = action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
afx_unpackUpdate(con, stream);
|
||||||
// Done if controlled by client ( and not initial update )
|
// Done if controlled by client ( and not initial update )
|
||||||
if(stream->readFlag())
|
if(stream->readFlag())
|
||||||
return;
|
return;
|
||||||
|
|
@ -6819,6 +6827,7 @@ void Player::consoleInit()
|
||||||
Con::addVariable("$player::extendedMoveHeadPosRotIndex", TypeS32, &smExtendedMoveHeadPosRotIndex,
|
Con::addVariable("$player::extendedMoveHeadPosRotIndex", TypeS32, &smExtendedMoveHeadPosRotIndex,
|
||||||
"@brief The ExtendedMove position/rotation index used for head movements.\n\n"
|
"@brief The ExtendedMove position/rotation index used for head movements.\n\n"
|
||||||
"@ingroup GameObjects\n");
|
"@ingroup GameObjects\n");
|
||||||
|
afx_consoleInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
|
@ -7172,6 +7181,69 @@ void Player::renderConvex( ObjectRenderInst *ri, SceneRenderState *state, BaseMa
|
||||||
GFX->leaveDebugEvent();
|
GFX->leaveDebugEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
bool Player::sCorpsesHiddenFromRayCast = true; // this default matches stock Torque behavior.
|
||||||
|
|
||||||
|
// static
|
||||||
|
void Player::afx_consoleInit()
|
||||||
|
{
|
||||||
|
Con::addVariable("pref::Player::corpsesHiddenFromRayCast", TypeBool, &sCorpsesHiddenFromRayCast);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Player::afx_init()
|
||||||
|
{
|
||||||
|
overrideLookAnimation = false;
|
||||||
|
armLookOverridePos = 0.5f;
|
||||||
|
headVLookOverridePos = 0.5f;
|
||||||
|
headHLookOverridePos = 0.5f;
|
||||||
|
ignore_updates = false;
|
||||||
|
fx_c_triggers = 0;
|
||||||
|
mark_fx_c_triggers = 0;
|
||||||
|
fx_s_triggers = 0;
|
||||||
|
move_trigger_states = 0;
|
||||||
|
z_velocity = 0.0f;
|
||||||
|
mark_idle = false;
|
||||||
|
idle_timer = 0.0f;
|
||||||
|
mark_s_landing = false;
|
||||||
|
speed_bias = 1.0f;
|
||||||
|
speed_bias_goal = 1.0f;
|
||||||
|
override_movement = 0;
|
||||||
|
movement_data.zero();
|
||||||
|
movement_op = 1;
|
||||||
|
last_movement_tag = 0;
|
||||||
|
footfallDecalOverride = 0;
|
||||||
|
footfallSoundOverride = 0;
|
||||||
|
footfallDustOverride = 0;
|
||||||
|
noFootfallFX = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
U32 Player::afx_packUpdate(NetConnection* con, U32 mask, BitStream* stream, U32 retMask)
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
if (stream->writeFlag(mask & LookOverrideMask))
|
||||||
|
#else
|
||||||
|
if (stream->writeFlag(mask & ActionMask))
|
||||||
|
#endif
|
||||||
|
stream->writeFlag(overrideLookAnimation);
|
||||||
|
|
||||||
|
if (stream->writeFlag(mask & TriggerMask))
|
||||||
|
stream->write(fx_s_triggers);
|
||||||
|
|
||||||
|
return retMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Player::afx_unpackUpdate(NetConnection* con, BitStream* stream)
|
||||||
|
{
|
||||||
|
if (stream->readFlag()) // LookOverrideMask
|
||||||
|
overrideLookAnimation = stream->readFlag();
|
||||||
|
|
||||||
|
if (stream->readFlag()) // TriggerMask
|
||||||
|
{
|
||||||
|
U32 mask;
|
||||||
|
stream->read(&mask);
|
||||||
|
mark_fx_c_triggers = mask;
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef TORQUE_OPENVR
|
#ifdef TORQUE_OPENVR
|
||||||
void Player::setControllers(Vector<OpenVRTrackedObject*> controllerList)
|
void Player::setControllers(Vector<OpenVRTrackedObject*> controllerList)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,11 @@
|
||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
|
||||||
|
// Copyright (C) 2015 Faust Logic, Inc.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
|
||||||
#ifndef _PLAYER_H_
|
#ifndef _PLAYER_H_
|
||||||
#define _PLAYER_H_
|
#define _PLAYER_H_
|
||||||
|
|
||||||
|
|
@ -780,6 +785,11 @@ public:
|
||||||
virtual void prepRenderImage( SceneRenderState* state );
|
virtual void prepRenderImage( SceneRenderState* state );
|
||||||
virtual void renderConvex( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat );
|
virtual void renderConvex( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat );
|
||||||
virtual void renderMountedImage( U32 imageSlot, TSRenderState &rstate, SceneRenderState *state );
|
virtual void renderMountedImage( U32 imageSlot, TSRenderState &rstate, SceneRenderState *state );
|
||||||
|
private:
|
||||||
|
static void afx_consoleInit();
|
||||||
|
void afx_init();
|
||||||
|
U32 afx_packUpdate(NetConnection*, U32 mask, BitStream*, U32 retMask);
|
||||||
|
void afx_unpackUpdate(NetConnection*, BitStream*);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef Player::Pose PlayerPose;
|
typedef Player::Pose PlayerPose;
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,11 @@
|
||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
|
||||||
|
// Copyright (C) 2015 Faust Logic, Inc.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
#include "platform/platformInput.h"
|
#include "platform/platformInput.h"
|
||||||
|
|
||||||
|
|
@ -49,6 +54,8 @@
|
||||||
#include "gfx/gfxTextureManager.h"
|
#include "gfx/gfxTextureManager.h"
|
||||||
#include "sfx/sfxSystem.h"
|
#include "sfx/sfxSystem.h"
|
||||||
|
|
||||||
|
// Including this header provides access to certain system-level AFX methods.
|
||||||
|
#include "afx/arcaneFX.h"
|
||||||
#ifdef TORQUE_PLAYER
|
#ifdef TORQUE_PLAYER
|
||||||
// See matching #ifdef in editor/editor.cpp
|
// See matching #ifdef in editor/editor.cpp
|
||||||
bool gEditingMission = false;
|
bool gEditingMission = false;
|
||||||
|
|
@ -235,6 +242,9 @@ ConsoleFunctionGroupEnd(Platform);
|
||||||
|
|
||||||
bool clientProcess(U32 timeDelta)
|
bool clientProcess(U32 timeDelta)
|
||||||
{
|
{
|
||||||
|
// Required heartbeat call on the client side which must come
|
||||||
|
// before the advanceTime() calls are made to the scene objects.
|
||||||
|
arcaneFX::advanceTime(timeDelta);
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
#ifndef TORQUE_TGB_ONLY
|
#ifndef TORQUE_TGB_ONLY
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue