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 / Pointer to object in DGDK C++

Author
Message
tindex
17
Years of Service
User Offline
Joined: 24th Oct 2006
Location:
Posted: 9th Nov 2006 03:17
Is any way to make pointer to an object in DGDK C++? For example, pointer to a box or a mesh loaded? I tried to find something like dbPointerToObject* ptrob, but it seems there is not such a thing, or something like that. Could be:
dbPointerToMesh
dbPointerToBox
...
While dbPointerToObject is more friendly for lazy people like me
flibX0r
21
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 9th Nov 2006 06:19 Edited at: 10th Nov 2006 06:22
Nope, object system works the same was as DBPro, being referred to by their index. You could make your own class if you wanted to, though.

Edit: Or not. Didn't know about that, Apex

Big whorls have little whorls which feed on their velocity,
Little whorls have lesser whorls and so on to viscosity. - Lewis F. Richardson
Miguel Melo
18
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 9th Nov 2006 11:22
Give or take a few bugs (though a lot more give than take).

I have vague plans for World Domination
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 9th Nov 2006 14:40
May I make a correction... There is a function that gives you direct access to the object data, it's called dbGetObject. It needs to be uncommented in your DarkSDKBasic3D.h file as it's not actually available by default. You will also need to add the line #include <DBO Format/dbodata.h> to the top of that header file as well, otherwise the compiler will moan because it cannot find sObject*.

Paul.

tindex
17
Years of Service
User Offline
Joined: 24th Oct 2006
Location:
Posted: 9th Nov 2006 15:19
Thank you guys, especially APEXnow. Yes, it is right there hiding!
tindex
17
Years of Service
User Offline
Joined: 24th Oct 2006
Location:
Posted: 9th Nov 2006 16:23
But APEXnow, that needs global.h in dbodata.h which doesn't exists. Actually, dbodata.h is not usefull now as it needs other definitions in global.h.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 9th Nov 2006 16:55
Update your includes with the following files.

Paul.

Attachments

Login to view attachments
tindex
17
Years of Service
User Offline
Joined: 24th Oct 2006
Location:
Posted: 10th Nov 2006 03:16
Good, it works now, thanks.
tindex
17
Years of Service
User Offline
Joined: 24th Oct 2006
Location:
Posted: 10th Nov 2006 14:29
Paul, well, the pointer works but it seems that using pointer-to-object is not yet supported for other APIs. I think I have to leave it right here. DB engine is for avoiding low level annoyances in the first place.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 11th Nov 2006 11:25 Edited at: 11th Nov 2006 11:31
Apex, you should have told that dbGetObject fixing at your ghost object workaround thread, I had problems compiling it.
[EDIT Forget about last comment, my fault.

By the way, in the worst situation, I'll be glad to have a dbObjectSize workaround, maybe there is a door somewhere with this pointer-to-object?
Sephnroth
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 12th Nov 2006 23:54
if anyone can find a way to get the size of limb I will be able to finish my dbLimbInScreen() command - as it is my command works... but its totally inaccurate as all i can do is calculate the center position of the limb using dbLimbPosition() and cannot calculate the edges to make a proper bounding box :/

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 13th Nov 2006 13:10
Sephnroth,

you can try:

dbMakeObjectFromLimb

and the get the size of the limb with

dbObjectSize

applied to the new object (at least with 1.1.1)

You could have precalculated limb sizes using dbMakeObjectFromLimb/dbObjectSize for all limbs before any loop, store the values, and it will work faster.

I guess that should work...
Sephnroth
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 13th Nov 2006 15:58
it is possiable - but we are talking a LARGE increase in loading time for that. The routine needs to run on the world geometry and the world object is made up of over 400 limbs on a /small/ test map. Quite ungh :/

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 13th Nov 2006 16:45
Maybe then you can pre-calculate the data with an auxiliar program and use the results in the final project. Not at run-time.

That is, 2 separated sources or functions, one for calculating sizes before run-time, and the other for knowing if the limb is on screen (dbLimbInScreen command itself).
Sephnroth
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 13th Nov 2006 16:57
it is of course a possibility - maybe the only one. But it is working around a lack of functionality that is quite shocking not to be there :x such a simple thing, lol

I will continue investigating. I've worked extensivly with dbGetObject in the past for various things and never found any limb sizes in there, but maybe theres something i;ve overlooked or something

Login to post a reply

Server time is: 2024-06-29 04:15:27
Your offset time is: 2024-06-29 04:15:27