Leadworks Josh

BlitzMax Forums/BlitzMax Programming/Leadworks Josh

	Method Add:TVector(v1:TVector, v2:TVector)
		X=V1.X+V2.X
		Y=V1.Y+V2.Y
		Z=V1.Z+V2.Z	
		Return Self			
	End Method


This returns a reference to an existing Objecte - therefore it is faster.

	Method Plus:TVector( v:TVector)
		Return Vector ( x+v.x,y+v.y,z+v.z )
	End Method


This adds two vectors, returning a NEW Object - without touching the values of the Object which Mehtod has bin called.

IMHO the two methods are note compareable in their function, because they are doing different things.

For often used Objects (like Particels in a Particle system) you also want to reuse existing Objects, not throwing them away an instance them from new.

I think thats the exact same topic here, programmers have to be aware of it.