Skip to content

Commit

Permalink
Merge pull request #681 from threedworld-mit/teleport_use_centroid
Browse files Browse the repository at this point in the history
Added optional parameter use_centroid to teleport_object and teleport_object_by
  • Loading branch information
alters-mit authored Jan 26, 2024
2 parents 69b024d + ae42682 commit e856899
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 10 additions & 0 deletions Documentation/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

To upgrade from TDW v1.11 to v1.12, read [this guide](upgrade_guides/v1.11_to_v1.12.md).

## v1.12.24

### Command API

#### Modified Commands

| Command | Modification |
| --- | --- |
| `teleport_object`<br>`teleport_object_by` | Added optional parameter `use_centroid`. |

## v1.12.23

### Command API
Expand Down
10 changes: 6 additions & 4 deletions Documentation/api/command_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5041,14 +5041,15 @@ Teleport an object to a new position.
```

```python
{"$type": "teleport_object", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "physics": False, "absolute": True}
{"$type": "teleport_object", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "physics": False, "absolute": True, "use_centroid": False}
```

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `"position"` | Vector3 | New position of the object. | |
| `"physics"` | bool | This should almost always be False (the default). If True, apply a "physics-based" teleportation to the object. This only works if the object has a rigidbody (i.e. is a model from a model library) and is slightly slower than a non-physics teleport. Set this to True only if you are having persistent and rare physics glitches. | False |
| `"absolute"` | bool | If True, set the position in world coordindate space. If False, set the position in local coordinate space. | True |
| `"absolute"` | bool | If True, set the position in world coordinate space. If False, set the position in local coordinate space. | True |
| `"use_centroid"` | bool | If True, teleport from the centroid of the object instead of the pivot. | False |
| `"id"` | int | The unique object ID. | |

***
Expand All @@ -5063,13 +5064,14 @@ Translate an object by an amount, optionally in local or world space.
```

```python
{"$type": "teleport_object_by", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "absolute": True}
{"$type": "teleport_object_by", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "absolute": True, "use_centroid": False}
```

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `"position"` | Vector3 | The positional offset. | |
| `"absolute"` | bool | If True, set the position in world coordindate space. If False, set the position in local coordinate space. | True |
| `"absolute"` | bool | If True, set the position in world coordinate space. If False, set the position in local coordinate space. | True |
| `"use_centroid"` | bool | If True, teleport from the centroid of the object instead of the pivot. | False |
| `"id"` | int | The unique object ID. | |

***
Expand Down
2 changes: 1 addition & 1 deletion Python/tdw/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.12.23.0"
__version__ = "1.12.24.0"

0 comments on commit e856899

Please sign in to comment.