Physical Boats Setup

From SIMboxWiki
Jump to navigation Jump to search

Overview:
Simigon will introduce ocean waves graphics capability, and a suitable SDK in the graphic engine of the product version 5.6.
In addition, using SIMbox physical engine interface it will be possible to simulate the motion of boats on water, with the influence of the waves. Two boats will be included in the SIMbox base content of version 5.6 – a Merchant Vessel, and a Supply Vessel. Using the physical engine tools and SIMbox toolkit, one can modify an existing boat or create a new one, with different physical properties.

Merchant Vessel & Supply Vessel


Creating a new boat:
We recommend that you duplicate one of the two base content boats (Merchant Vessel and Supply Vessel). The other way is to copy the LOCs and the LOCs definitions to an already existing object.


Setting the physical object properties:

The boat object should have a physical file that describes the collision volume. The collision actor should have the name “root”. We recommend that you copy and rename one of the base content boats physical files, and replace the “root” Actor with the one created by exporting the model from the 3DS max. The mass, inertia, skin width and other physical properties have to be set manually, as for all other physical objects.

Another actor should be defined in the physics file that should have the name “DragBase”. This is an Actor that follows a route for uncontrolled entities.Physical Boat Model

The root Actor should be connected to the DragBase Actor by a Joint, called DragBase. The joint can be modified compared to the base content boats file. Its type can be set to a different one (the base-content boats use the 'Distance Joint' type), and the physical properties can be different.
When the user takes control of a boat, the DragBase joint breaks. It is rebuilt when the object becomes non-controlled.
Setting of the angular and linear damping should be done by the properties PROP_PHYSX_LINEAR_DAMPING and PROP_PHYSX_ANGULAR_DAMPING, defined in the SMG_PhysXMovingObject LOC. 

Setting the water forces:

The water force and torque is applied on the Physical object in the SMG_PhysXWaterForce LOC.

The number of computed contact points with the water can be set using the property PROP_PHYSX_WATER_NUMBER_OF_BODY_POINTS. The contact points are calculated automatically, and they are equally spaced along the boat, from 10% to 90% of the boat length. A height (Z) offset can be set for the contact points, to obtain lower/higher water line, using the property PROP_PHYSX_WATER_WATERLINE_Z_OFFSET. When the property value is 0, the contact points are places in the height of the object center.

The propeller (and steering surface) Z (height) position can be set by the property PROP_PHYSX_WATER_PROPELLER_Z_BODY_POSITION. The propeller/steering is assumed to be at 10% length forward from the boat rear end.


Control of other forces magnitude is gained by factors, defined by the following properties:

  • PROP_PHYSX_WATER_BUOYANCY_FORCE_FACTOR – when using the default factor (1.0), the boat body will submerged 1m inside the water. If the factor is increased, it will be higher above the water, accordingly (when the factor is 2.0, it will submerged only 0.5m).
  • PROP_PHYSX_WATER_STEER_FORCE_FACTOR – increases/decreases the force produced by the steering surface defection
  • PROP_PHYSX_WATER_THRUST_FACTOR – increases/decreases the thrust, and the maximal speed and acceleration accordingly
  • PROP_PHYSX_WATER_SIDE_DAMPING_FACTOR - increases/decreases the opposite side force due to lateral speed component
  • PROP_PHYSX_WATER_YAW_DAMPING_FACTOR - increases/decreases the yaw moment due to lateral speed component, and yaw rotational speed
  • PROP_PHYSX_WATER_PITCH_MOMENT_WITH_SPEED_FACTOR - increases /decreases the pitch moment due to forward speed