AGX Physics
Hight quality physics simulation
Last updated
Hight quality physics simulation
Last updated
AGX Dynamics for Unity is not part of the realvirtual.io delivery installation itself. AGX Dynamics for Unity is sold and distributed by Algoryx.
As of realvirtual.io 2021.02, realvirtual.io also supports AGX Dynamics for Unity. AGX is a commercial and optional high quality physics simulation that can simulate complex dynamics.
AGX Dynamics for Unity completely replaces the built-in game physics in Unity and allows you to use real physics, measure real forces and expect realistic results. For more information, please visit the AGX Dynamics Website.
With AGX it is possible to simulate processes in engineering quality. The main advantage is that it is possible to measure real forces and detect multiple contact points between bodies. This allows, for example, very detailed conveyor simulations, where it is also possible to simulate the behavior when a part is on several different conveyors at the same time.
To use AGX Dynamics for Unity together with realvirtual.io you also need to install the AGX Dynamics for Unity plugin. Please check the AGX documenation for more informationon about the installation: https://us.download.algoryx.se/AGXUnity/documentation/current/getting_started.html#installing-the-plugin
A license key is needed for using AGX Dynamics for Unity. Please check the AGX Dynamics Website for more information regarding trial and licensing of AGX.
After installation of the AGX Unity plugin you need to activate it by selecting File > Build Settings > Player > Script Compilation
.
Here you need to add the Scripting Define Symbol REALVIRTUAL_AGX
Realvirtual.io does not automatically add AGX physics components to Gameobjects, as is sometimes the case with standard realvirtual.io components. You must add all the required AGX components manually, as described below.
AGX and Unity Physics run in parallel in a scene. It is possible to simulate some parts of the scene with Unity PhysX and other parts with the AGX engine but you are not allowed to put an AGX and a Unity RigidBody in parallel on one Gameobject.
To enable the AGX within the source Use AGX Physics
needs to be turned on in the source.
If the AGX specific properties like Use AGX Physics
are not visible within the Source please check if the GAME4AUTOMAION_AGX
compiler define is added to the Player settings like described above.
Additionally all MUs need to have a AGX Shape Collider
(e.g. a Box Collider) and a AGX RigidBody
added to it. Please check the AGX Unity Plugin documentation (https://us.download.algoryx.se/AGXUnity/documentation/current) for more information about these components.
realvirtual.io Drives can move mechanical axes. Axes are defined within AGX by Contraint
for example with the Type Hinge
. It is necessary to turn on the Lock
Controller within the constraint. The Drive itself needs to be turned to Virtual
(because the direction is defined by the AGX Constraint itself).
Conveyors are modeled within realvirtual.io with Drives connected to Transportsurfaces. This remains the same. On the TransportSurface Use AGX Physics
needs to be turned on:
The main advantage of the AGX Transportsurface is, that one MU can touch multiple Transportsurfaces and the resulting movement of the MU is calculated exactly. With the Unity PhysX engine only one contact point is calculated, what means that an MU never touches multiple Transportsurface, which is a disadvantage for very detailed simulations.
Sinks must detect the parts to be destroyed. Use AGX Physics
must be enabled and an AGX Box Collider must be added to the sink.
You can also use Raycast-based sensors with AGX physics. It is necessary to add a standard Unity Collider to your MUs on the layer g4a SensorMU
.
Do not add a RigidBody to your MUs as this would violate the AGX Physics Engine. Please make sure that raycasts are used in all sensors that need to detect AGX based MUs. realvirtual.io collider based sensors are not possible in combination with AGX Physics Engine. The sensor raycast setting (see also Sensor).
© 2022 in2Sight GmbH https://realvirtual.io - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.