GrassTrample¶
-
class GrassTrample¶
Bases:
TypedReferenceCountWhere the grass has been trodden or driven over: a square map of `size` texels over `extent` metres that follows a centre (a camera, a player, a vehicle) in whole texels, so what was stamped stays put in the world while the map moves. A texel holds the push direction (x, y) and how flat the grass is (0..1); flat grass recovers over `recovery` seconds. The grass shader reads it as an RGBA16F texture. At most MAX_SIZE texels a side; non-finite arguments are rejected with an error.
Inheritance diagram
digraph inheritance1d87392b18 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "GrassTrample" [URL="acron.vegetation.GrassTrample.html#acron.vegetation.GrassTrample",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "GrassTrample" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }- GrassTrample.__init__()¶
A map of size x size texels over extent x extent metres, centred on the origin until
set_center()moves it.
- GrassTrample.clear()¶
- static GrassTrample.get_class_type()¶
- GrassTrample.get_extent()¶
- GrassTrample.get_flatness()¶
How flat the grass is at (x, y) (0 outside the map).
- GrassTrample.get_origin()¶
The world position of the map’s south-west corner.
- GrassTrample.get_size()¶
- GrassTrample.recover()¶
Lets the grass stand up again: flatness falls to nothing over `recovery` seconds.
- GrassTrample.set_center()¶
Centres the map on (x, y), scrolling what it holds by whole texels.
- GrassTrample.stamp()¶
Flattens the grass in a disc (a soft edge over its outer third), pushing it along (dir_x, dir_y) – or away from the centre when that is zero. Stamps keep the flattest value.
- GrassTrample.write_texture()¶
The map as an RGBA16F texture (rows south to north): rg the push direction, b the flatness.