Merge pull request #1721 from JoseVarelaP/5_1-new
Broader Dancing Character Control for themers
This commit is contained in:
@@ -4847,3 +4847,69 @@ NullCountString=""
|
||||
2DCharacterYP1=SCREEN_HEIGHT*0.5
|
||||
2DCharacterXP2=SCREEN_WIDTH*0.75
|
||||
2DCharacterYP2=SCREEN_HEIGHT*0.5
|
||||
|
||||
# Allows you to change the position of the X model relative to SCREEN_CENTER_X
|
||||
# Keep in mind, the camera and models are placed in a YRot of 180, so the X value here
|
||||
# will act in reverse.
|
||||
OnePlayerModelX=0
|
||||
|
||||
# Controls the Dancing characters camera.
|
||||
[DancingCamera]
|
||||
# Camera Explanation
|
||||
# StepMania's Dancing Characters Camera is divided into 3 sections
|
||||
|
||||
# Rest - Begins as soon as Gameplay is started. It won't change until the
|
||||
# First note has been hit/passed.
|
||||
|
||||
# Sweep - Part of the camera where it begins to move, and does linear tweens
|
||||
# Across the area, in a matrix-like style.
|
||||
|
||||
# Still - Happens in a Rand ammount, in which if true, goes into a static position
|
||||
# in a random spot of the area where the characters can (mostly) be visible.
|
||||
|
||||
# Distance relative to Z to the position of the characters.
|
||||
RestDistance=32.0
|
||||
# Distance relative to Y to the position of the characters.
|
||||
RestHeight=-11.0
|
||||
|
||||
# Here's the moment the sweep animation will begin.
|
||||
SweepDistance=28.0
|
||||
# Variable ammount in which the Z position will change
|
||||
# during said tween.
|
||||
SweepDistanceVariable=4.0
|
||||
# Variable ammount in which the Y position will change
|
||||
# during said tween.
|
||||
SweepHeightVariable=7.0
|
||||
# Variable range in which the Y position will tween
|
||||
# to become the new variable to start from.
|
||||
SweepPanYRangeDegrees=45.0
|
||||
SweepPanYVarianceDegrees=60.0
|
||||
# Height where the Sweep will begin from.
|
||||
SweepHeight=-11.0
|
||||
|
||||
StillDistance=26.0
|
||||
StillDistanceVariance=3.0
|
||||
StillPanYRangeDegrees=120.0
|
||||
StillHeightVariance=5.0
|
||||
StillHeight=-10.0
|
||||
|
||||
# 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.
|
||||
BeatsUntilNextCamPos=8
|
||||
|
||||
# Set the Camera's Field Of View.
|
||||
CameraFOV=45
|
||||
|
||||
# Control the lighting position here.
|
||||
LightX=-3
|
||||
LightY=-7.5
|
||||
LightZ=9
|
||||
|
||||
# Control the lighting color here.
|
||||
AmbientColor=color(".4,.4,.4,1")
|
||||
AmbientDangerColor=color(".4,.1,.1,1")
|
||||
AmbientFailedColor=color(".2,.1,.1,1")
|
||||
# Diffuse color of the scene.
|
||||
DiffuseColor=color("1,.95,.95,1")
|
||||
DiffuseDangerColor=color(".8,.1,.1,1")
|
||||
DiffuseFailedColor=color(".4,.1,.1,1")
|
||||
+45
-22
@@ -25,23 +25,44 @@ int Neg1OrPos1();
|
||||
*
|
||||
* -- Colby
|
||||
*/
|
||||
const float CAMERA_REST_DISTANCE = 32.f;
|
||||
const float CAMERA_REST_LOOK_AT_HEIGHT = -11.f;
|
||||
|
||||
const float CAMERA_SWEEP_DISTANCE = 28.f;
|
||||
const float CAMERA_SWEEP_DISTANCE_VARIANCE = 4.f;
|
||||
const float CAMERA_SWEEP_HEIGHT_VARIANCE = 7.f;
|
||||
const float CAMERA_SWEEP_PAN_Y_RANGE_DEGREES = 45.f;
|
||||
const float CAMERA_SWEEP_PAN_Y_VARIANCE_DEGREES = 60.f;
|
||||
const float CAMERA_SWEEP_LOOK_AT_HEIGHT = -11.f;
|
||||
#define CAMERA_REST_DISTANCE THEME->GetMetricF("DancingCamera","RestDistance")
|
||||
#define CAMERA_REST_LOOK_AT_HEIGHT THEME->GetMetricF("DancingCamera","RestHeight")
|
||||
#define CAMERA_SWEEP_DISTANCE THEME->GetMetricF("DancingCamera","SweepDistance")
|
||||
#define CAMERA_SWEEP_DISTANCE_VARIANCE THEME->GetMetricF("DancingCamera","SweepDistanceVariable")
|
||||
#define CAMERA_SWEEP_HEIGHT_VARIANCE THEME->GetMetricF("DancingCamera","SweepHeightVariable")
|
||||
#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;
|
||||
const float CAMERA_STILL_DISTANCE_VARIANCE = 3.f;
|
||||
const float CAMERA_STILL_PAN_Y_RANGE_DEGREES = 120.f;
|
||||
const float CAMERA_STILL_HEIGHT_VARIANCE = 5.f;
|
||||
const float CAMERA_STILL_LOOK_AT_HEIGHT = -10.f;
|
||||
// This is to setup the lighting color.
|
||||
const ThemeMetric<RageColor> LIGHT_AMBIENT_COLOR ( "DancingCamera", "AmbientColor" );
|
||||
const ThemeMetric<RageColor> LIGHT_DIFFUSE_COLOR ( "DancingCamera", "DiffuseColor" );
|
||||
|
||||
// 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")
|
||||
|
||||
// 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")
|
||||
|
||||
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 };
|
||||
|
||||
@@ -252,10 +273,12 @@ void DancingCharacters::Update( float fDelta )
|
||||
}
|
||||
|
||||
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_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
|
||||
@@ -327,7 +350,7 @@ void DancingCharacters::DrawPrimitives()
|
||||
|
||||
RageVector3 m_LookAt( 0, m_fLookAtHeight, 0 );
|
||||
|
||||
DISPLAY->LoadLookAt( 45,
|
||||
DISPLAY->LoadLookAt( CAM_FOV,
|
||||
m_CameraPoint,
|
||||
m_LookAt,
|
||||
RageVector3(0,1,0) );
|
||||
@@ -339,15 +362,15 @@ void DancingCharacters::DrawPrimitives()
|
||||
|
||||
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 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 specular = RageColor(0.8f,0.8f,0.8f,1);
|
||||
RageColor ambient = bFailed ? (RageColor)LIGHT_ADANGER_COLOR : (bDanger ? (RageColor)LIGHT_ADANGER_COLOR : (RageColor)LIGHT_AMBIENT_COLOR);
|
||||
RageColor diffuse = bFailed ? (RageColor)LIGHT_DDANGER_COLOR : (bDanger ? (RageColor)LIGHT_DDANGER_COLOR : (RageColor)LIGHT_DIFFUSE_COLOR);
|
||||
RageColor specular = (RageColor)LIGHT_AMBIENT_COLOR;
|
||||
DISPLAY->SetLightDirectional(
|
||||
0,
|
||||
ambient,
|
||||
diffuse,
|
||||
specular,
|
||||
RageVector3(-3, -7.5f, +9) );
|
||||
RageVector3(LIGHTING_X, LIGHTING_Y, LIGHTING_Z) );
|
||||
|
||||
if( PREFSMAN->m_bCelShadeModels )
|
||||
{
|
||||
@@ -391,7 +414,7 @@ void DancingCharacters::DrawPrimitives()
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
/* 2018 Jose Varela
|
||||
* (c) 2003-2004 Chris Danford
|
||||
* All rights reserved.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user