To be honest, I am new to working with Sparky's collision dll, so it could be me. Long story short: flight sim where you attack a very large cruiser type (its in space) and my model is upside down when its loaded. So I call SC_SetupObject then I roll it and call SC_UpdateObject, as the documentation instructs. However, the collision info seems to remain as if the ship were upside down.
Relevant code here:
Load Object "dreadnaught.x",10
SC_SetupObject 10,2,0
Roll Object Right 10,180
SC_UpdateObject 10
And here's the code that checks for collision:
shot=1
IF Shot>0
Position Object Shot+999,Object Position X(65535),Object Position Y(65535),Object Position Z(65535)
Set Object to Object Orientation Shot+999,65535
Move Object Shot+999,ShotRange
Col=sc_RayCast(10,Object Position X(65535),Object Position Y(65535),Object Position Z(65535),Object Position X(Shot+999),Object Position Y(Shot+999),Object Position Z(Shot+999),65535)
Line Object Screen X(3001),Object Screen Y(3001),Object Screen X(3002),Object Screen Y(3002)
If Col<>0
ShotVal=Sc_GetCollisionDistance()
PlayerShots(Shot)=ShotVal
HitX#=Sc_GetStaticCollisionX()
HitY#=Sc_GetStaticCollisionY()
HitZ#=Sc_GetStaticCollisionZ()
Gosub SpawnExplode
ELSE
`PlayerShots(Shot)=0
ENDIF
Play Sound 1
ENDIF
And yeah, I know, there's no point for the IF Shot>0 line, its in there from a previous iteration of the code and I just haven't bothered to remove it yet.
Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose