Game Development Community

TSStatic and animation

by Vlad Ts · in Torque Game Engine · 08/24/2005 (2:30 am) · 7 replies

Hello community!

I'm working with own class inherited from torque TSStatic and wish to exploit the animation capability for objects of this class, so i add bellow code to one of the my class init function

mShape = ResourceManager->load(shapePath);
mShapeInstance = new TSShapeInstance(mShape, true);

TSShape* pShape = mShapeInstance->getShape();
S32 seq = pShape->findSequence(seqName);
if(seq >= 0)
{
	TSThread* pTread = mShapeInstance->addThread();
	mShapeInstance->setSequence(pTread, seq, 0);
}

but after scene rendering i got one and only one frame of the required sequence.
Sorry, i'm new in torque engine and its animation model,
what changes i should make to play entire sequence?

Thanks.

#1
08/24/2005 (3:44 am)
Are you calling animate()? Are you sure the sequences are being updated?
#2
08/24/2005 (4:34 am)
Ben,
what did you mean saying 'sequences updated'?
As i now and it works animate() is called in renderObject() method of parent class, in our case it's TSStatic.
#3
08/24/2005 (11:20 am)
Er... It's fixed, then? (Not quite sure what your last post said.)
#4
08/25/2005 (2:29 am)
Nope, it still not working.
I mean that animate() method is automatically called from a base of my class, i.e from TSStatic (inheritance behaviour), hence the problem in other place.

I think that animation sequence isn't updated, so i have to change current play position every game tick manually?
Is there any other way or class in Torque different from TSSTatic from which i can easily derrive my own class that will support automatic animation update mechanism?
#5
08/25/2005 (11:20 pm)
Sure, ShapeBase.

StaticShape, I think, derives from ShapeBase and is basically the same as TSStatic in functionality.
#6
05/02/2006 (7:58 am)
@Vlad : Any success with this?
#7
04/23/2007 (6:19 pm)
I would like to know if anyones gotten a tsstatic to have animations aswell, i want to use the clientside tsstatic resource, but id like to be able to have them animated, and maybe interpolated movement as well.