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.

DLL Talk / Bad Camera Position Data

Author
Message
Zerk
18
Years of Service
User Offline
Joined: 13th May 2006
Location: Orbiting Jupiter
Posted: 3rd Jun 2006 20:07 Edited at: 4th Jun 2006 06:21
I'm trying to get the current camera position in my DLL. However, I'm not type casting it right or something because the data doesnt come in as a float. I can see it coming in and it changes, but the values are way wrong.

Here is my code, well at least the related lines.



ANybody have any ideas on what I'm doing wrong? IanM?

I am putting myself to the fullest possible use, which is all I think that any conscious entity can ever hope to do. ~Hal-9000
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Jun 2006 11:53
You need to store the result into a DWORD variable, then use some nasty casting to get the float value. You can't directly cast it as you are trying to do.



That's get the address of the DWORD, which has a type of pointer-to-dword, then cast it to pointer-to-float, then dereference the pointer to get the value.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
Zerk
18
Years of Service
User Offline
Joined: 13th May 2006
Location: Orbiting Jupiter
Posted: 4th Jun 2006 17:41
Ah ha! That worked... your a genie! I kind figured that some reversal to the *(DWORD*)& method of passing the float back needed to happen. I tried that but I was doing it directly. Never thought of doing it indirectly.

Thanks!

I am putting myself to the fullest possible use, which is all I think that any conscious entity can ever hope to do. ~Hal-9000

Login to post a reply

Server time is: 2024-11-22 06:01:51
Your offset time is: 2024-11-22 06:01:51