Broader Dancing Character Control for themers
This is to allow themers to have more control in regards to the Dancing 3D Characters seen in Gameplay. A lot of it was hardcoded.
This commit is contained in:
+50
-22
@@ -25,24 +25,50 @@ int Neg1OrPos1();
|
|||||||
*
|
*
|
||||||
* -- Colby
|
* -- Colby
|
||||||
*/
|
*/
|
||||||
const float CAMERA_REST_DISTANCE = 32.f;
|
|
||||||
const float CAMERA_REST_LOOK_AT_HEIGHT = -11.f;
|
|
||||||
|
|
||||||
const float CAMERA_SWEEP_DISTANCE = 28.f;
|
#define CAMERA_REST_DISTANCE THEME->GetMetricF("DancingCamera","RestDistance")
|
||||||
const float CAMERA_SWEEP_DISTANCE_VARIANCE = 4.f;
|
#define CAMERA_REST_LOOK_AT_HEIGHT THEME->GetMetricF("DancingCamera","RestHeight")
|
||||||
const float CAMERA_SWEEP_HEIGHT_VARIANCE = 7.f;
|
#define CAMERA_SWEEP_DISTANCE THEME->GetMetricF("DancingCamera","SweepDistance")
|
||||||
const float CAMERA_SWEEP_PAN_Y_RANGE_DEGREES = 45.f;
|
#define CAMERA_SWEEP_DISTANCE_VARIANCE THEME->GetMetricF("DancingCamera","SweepDistanceVariable")
|
||||||
const float CAMERA_SWEEP_PAN_Y_VARIANCE_DEGREES = 60.f;
|
#define CAMERA_SWEEP_HEIGHT_VARIANCE THEME->GetMetricF("DancingCamera","SweepHeightVariable")
|
||||||
const float CAMERA_SWEEP_LOOK_AT_HEIGHT = -11.f;
|
#define CAMERA_SWEEP_PAN_Y_RANGE_DEGREES THEME->GetMetricF("DancingCamera","SweepPanYRangeDegrees")
|
||||||
|
#define CAMERA_SWEEP_PAN_Y_VARIANCE_DEGREES THEME->GetMetricF("DancingCamera","SweepPanYVarianceDegrees")
|
||||||
|
#define CAMERA_SWEEP_LOOK_AT_HEIGHT THEME->GetMetricF("DancingCamera","SweepHeight")
|
||||||
|
#define CAMERA_STILL_DISTANCE THEME->GetMetricF("DancingCamera","StillDistance")
|
||||||
|
#define CAMERA_STILL_DISTANCE_VARIANCE THEME->GetMetricF("DancingCamera","StillDistanceVariance")
|
||||||
|
#define CAMERA_STILL_PAN_Y_RANGE_DEGREES THEME->GetMetricF("DancingCamera","StillPanYRangeDegrees")
|
||||||
|
#define CAMERA_STILL_HEIGHT_VARIANCE THEME->GetMetricF("DancingCamera","StillHeightVariance")
|
||||||
|
#define CAMERA_STILL_LOOK_AT_HEIGHT THEME->GetMetricF("DancingCamera","StillHeight")
|
||||||
|
|
||||||
const float CAMERA_STILL_DISTANCE = 26.f;
|
// This is to setup the lighting color.
|
||||||
const float CAMERA_STILL_DISTANCE_VARIANCE = 3.f;
|
const ThemeMetric<RageColor> LIGHT_AMBIENT_COLOR ( "DancingCamera", "AmbientColor" );
|
||||||
const float CAMERA_STILL_PAN_Y_RANGE_DEGREES = 120.f;
|
const ThemeMetric<RageColor> LIGHT_DIFFUSE_COLOR ( "DancingCamera", "DiffuseColor" );
|
||||||
const float CAMERA_STILL_HEIGHT_VARIANCE = 5.f;
|
|
||||||
const float CAMERA_STILL_LOOK_AT_HEIGHT = -10.f;
|
// This is for Danger and Failed colors.
|
||||||
|
const ThemeMetric<RageColor> LIGHT_ADANGER_COLOR ( "DancingCamera", "AmbientDangerColor" );
|
||||||
|
const ThemeMetric<RageColor> LIGHT_AFAILED_COLOR ( "DancingCamera", "AmbientFailedColor" );
|
||||||
|
const ThemeMetric<RageColor> LIGHT_DDANGER_COLOR ( "DancingCamera", "DiffuseDangerColor" );
|
||||||
|
const ThemeMetric<RageColor> LIGHT_DFAILED_COLOR ( "DancingCamera", "DiffuseFailedColor" );
|
||||||
|
|
||||||
|
// This is to make positioning of said light.
|
||||||
|
#define LIGHTING_X THEME->GetMetricF("DancingCamera","LightX")
|
||||||
|
#define LIGHTING_Y THEME->GetMetricF("DancingCamera","LightY")
|
||||||
|
#define LIGHTING_Z THEME->GetMetricF("DancingCamera","LightZ")
|
||||||
|
|
||||||
|
// Position of the model in X (one player)
|
||||||
|
#define MODEL_X_ONE_PLAYER THEME->GetMetricF("DancingCharacters","OnePlayerModelX")
|
||||||
|
// Model spacing during Versus or Battle modes.
|
||||||
|
#define MODEL_X_VERSUS THEME->GetMetricF("DancingCharacters","TwoPlayersModelX")
|
||||||
|
|
||||||
|
// As the name implies, this sets the ammount of beats that the camera will
|
||||||
|
// stay in its current state until transitioning to the next camera tween.
|
||||||
|
#define AMM_BEATS_TIL_NEXTCAMERA THEME->GetMetricF("DancingCamera","BeatsUntilNextCamPos")
|
||||||
|
#define CAM_FOV THEME->GetMetricF("DancingCamera","CameraFOV")
|
||||||
|
|
||||||
|
// Since we only have two players, set those without changing the table too much.
|
||||||
|
int VersusSpacing = (int)MODEL_X_VERSUS;
|
||||||
|
const float MODEL_X_TWO_PLAYERS[NUM_PLAYERS] = { VersusSpacing, -VersusSpacing };
|
||||||
|
|
||||||
const float MODEL_X_ONE_PLAYER = 0;
|
|
||||||
const float MODEL_X_TWO_PLAYERS[NUM_PLAYERS] = { +8, -8 };
|
|
||||||
const float MODEL_ROTATIONY_TWO_PLAYERS[NUM_PLAYERS] = { -90, 90 };
|
const float MODEL_ROTATIONY_TWO_PLAYERS[NUM_PLAYERS] = { -90, 90 };
|
||||||
|
|
||||||
DancingCharacters::DancingCharacters(): m_bDrawDangerLight(false),
|
DancingCharacters::DancingCharacters(): m_bDrawDangerLight(false),
|
||||||
@@ -252,10 +278,12 @@ void DancingCharacters::Update( float fDelta )
|
|||||||
}
|
}
|
||||||
|
|
||||||
int iCurBeat = (int)GAMESTATE->m_Position.m_fSongBeat;
|
int iCurBeat = (int)GAMESTATE->m_Position.m_fSongBeat;
|
||||||
iCurBeat -= iCurBeat%8;
|
// Need to convert it to a int, otherwise it complains.
|
||||||
|
int NewBeatToSet = (int)AMM_BEATS_TIL_NEXTCAMERA;
|
||||||
|
iCurBeat -= iCurBeat % NewBeatToSet;
|
||||||
|
|
||||||
m_fThisCameraStartBeat = (float)iCurBeat;
|
m_fThisCameraStartBeat = (float)iCurBeat;
|
||||||
m_fThisCameraEndBeat = float(iCurBeat + 8);
|
m_fThisCameraEndBeat = float(iCurBeat + AMM_BEATS_TIL_NEXTCAMERA);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
// is there any of this still around? This block of code is _ugly_. -Colby
|
// is there any of this still around? This block of code is _ugly_. -Colby
|
||||||
@@ -327,7 +355,7 @@ void DancingCharacters::DrawPrimitives()
|
|||||||
|
|
||||||
RageVector3 m_LookAt( 0, m_fLookAtHeight, 0 );
|
RageVector3 m_LookAt( 0, m_fLookAtHeight, 0 );
|
||||||
|
|
||||||
DISPLAY->LoadLookAt( 45,
|
DISPLAY->LoadLookAt( CAM_FOV,
|
||||||
m_CameraPoint,
|
m_CameraPoint,
|
||||||
m_LookAt,
|
m_LookAt,
|
||||||
RageVector3(0,1,0) );
|
RageVector3(0,1,0) );
|
||||||
@@ -339,15 +367,15 @@ void DancingCharacters::DrawPrimitives()
|
|||||||
|
|
||||||
DISPLAY->SetLighting( true );
|
DISPLAY->SetLighting( true );
|
||||||
|
|
||||||
RageColor ambient = bFailed ? RageColor(0.2f,0.1f,0.1f,1) : (bDanger ? RageColor(0.4f,0.1f,0.1f,1) : RageColor(0.4f,0.4f,0.4f,1));
|
RageColor ambient = bFailed ? (RageColor)LIGHT_ADANGER_COLOR : (bDanger ? (RageColor)LIGHT_ADANGER_COLOR : (RageColor)LIGHT_AMBIENT_COLOR);
|
||||||
RageColor diffuse = bFailed ? RageColor(0.4f,0.1f,0.1f,1) : (bDanger ? RageColor(0.8f,0.1f,0.1f,1) : RageColor(1,0.95f,0.925f,1));
|
RageColor diffuse = bFailed ? (RageColor)LIGHT_DDANGER_COLOR : (bDanger ? (RageColor)LIGHT_DDANGER_COLOR : (RageColor)LIGHT_DIFFUSE_COLOR);
|
||||||
RageColor specular = RageColor(0.8f,0.8f,0.8f,1);
|
RageColor specular = (RageColor)LIGHT_AMBIENT_COLOR;
|
||||||
DISPLAY->SetLightDirectional(
|
DISPLAY->SetLightDirectional(
|
||||||
0,
|
0,
|
||||||
ambient,
|
ambient,
|
||||||
diffuse,
|
diffuse,
|
||||||
specular,
|
specular,
|
||||||
RageVector3(-3, -7.5f, +9) );
|
RageVector3(LIGHTING_X, LIGHTING_Y, LIGHTING_Z) );
|
||||||
|
|
||||||
if( PREFSMAN->m_bCelShadeModels )
|
if( PREFSMAN->m_bCelShadeModels )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user