Page 1 of 1

I think FeatureShape is broken

Posted: 25 May 2009, 22:50
by zwzsg

Code: Select all

function gadget:DrawWorldPreUnit()
	if SYNCED.ColorWars then
		gl.DepthTest(true)
		gl.DepthMask(true)
		for _,b in sipairs(SYNCED.ColorWars.FullBlocks) do
			gl.Translate(b.x,b.y,b.z)
			gl.FeatureShape(FeatureDefNames.colorwarsquad.id,b.team)
			gl.Translate(-b.x,-b.y,-b.z)
		end
		gl.DepthMask(false)
		gl.DepthTest(false)
	end
end
Image




Code: Select all

function gadget:DrawWorldPreUnit()
	if SYNCED.ColorWars then
		gl.DepthTest(true)
		gl.DepthMask(true)
		for _,b in sipairs(SYNCED.ColorWars.FullBlocks) do
			gl.Translate(b.x,b.y,b.z)
			gl.UnitShape(UnitDefNames.colorwarsquad.id,b.team)
			gl.Translate(-b.x,-b.y,-b.z)
		end
		gl.DepthMask(false)
		gl.DepthTest(false)
	end
end
Image

Re: I think FeatureShape is broken

Posted: 26 May 2009, 10:19
by jK
FeatureShape isn't the same as UnitShape ...

(so it doesn't bind the texture and iirc it doesn't transform the worldspace)

Re: I think FeatureShape is broken

Posted: 28 May 2009, 01:01
by zwzsg
Why doesn't FeatureShape bind the texture? Why is FeatureShape not the same as UnitShape but for Feature? What is FeatureShape?

And from those pics and code it looks like the worldspace transformation is the same for FeatureShape and UnitShape.