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 / Should work Sparky's collision with hidden object?

Author
Message
curse
11
Years of Service
User Offline
Joined: 5th Feb 2013
Location:
Posted: 5th Mar 2013 18:40
I have an object that is loaded and used as a visual object, and an object that is hidden, positioned in the same place of the visible object and used to handle collisions.
In this way I can instantiate the visible objects (they are models. X) and gain in speed Upload, instead of creating some copies.
Unfortunately, if the object used for the collisions is hidden, there is any collisions.
Is it normal or what?
I knew that even if I would delete the object used in SC_SetupObject, the collision remained.
In my case, the object still exists, it's just hidden.

Here some code.

Object used for collision.


Visible object
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 5th Mar 2013 22:14
That's odd... try hiding it after calling sc_setupObject?


"Why do programmers get Halloween and Christmas mixed up?"
curse
11
Years of Service
User Offline
Joined: 5th Feb 2013
Location:
Posted: 5th Mar 2013 22:38 Edited at: 6th Mar 2013 11:34
Yep, same thing.

EDIT:
I found the real problem. It was not a problem of collision detection, but of the function dbPickObject. This does not work if an object is hidden. The only alternative I can think of is to make trasperente the object instead of hiding it, but so lose the advantage of using a hidden easier object for the collision. What do you say? There is no way to run dbPickObject with a hidden object? Alternative?

In attachment the situation with hidden object.

Thanks!

Attachments

Login to view attachments
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 10th Mar 2013 00:04
You can look for the implementation of dbPickObject in the source repository. After an hour of so of following cross references you should eventually find it
It is possible that you can extract part of the code and in doing so make your own version of the function which includes hidden objects.


"Why do programmers get Halloween and Christmas mixed up?"
curse
11
Years of Service
User Offline
Joined: 5th Feb 2013
Location:
Posted: 11th Mar 2013 11:27
I discarded the previous idea because the animations of the instances are synchronized. However, I will try to look the function's implementation just of curiosity.

Thanks for your support Rudolpho!

Login to post a reply

Server time is: 2024-03-29 02:04:22
Your offset time is: 2024-03-29 02:04:22