Login

Fancade Wiki

Renamed How do I get or set the geometrical position of an object%3F to Setting the geometric position of an object

... ...
@@ -200,8 +200,8 @@ Script/How do I get%2Fset the geometrical position of an object?.md: Script/How
200 200
I get / set the geometrical position of an object%3F.md
201 201
Script/How do I get / set the geometrical position of an object%3F.md: Script/How
202 202
do I get or set the geometrical position of an object?.md
203
Script/How do I get or set the geometrical position of an object?.md: Script/How do
204
I get\/set the geometrical position of an object%3F.md
203
Script/How do I get or set the geometrical position of an object?.md: Script/Setting
204
the geometric position of an object.md
205 205
Script/How do I get\/set the geometrical position of an object%3F.md: Script/How do
206 206
I get\/How do I get or set the geometrical position of an object?.md
207 207
Script/How do I get\/How do I get or set the geometrical position of an object?.md: Script/How
... ...
@@ -1,11 +0,0 @@
1
Normally, when you get/set the position of an object, you actually get/set the position of the object's *center of mass*. In most cases this is enough, but when the object's center of mass *isn't the same as its geometrical position*, and you want to locate it (or locate something in it) geometrically, just "getting its position" won't cut it.
2
3
[[/uploads/center of mass opaque.png]]
4
5
The trick is to take the vector returned by [[Get Position]] and **offset it by half the total size of the object** ("the offset"). With "total size", I refer to the minimum and maximum vectors of the object, added together.
6
7
[[/uploads/geometrical position opaque.png]]
8
9
Almost similarly, to set the geometrical position of the object, set the actual position of the object to the desired position subtracted by the offset.
10
11
[[/uploads/set geometrical position opaque.png]]
... ...
\ No newline at end of file
... ...
@@ -0,0 +1,11 @@
1
Normally, when you get/set the position of an object, you actually get/set the position of the object's *center of mass*. In most cases this is enough, but when the object's center of mass *isn't the same as its geometrical position*, and you want to locate it (or locate something in it) geometrically, just "getting its position" won't cut it.
2
3
[[/uploads/center of mass opaque.png]]
4
5
The trick is to take the vector returned by [[Get Position]] and **offset it by half the total size of the object** ("the offset"). With "total size", I refer to the minimum and maximum vectors of the object, added together.
6
7
[[/uploads/geometrical position opaque.png]]
8
9
Almost similarly, to set the geometrical position of the object, set the actual position of the object to the desired position subtracted by the offset.
10
11
[[/uploads/set geometrical position opaque.png]]
... ...
\ No newline at end of file
Fancade Wiki