non-normalized direction vectors on some projectile trails

non-normalized direction vectors on some projectile trails

Requests for features in the spring code.

Moderator: Moderators

Post Reply

Fix or Keep?

Fix
4
33%
Keep
8
67%
 
Total votes: 12

User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

non-normalized direction vectors on some projectile trails

Post by KDR_11k »

Some projectiles give non-normalized direction vectors to their trails. That's both good and bad, it's obvoiously bad for adding effects that assume normalized vectors but it's good for making effects that use the actual speed of the projectile for something (which can vary for some types so it can't be simulated in the CEG). So I'm unsure if it should really be fixed.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: non-normalized direction vectors on some projectile trails

Post by smoth »

Forgive my ignorance but could you further explain, I am not sure I am getting what you are asking.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: non-normalized direction vectors on some projectile trails

Post by Peet »

smoth wrote:Forgive my ignorance but could you further explain, I am not sure I am getting what you are asking.
In normalized vectors, the largest component is always 1. Working with vectors that aren't normalized can give some quirky results in some situations but the magnitude of the vector is preserved.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: non-normalized direction vectors on some projectile trails

Post by trepan »

normalize means that the length of the vector is scaled
to 1.0, while maintaining the same direction, as in:

length = sqrt((x*x) + (y*y) + (z * z))
newX = x / length
newY = y / length
newZ = z / length

Peet's explanation confuses me.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: non-normalized direction vectors on some projectile trails

Post by LordMatt »

Perhaps he means the largest possible component.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: non-normalized direction vectors on some projectile trails

Post by Peet »

Yeah...bad explanation on my part. Working and foruming do not combine gracefully.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: non-normalized direction vectors on some projectile trails

Post by smoth »

What benefits would this yield?
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: non-normalized direction vectors on some projectile trails

Post by lurker »

Benefit to 'fix': Effects that assume it's 1 in length work properly, and can save a very small calculation if they don't confirm.
Benefit to keep: Effects know the speed and can use it.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: non-normalized direction vectors on some projectile trails

Post by imbaczek »

sqrt is not small, though. I'd fix it and add something that returns speed in CEGs (but I have no idea how they work, so don't know how hard would that be.)
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: non-normalized direction vectors on some projectile trails

Post by dizekat »

imbaczek wrote:sqrt is not small, though. I'd fix it and add something that returns speed in CEGs (but I have no idea how they work, so don't know how hard would that be.)
but wouldn't the 'fix' be worse performance-wise, as some effect dont need normalized direction, and fix would normalize it for all?
LUA does square root just as fast as C anyway...
edit: or you're thinking of case when theres a lot of effects some having sqrt some not and those that have doing it over and over again on same vector?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: non-normalized direction vectors on some projectile trails

Post by imbaczek »

dizekat wrote:a lot of effects some having sqrt some not and those that have doing it over and over again on same vector?
pretty much that, yes; also, principle of least surprise - I'm used to direction vectors being normalized.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: non-normalized direction vectors on some projectile trails

Post by KDR_11k »

I'd suggest a keyword like "velocity" for vector values to get the velocity vector.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: non-normalized direction vectors on some projectile trails

Post by smoth »

I am not sure it is worth fixing. I do not see any reasonable advantage to changing it and with all the effects that would have to be refactored it would create a lot of work.

on the other hand a secondary set would be confusing also. I understand legacy tags for TA content but for engine specific stuff I would hate to see it. Unfortunately I suspect this change will break many of the CEGS in use.

or do I understand it wrong?

For such a change to break soo much it would have to have some seriously great advantages which I am somehow missing.
Post Reply

Return to “Feature Requests”