How to tell if unit is in COB/Lua default state

How to tell if unit is in COB/Lua default state

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

How to tell if unit is in COB/Lua default state

Post by Beherith »

I would like to know how I can tell (in engine code) if a unit is in it's default state, with no animations running (like all piece transforms are 0) without actually checking each piece translation and rotation matrix to check for zero and eigen?

Thanks in advance for any tips!
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: How to tell if unit is in COB/Lua default state

Post by Kloot »

You can't.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: How to tell if unit is in COB/Lua default state

Post by Beherith »

Sad panda. So the fastest way to find out would still be checking each transformation matrix for identity?
Because I have the dumb idea (I know I'm gonna get flak and yelled at for this) to compile static display lists for entire models in their default 'rest' state, so for example units that are not moving and not shooting and not animated at rest can be drawn with a single call (maybe even the static model could be kept in gpu ram), instead of doing 10+ piece transforms and drawing each piece separately.

Please point out any flaws in this if you see any.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: How to tell if unit is in COB/Lua default state

Post by jK »

wait for a new model renderer ...
Post Reply

Return to “Engine”