Hello all,
I'm trying to make my camera shake when the player is in the game's elevator... I've tried the Follow Spline animator, and it worked, BUT it never stopped. It wouldn't even stop when I removed the animator!
So any suggestions or ideas would be greatly appreciated...
Thanks very much~ John DiSanti
________
Motorcycle tires
Earthquakes! :o
Earthquakes! :o
Last edited by disanti on Thu Feb 24, 2011 10:34 am, edited 1 time in total.
Nice idea, I'll give that a go!
Thansk~ John DiSanti
________
MERCEDES-BENZ S-CLASS HYBRID SPECIFICATIONS
Thansk~ John DiSanti
________
MERCEDES-BENZ S-CLASS HYBRID SPECIFICATIONS
Last edited by disanti on Thu Feb 24, 2011 10:34 am, edited 1 time in total.
Last edited by disanti on Thu Feb 24, 2011 10:34 am, edited 1 time in total.
shake animator
I've wrote shake animator some time ago. Don't really know if it will help, but.. here's the code:
Of course it's very basic (and it shakes in X direction only:). It behaves like "single dinosaur's step;)" - first maximum impact, then amplitude goes to zero in given time.
Code: Select all
class IShakeItAnimator : public ISceneNodeAnimator
{
public:
IShakeItAnimator(u32 ShakeTime, u16 Amp);
virtual ~IShakeItAnimator() {};
virtual void animateNode(ISceneNode *node, u32 timeMs);
private:
vector3df startPosition;
u32 mStartTime;
u32 mTimeToShake;
u16 Amplitude;
s8 Direction;
};
IShakeItAnimator::IShakeItAnimator(u32 ShakeTime, u16 Amp)
{
mStartTime = 0;
mTimeToShake = ShakeTime;
Amplitude = Amp;
Direction = 1;
}
void IShakeItAnimator::animateNode(ISceneNode *node, u32 timeMs)
{
if (!mStartTime)
{
mStartTime = timeMs;
startPosition = node->getPosition();
}
u32 passedTime = timeMs - mStartTime;
if (passedTime > mTimeToShake)
{
node->setPosition(startPosition);
return;
}
float progress = float(passedTime) / float(mTimeToShake);
node->setPosition(vector3df(node->getPosition().X + ((1-progress)*Amplitude)*Direction, node->getPosition().Y, node->getPosition().X));
Direction *= -1;
}
Awesome work melon2005! I'll put that to good use!
Was it just me or were the Irrlicht forums really unbarably slow for a few days?
Puh, I've been working pretty hard on it... you can take a look on my new website:
http://sknetwork.no-ip.org/
Project title: Project Space Squad 4086
I just finished the first level too.
~John DiSanti
________
Motorcycle Tires
Was it just me or were the Irrlicht forums really unbarably slow for a few days?
Puh, I've been working pretty hard on it... you can take a look on my new website:
http://sknetwork.no-ip.org/
Project title: Project Space Squad 4086
I just finished the first level too.
~John DiSanti
________
Motorcycle Tires
Last edited by disanti on Thu Feb 24, 2011 10:35 am, edited 1 time in total.
Last edited by disanti on Thu Feb 24, 2011 10:36 am, edited 1 time in total.
code correction
bug in setPosition : use Z for Z, not X ?