CurrentModel

Share your ZGE-development tips and techniques here!

Moderator: Moderators

Post Reply
User avatar
Kjell
Posts: 1911
Joined: Sat Feb 23, 2008 11:15 pm

CurrentModel

Post by Kjell »

:idea:

Perhaps super obvious .. but in case you dislike using "CurrentModel" to access build-in properties of a Clone from itself ( because it's too lengthy ), you can create a "alias" by assigning "CurrentModel" to a ( local ) model variable.

So for example, instead of ..

Code: Select all

CurrentModel.Position.X = 8.0;
CurrentModel.Rotation.Z = 0.5;
.. you could use ..

Code: Select all

model this = CurrentModel;

this.Position.X = 8.0;
this.Rotation.Z = 0.5;
The performance penalty for doing this is pretty much neglectable.

K
Post Reply