Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Object Scaling and Sparky's Collision DLL

Author
Message
zeeenza
18
Years of Service
User Offline
Joined: 2nd Jul 2006
Location:
Posted: 12th Feb 2009 05:09 Edited at: 12th Feb 2009 05:11
I'm making a first person shooter with Sparky's Collision DLL based on the sliding demo. My level is far too big so I had to scale it down to 5%, but the collision data doesn't scale. I call SC_AllowObjectScaling() and SC_UpdateObject(), but it doesn't make a difference. I'm using the newest version of the DLL (2.05), and I realize that scaling must now be done after setting up the object's collision. Also, I wasn't sure if the SC_AllowObjectScaling() went before or after I actually scale the object, so I tried both ways and it didn't make a difference. Here's my code:

(The collision setup is in the constructor)


Can anybody figure out why it's not working?

Windows Vista Home Premium (32-bit) :: Intel Core 2 Duo - 2.2Ghz :: 2GB DDR2 SDRAM :: nVidia GeForce 8600M GS - 256 MB
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 12th Feb 2009 08:36
I think you should set up the object after you have scale it.
zeeenza
18
Years of Service
User Offline
Joined: 2nd Jul 2006
Location:
Posted: 12th Feb 2009 09:33
Quote: "I think you should set up the object after you have scale it."


I already tried that. Plus, as I mentioned in my first post, in version 2.05 you must set up the object's collision before scaling.

Windows Vista Home Premium (32-bit) :: Intel Core 2 Duo - 2.2Ghz :: 2GB DDR2 SDRAM :: nVidia GeForce 8600M GS - 256 MB
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 12th Feb 2009 18:55
You are doing everything correctly, there was a bug in calculating the object size that only affected GDK. Try version 2.05b (uploaded to the collision thread)

Quote: "I wasn't sure if the SC_AllowObjectScaling() went before or after I actually scale the object"


Doesn't matter, as long as it's called before the update, it just sets a flag that says "this object might be scaled".

If you still experience problems with scale you can use a workaround by converting the object to a mesh and back to an object to bake in the scaling.

dbMakeMeshFromObject( 1,1 );
dbDeleteObject( 1 );
dbMakeObject( 1,1,0 );
dbDeleteMesh( 1 );

SC_SetupComplexObject( 1,0,2 );

dbDeleteObject( 1 );
dbLoadObject( filename,1 );
SC_UpdateObject( 1 );

You can also use something like this to load a separate collision and visual meshes into the same object.
zeeenza
18
Years of Service
User Offline
Joined: 2nd Jul 2006
Location:
Posted: 12th Feb 2009 23:57
2.05b worked. Thanks a lot.

Windows Vista Home Premium (32-bit) :: Intel Core 2 Duo - 2.2Ghz :: 2GB DDR2 SDRAM :: nVidia GeForce 8600M GS - 256 MB

Login to post a reply

Server time is: 2024-11-25 13:43:30
Your offset time is: 2024-11-25 13:43:30