I've just run into this problem with sparky's dll v2. It seems that the sc_allowobjectscaling command does not work, and an object's collision data is never scaled with the sc_updateobject command. Here's some code to demonstrate what i mean:
`basic stuff
hide mouse
autocam off
sync on : sync rate 0
rate as float = 0.0
`types
type vector
x as float = 0.0
y as float = 0.0
z as float = 0.0
endtype
type camera
pos as vector
rot as vector
endtype
`make camera
cam as camera
position camera 5.0,2.0,0.0
point camera 0,0,0
cam.pos.x=camera position x()
cam.pos.y=camera position y()
cam.rot.x=camera angle x()
cam.rot.y=camera angle y()
`make target
target as dword = 1
make object sphere target,3.0
position object target,0,0,0
sc_setupobject target,0,1
sc_allowobjectscaling target
scaled as boolean = 0
scaledTime as integer = 0
`make marker
marker as dword = 2
make object sphere marker,0.2
color object marker,rgb(255,0,0)
hit as boolean = 0
`main loop
do
`rate scale value
rate=(10.0/screen fps())
`rotate camera
cam.rot.x=cam.rot.x+mousemovey()*rate*2.0
cam.rot.y=cam.rot.y+mousemovex()*rate*2.0
`move camera
cam.pos.x=cam.pos.x + cos(cam.rot.x)*sin(cam.rot.y)*rate*0.1*(keystate(17)-keystate(31)) + newxvalue(0.0,cam.rot.y-90,rate*0.1*(keystate(30)-keystate(32)))
cam.pos.y=cam.pos.y - sin(cam.rot.x)*rate*0.1*(keystate(17)-keystate(31))
cam.pos.z=cam.pos.z + cos(cam.rot.x)*cos(cam.rot.y)*rate*0.1*(keystate(17)-keystate(31)) + newzvalue(0.0,cam.rot.y-90,rate*0.1*(keystate(30)-keystate(32)))
`update camera
rotate camera cam.rot.x,cam.rot.y,cam.rot.z
position camera cam.pos.x,cam.pos.y,cam.pos.z
`scale target
if spacekey() and scaledTime+1000<timer()
if scaled
scale object target,100,100,100
sc_updateobject target
scaled=0
else
scale object target,50,50,50
sc_updateobject target
scaled=1
endif
scaledTime=timer()
endif
`do target collision
if 0<sc_raycast(0,cam.pos.x,cam.pos.y,cam.pos.z,cam.pos.x+cos(cam.rot.x)*sin(cam.rot.y)*100.0,cam.pos.y-sin(cam.rot.x)*100.0,cam.pos.z+cos(cam.rot.x)*cos(cam.rot.y)*100.0,0)
position object marker,sc_getstaticcollisionx()+sc_getcollisionnormalx()*0.1,sc_getstaticcollisiony()+sc_getcollisionnormaly()*0.1,sc_getstaticcollisionz()+sc_getcollisionnormalz()*0.1
show object marker
hit=1
else
hide object marker
hit=0
endif
`print out stuff
dot screen width()*0.5,screen height()*0.5
set cursor 0,0
print "fps: "; screen fps()
print "rate: "; rate
print "hit: "; hit
print
sync
loop
`for sparky's
delete memblock 0
W, A, S, D to move the camera, mouse to look, and space to scale the sphere. Requires sparky's v2 dll of course.
Anyone know why this doesn't work?
[EDIT]
Even the scaling demo that comes with sparky's v2 system does not work... Is the scaling command just faulty, or is it because dbp version 6.3 handles scaling differently than previous versions that the dll was developed for?
Who needs a signature?