mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix startpad anim, checkpoint anim, finish camera
This commit is contained in:
parent
f0145a5cc0
commit
774d15fd29
4 changed files with 28 additions and 5 deletions
|
|
@ -285,8 +285,8 @@ class CameraController extends Object {
|
|||
|
||||
if (this.finish) {
|
||||
// Make the camera spin around slowly
|
||||
CameraPitch = this.level.finishPitch;
|
||||
CameraYaw = this.level.finishYaw;
|
||||
// CameraPitch = this.level.finishPitch;
|
||||
// CameraYaw = this.level.finishYaw;
|
||||
var effectTime = 1.0;
|
||||
if (@:privateAccess this.marble.finishAnimTime >= 2.0)
|
||||
effectTime = 1.0;
|
||||
|
|
|
|||
|
|
@ -1863,6 +1863,7 @@ class Marble extends GameObject {
|
|||
this.updateFinishAnimation(timeState.dt);
|
||||
if (this.mode == Finish) {
|
||||
this.setPosition(this.finishAnimPosition.x, this.finishAnimPosition.y, this.finishAnimPosition.z);
|
||||
updatePowerupStates(timeState.currentAttemptTime, timeState.dt);
|
||||
}
|
||||
|
||||
this.trailEmitter();
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ class Checkpoint extends DtsObject {
|
|||
glowpass.setPassName("glow");
|
||||
glowpass.depthTest = LessEqual;
|
||||
glowpass.enableLights = false;
|
||||
glowpass.depthWrite = false;
|
||||
glowpass.setBlendMode(Alpha);
|
||||
material.addPass(glowpass);
|
||||
|
||||
|
|
@ -75,6 +76,7 @@ class Checkpoint extends DtsObject {
|
|||
dtsshader = material.mainPass.getShader(shaders.DtsTexture);
|
||||
dtsshader.passThrough = true;
|
||||
material.mainPass.enableLights = false;
|
||||
material.mainPass.depthWrite = false;
|
||||
material.mainPass.setBlendMode(Alpha);
|
||||
}
|
||||
if (matName == "sigiloff") {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package shapes;
|
||||
|
||||
import src.Util;
|
||||
import h3d.shader.UVScroll;
|
||||
import h3d.shader.UVAnim;
|
||||
import src.DtsObject;
|
||||
import src.ResourceLoader;
|
||||
|
||||
class StartPad extends DtsObject {
|
||||
var animStart:Float = Math.POSITIVE_INFINITY;
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
dtsPath = "data/shapes/pads/startarea.dts";
|
||||
|
|
@ -13,13 +16,30 @@ class StartPad extends DtsObject {
|
|||
identifier = "StartPad";
|
||||
useInstancing = false;
|
||||
animateSubObjectOpacities = true;
|
||||
doSequenceOnce = true;
|
||||
doSequenceOnceBeginTime = 0;
|
||||
}
|
||||
|
||||
override function onLevelStart() {
|
||||
animStart = level.timeState.timeSinceLoad;
|
||||
}
|
||||
|
||||
override function update(timeState:src.TimeState) {
|
||||
// Override the keyframe
|
||||
var currentCompletion = getCompletion(timeState);
|
||||
this.sequenceKeyframeOverride.set(this.dts.sequences[0], currentCompletion * (this.dts.sequences[0].numKeyFrames - 1));
|
||||
super.update(timeState);
|
||||
}
|
||||
|
||||
override function reset() {
|
||||
super.reset();
|
||||
doSequenceOnceBeginTime = level.timeState.timeSinceLoad;
|
||||
animStart = level.timeState.timeSinceLoad;
|
||||
}
|
||||
|
||||
function getCompletion(timeState:src.TimeState) {
|
||||
var elapsed = (timeState.timeSinceLoad - this.animStart) - 0.5; // 500ms for 'start' state;
|
||||
if (elapsed < 0)
|
||||
return 1.0;
|
||||
var completion = Util.clamp(elapsed / this.dts.sequences[0].duration, 0, 1);
|
||||
return completion;
|
||||
}
|
||||
|
||||
override function getPreloadMaterials(dts:dts.DtsFile) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue