Linepick/Camerapick. Massive speed difference...

Archives Forums/Blitz3D Bug Reports/Linepick/Camerapick. Massive speed difference...

Ross C(Posted 2006) [#1]
There seems to be a massive speed difference between linepick and camerapick. most of the extra time with linepick, doesn't seem to be doing anything... If you increase the distance of the linepick and the camera pick, the time difference is hardly worth bothering about. Just seems to be a set up time which hinders the linepick. Any word from BRL/anyone in the know, why this is? It kind of makes linepick redundant.

Graphics3D 800,600
SetBuffer BackBuffer()


Global camera = CreateCamera()
PositionEntity camera,0,0,-40


Global cube = CreateCube()
EntityPickMode cube,2
PositionEntity cube,5,0,0

Global cube1 = CreateCube()
EntityPickMode cube1,2
PositionEntity cube1,0,0,0



While Not KeyHit(1)

	Cls


	If MouseHit(1) Then
		CameraPick(camera,MouseX(),MouseY())
		If PickedEntity() <> 0 Then
			flag$="picked with camera pick!, time of = "+PickedTime()+" entity = "+PickedEntity()
			EntityColor PickedEntity(),Rnd(0,255),Rnd(0,255),Rnd(0,255)
		Else
			flag$="nothing picked..."
		End If
	ElseIf MouseHit(2) Then
		LinePick(0,0,-40,0,0,40)
		If PickedEntity() <> 0 Then
			flag$="picked with line pick!, time of = "+PickedTime()+" entity = "+PickedEntity()
			EntityColor PickedEntity(),Rnd(0,255),Rnd(0,255),Rnd(0,255)
		Else
			flag$="nothing picked..."
		End If
	End If
	
	UpdateWorld
	RenderWorld
	Text 0,0,flag
	Flip
Wend
End



Matty(Posted 2006) [#2]
I don't know about redundant - line pick is still useful for when you want to 'pick' something between two positions both of which are not in the camera's view.


Ross C(Posted 2006) [#3]
Ok, Stevie G and RaGR, pointed out that PickedTime() probably means something else. I did some more tests and it is actually a value between 0 and 1. A percentage if you like, of when the linepick hit something. Poor documentation is at fault here.


NA(Posted 2006) [#4]
Let me see here I add a comment about spyware and somebody in the site does away with it. Hm! I guess you guys have spy things going on with you’re software then otherwise why delete the comment. Psyco idiot get a life and wake up or go insane.


Ross C(Posted 2006) [#5]
Wrong thread maybe?