Jump to content

#1
tumira

tumira
  • Members
  • 57 posts
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?

#2
gamecreator

gamecreator
  • Members
  • 1,910 posts
Yes, the editor uses a different scale (multiplied by 100).

#3
tumira

tumira
  • Members
  • 57 posts

View Postgamecreator, on 17 February 2017 - 06:48 AM, said:

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


But why ?

#4
macklebee

macklebee
  • Members
  • 3,532 posts
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.

#5
Josh Klint

Josh Klint
  • Staff
  • 11,167 posts
This is why:
http://www.leadwerks.com/werkspace/topic/10016-mapping-standards/

#6
Einlander

Einlander
  • Members
  • 537 posts
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.

#7
tumira

tumira
  • Members
  • 57 posts
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 ?

#8
CharlesPax

CharlesPax
  • Members
  • 1 posts
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.

.