tumira

GetPosition return unit ?

8 posts in this topic

I'm a bit confused about the return unit ?

 

For example I set the camera at the editor at this position. x=0.0 , y=77, z=-27.0.

 

 

When I use this code on the camera to get the z position,

 

"self.entity:GetPosition().z"

 

it returns -0.27 ? I need to multiply my position from codes to 100 to get the exact same value with the editor?

0

Share this post


Link to post

Yes, the editor uses a different scale (multiplied by 100).

 

 

But why ?

1

Share this post


Link to post

It made more sense to use centimeters in the Editor when creating CSG as it would be easier to texture with common texture sizes (256, 512, etc instead of 2.56, 5.12, etc). The engine position related commands use or return meters.

1

Share this post


Link to post

The editor use to be in Meters ( multiples of 10), but Josh changed it to be powers of 2 (256, 512, 1024). I still rather it was in multiples of 10. 256cm has no room for jumping indoors, so I have to make all my interiors 384cm, which is not as pretty in the editor.

0

Share this post


Link to post

Why not just returns all unit in centimeters (code and editor) ? So it will standardize. I've been converting my Unity project and I noticed that Leadwerks value is way off. Turns out it returns value differently from the editor(cm and m).

 

Its not a big problem, I just need to multiple the value that I got from codes to 100 to get it the same with the editor. But still In my opinion kinda odd to why not make it a standard for both editor and codes.

 

Maybe to avoid breaking stuff up with current project ?

0

Share this post


Link to post

thank you Brynet-Inc for your reply.

i understand that it has nothing to do with O/S.

but what i want to change the return address of the function to my shellcode.

can you please give me example how to do it.? with my source code.

 

.

0

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Create Your Account

Sign in

Already have an account? Sign in here.


Sign In Now