.. _node_mesh_node: Mesh node ========= .. contents:: :local: - Config type: ``mesh_node`` - Config node data: :ref:`stage_mesh_node_data` Description ----------- Mesh nodes are stage objects with geometry that can be seen and (usually) collided with. They can have materials applied to them, and have a variety of options to affect the player in various ways. The majority of a stage is made up of mesh nodes. Collision can be disabled for mesh nodes by setting ``"collision_enabled": false`` for a node in the stage config. Additionally, some flags will make the node act as a trigger volume and thus non-collidable (such as ``fallout_volume``). Gravity surfaces ---------------- Mesh nodes can be marked as a gravity surface (``"gravity_surface": true`` in the stage config). When a player is rolling over a gravity surface, the direction of their gravity will be realigned to the surface they are rolling on. This gravity change persists, even if the player rolls off of the gravity surface. By default, gravity surfaces still realign the player's gravity even if the player is hovering slightly above the surface. While this can be helpful, in some scenarios it may be desired for this to be disabled - you can do this by setting ``"gravity_surface_line_trace": false`` for the node in the stage config. Gravity surfaces will usually have the :ref:`material_rolledout_mat_surface_gravity_surface` material applied to them. Sticky surfaces --------------- Meshes can be marked as sticky surfaces (``"sticky_surface": true`` in the stage config). These work similarly to gravity surfaces in that they realign a player's gravity when rolling over them. This change however is not persistent, and the player's gravity direction will revert when rolling off them. In addition, sticky surfaces slow down ball movement, but allow the player more control over turning. Gravity surfaces will usually have the :ref:`material_rolledout_mat_surface_sticky_surface` material applied to them. Ice surfaces ------------ Meshes can be marked as ice surfaces (``"ice_surface": true`` in the stage config). These surfaces have a very low (but not zero) friction on them, making them very slippery. Gravity surfaces will usually have the :ref:`material_rolledout_mat_surface_ice_surface` material applied to them. Quicksand surfaces ------------------ Marking a mesh node as a quicksand surface (``"quicksand_surface": true`` in the stage config) gives it a high friction and low bounciness. Quicksand surfaces will usually have the ``redsand.png`` texture applied to their material. Seesaw surfaces --------------- Meshes can be marked as seesaws (``"seesaw_surface": true`` in the stage config), and they will tilt around the object's origin point with the weight of the player ball. The axis that the seesaw rotates around can be set with the ``rotation_axis`` config property. This axis is relative to the object's local transform, not the world. In addition, seesaws have three properties that govern how they react to the ball. - ``seesaw_sensitivity``: The higher the sensitivity, the more reactive the seesaw will be to the ball touching it (Example values: 0.2 is not very sensitive, and 3.0 is very sensitive) - ``seesaw_springiness``: This value is how hard the seesaw fights to return to its resting orientation (Example values: 0.0 means the seesaw won't return to its resting position, 1.0 will make it fight really hard to return) - ``seesaw_friction``: This value sets how much the seesaw wants to stop rotating at all (Eg: A high sensitivity with a high friction will make the seesaw spin very fast while the ball is on it, but when the ball leaves, it'll quickly grind to a halt) Conveyors --------- Any mesh can be marked as a conveyor (``"conveyor": true`` in the stage config, as well as ``"conveyor_local_velocity": {"x": 1000.0, "y": 0.0, "z": 0.0}`` and/or ``"conveyor_uv_velocity": {"x": 1000.0, "y": 0.0}``). Conveyor surfaces tell the physics engine to pretend as if the node was moving at the ``conveyor_velocity`` speed, without actually moving the node. There are two ways of specifying a conveyor: as a velocity relative to the transform on the mesh node, using ``conveyor_local_velocity``, or as a velocity relative to the UV co-ordinates, with ``conveyor_uv_velocity``. The latter one is particularly handy if the texture mapping on your mesh bends round, and you want the conveyor to follow that bend. If both local and UV velocities are specified, they will be added together when computing what force to impart on the player ball. The conveyor velocity is measured in centimeters per second. Conveyors can be animated, see :ref:`mesh_node_properties` for more info. Springs ------- Meshes marked as springs (``"spring": true`` in the stage config, as well as ``"spring_impulse": {"x": 0.0, "y": 0.0, "z": 1000.0}``) will impart a velocity on the ball when a player touches it. Springs also animate briefly in the direction of their impulse, though this is a visual animation only and does not affect collision. The spring impulse is relative to the object's local transform, not the world. Touch platforms --------------- |changed_stage_config_v0_3_0| Any node can be added to a touch platform group, which is effectively a group of animations that can all be activated at once. Mesh nodes can be set to activte certain touch platform groups when collided with, by giving a list of names to the ``activate_touch_platform_groups`` array. Fallout volumes --------------- Meshes can be marked as fallout volumes (``"fallout_volume": true`` in the stage config). These meshes are not visible in-game, nor can the player collide with them, however entering such a volume causes the player to fail a level by falling out. Wind volumes ------------ Meshes marked as wind volumes (``"wind_volume": true`` in the stage config) will apply a wind force to players that are inside of it. Much like fallout volumes, they cannot be collided with and are not visible in-game. The direction/force of the wind is set with the ``wind_velocity`` config property. This is relative to the object's local transform, not the world. The wind velocity can be animated, see :ref:`mesh_node_properties` for more info. Trigger volumes --------------- TODO - Automatically becomes a trigger volume if is marked as a fallout/wind volume - Or can be manually marked as one with ``"trigger_volume": true`` - Can be used to activate touch platform groups when entered .. _mesh_node_properties: Properties ---------- Float properties here can be used as a :ref:`data path ` in stage animations. .. code-block:: conveyor_local_velocity: Vector3 conveyor_local_velocity.x: Float conveyor_local_velocity.y: Float conveyor_local_velocity.z: Float conveyor_uv_velocity: Vector2 conveyor_uv_velocity.x: Float conveyor_uv_velocity.y: Float wind_velocity: Vector3 wind_velocity.x: Float wind_velocity.y: Float wind_velocity.z: Float