Aily Posted October 14, 2010 Share Posted October 14, 2010 In all examples all values are multiply by appspeed() function. So what is faster to calculation: this: repeat turnentity cube1,vec3(0,1*appspeed(),0) turnentity cube2,vec3(0,2*appspeed(),0) turnentity cube3,vec3(0,3*appspeed(),0) forever or this: repeat spd#=appspeed() turnentity cube1,vec3(0,1*spd,0) turnentity cube2,vec3(0,2*spd,0) turnentity cube3,vec3(0,3*spd,0) forever ? And that's one, what is better (faster) to using vector constructors: this: repeat turnentity cube,vec3(0,1,0) forever or this: global turn_vec:tvec3=vec3(0,1,0) repeat turnentity cube,turn_vec forever ? Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
ZioRed Posted October 14, 2010 Share Posted October 14, 2010 Well I expect that the AppTime is calculated only once per update and then cached and it should return the same result per frame, so I think it's the same as performance. Also for the second question I say that it's the same as performance since you're not doing any operations on the Vec3 except the initialization with default values. At the end it's just matter of taste, I'd prefer to instantiate a variable in both cases just because if tomorrow I have to change their value it should be done on a single line and not 3+ Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
Aily Posted October 14, 2010 Author Share Posted October 14, 2010 Well I expect that the AppTime is calculated only once per update and then cached and it should return the same result per frame, so I think it's the same as performance. Also for the second question I say that it's the same as performance since you're not doing any operations on the Vec3 except the initialization with default values. At the end it's just matter of taste, I'd prefer to instantiate a variable in both cases just because if tomorrow I have to change their value it should be done on a single line and not 3+ Thanks man Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.