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 / Scaling with SC_DrawObjectBounds()

Author
Message
99xnwreg
13
Years of Service
User Offline
Joined: 29th Jan 2011
Location:
Posted: 19th Feb 2011 17:58
Hey everbody, I finally got collision in using the function SC_DrawObjectBounds(), but This only draws the bounds of the object if it weren't scaled. I was wondering how I could fir the ObjectBounds to an object that has been scaled.
For example.

If I scale an object
dbScaleObject(113,10000,10000,10000);
Then set bounds to it.
SC_SetObjectCollisionOn(113);
It would only draw bounds 1/10000 of the objects size.

Saying that my skill with the DarkGDK library is mediocre is generous.
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 20th Feb 2011 01:33
Try SC_UpdateObject...

Warning! May contain Nuts!
99xnwreg
13
Years of Service
User Offline
Joined: 29th Jan 2011
Location:
Posted: 20th Feb 2011 18:09
I tried but it didn't work. Is there a specific order I should but these functions in?

Saying that my skill with the DarkGDK library is mediocre is generous.
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 21st Feb 2011 17:36
A simple way around it would to get the objects coordinates and use a SphereCast for collision. Usually after all your transforms etc just the SC_UpdateObject does the trick unless your collision detection is checking the wrong group.

Warning! May contain Nuts!
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 21st Feb 2011 21:14 Edited at: 21st Feb 2011 21:16
You have to scale the object before setting it up for collision. If it needs to be scaled when it's already set up, then delete collision data and set it up again. If it's frequently scaled, then use SC_allowObjectScaling, that will cause "updateObject" to update scale data as well (see Sparky's help).

Login to post a reply

Server time is: 2024-11-19 12:31:50
Your offset time is: 2024-11-19 12:31:50