reckfellENGINE

GpuParticlesCollisionHeightField3D

A real-time heightmap-shaped 3D particle collision shape affecting GPUParticles3D nodes.

On this page
class GpuParticlesCollisionHeightField3DReckfellSharpInherits GpuParticlesCollision3D

A real-time heightmap-shaped 3D particle collision shape affecting GpuParticles3D nodes.

A real-time heightmap-shaped 3D particle collision shape affecting GpuParticles3D nodes. Heightmap shapes allow for efficiently representing collisions for convex and concave objects with a single "floor" (such as terrain). This is less flexible than GpuParticlesCollisionSdf3D, but it doesn't require a baking step. GpuParticlesCollisionHeightField3D can also be regenerated in real-time when it is moved, when the camera moves, or even continuously. This makes GpuParticlesCollisionHeightField3D a good choice for weather effects such as rain and snow and games with highly dynamic geometry. However, this class is limited since heightmaps cannot represent overhangs (e.g. indoors or caves). Note: ParticleProcessMaterial.CollisionMode must be true on the GpuParticles3D's process material for collision to work. Note: Particle collision only affects GpuParticles3D, not CpuParticles3D.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

GpuParticlesCollisionHeightField3DConstructor
# GpuParticlesCollisionHeightField3D
C#
public GpuParticlesCollisionHeightField3D();

Properties5

FollowCameraEnabledProperty
# FollowCameraEnabled
C#
public bool FollowCameraEnabled { get; set; }

Moves the capture region relative to its viewport current Camera3D in steps and requests updates on movement. Does not mean a new full field for every tiny camera motion.

HeightfieldMaskProperty
# HeightfieldMask
C#
public uint HeightfieldMask { get; set; }

Mesh render layers used to build the height field. Distinct from inherited CullMask selecting particle emitters and from physics layers. Account for capture update mode.

ResolutionProperty
# Resolution
C#
public GpuParticlesCollisionHeightField3D.ResolutionEnum Resolution { get; set; }

Higher resolutions can represent small details more accurately in large scenes, at the cost of lower performance. If GpuParticlesCollisionHeightField3D.UpdateMode is GpuParticlesCollisionHeightField3D.UpdateModeEnum.Always, consider using the lowest resolution possible.

SizeProperty
# Size
C#
public Vector3 Size { get; set; }

Full local capture-region dimensions, not half extents. Do not determine field resolution or guarantee representation of arbitrary 3D overhangs/tunnels.

UpdateModeProperty
# UpdateMode
C#
public GpuParticlesCollisionHeightField3D.UpdateModeEnum UpdateMode { get; set; }

Field update policy. WhenMoved refers to movement of this component; mesh motion alone does not guarantee refresh in that mode. Always requests ongoing updates with a cost.

Methods12

GetHeightfieldMaskuint
# GetHeightfieldMask
C#
public uint GetHeightfieldMask();
Returns uint
GetHeightfieldMaskValuebool
# GetHeightfieldMaskValue
C#
public bool GetHeightfieldMaskValue(int layerNumber);

Returns true if the specified layer of the GpuParticlesCollisionHeightField3D.HeightfieldMask is enabled, given a layer_number between 1 and 20, inclusive.

Parameters
NameTypeDefault
layerNumberint—
Returns bool
GetResolutionGpuParticlesCollisionHeightField3D.ResolutionEnum
# GetResolution
C#
public GpuParticlesCollisionHeightField3D.ResolutionEnum GetResolution();
Returns GpuParticlesCollisionHeightField3D.ResolutionEnum
GetSizeVector3
# GetSize
C#
public Vector3 GetSize();
Returns Vector3
GetUpdateModeGpuParticlesCollisionHeightField3D.UpdateModeEnum
# GetUpdateMode
C#
public GpuParticlesCollisionHeightField3D.UpdateModeEnum GetUpdateMode();
Returns GpuParticlesCollisionHeightField3D.UpdateModeEnum
IsFollowCameraEnabledbool
# IsFollowCameraEnabled
C#
public bool IsFollowCameraEnabled();
Returns bool
SetFollowCameraEnabledvoid
# SetFollowCameraEnabled
C#
public void SetFollowCameraEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetHeightfieldMaskvoid
# SetHeightfieldMask
C#
public void SetHeightfieldMask(uint heightfieldMask);
Parameters
NameTypeDefault
heightfieldMaskuint—
SetHeightfieldMaskValuevoid
# SetHeightfieldMaskValue
C#
public void SetHeightfieldMaskValue(int layerNumber, bool value);

Based on value, enables or disables the specified layer in the GpuParticlesCollisionHeightField3D.HeightfieldMask, given a layer_number between 1 and 20, inclusive.

Parameters
NameTypeDefault
layerNumberint—
valuebool—
SetResolutionvoid
# SetResolution
C#
public void SetResolution(GpuParticlesCollisionHeightField3D.ResolutionEnum resolution);
Parameters
NameTypeDefault
resolutionGpuParticlesCollisionHeightField3D.ResolutionEnum—
SetSizevoid
# SetSize
C#
public void SetSize(Vector3 size);
Parameters
NameTypeDefault
sizeVector3—
SetUpdateModevoid
# SetUpdateMode
C#
public void SetUpdateMode(GpuParticlesCollisionHeightField3D.UpdateModeEnum updateMode);
Parameters
NameTypeDefault
updateModeGpuParticlesCollisionHeightField3D.UpdateModeEnum—

GpuParticlesCollisionHeightField3D.ResolutionEnum

ValueDescription
Max = 6

Represents the size of the GpuParticlesCollisionHeightField3D.ResolutionEnum enum.

Resolution1024 = 2

Generate a 1024×1024 heightmap. Intended for large scenes with distant particles.

Resolution2048 = 3

Generate a 2048×2048 heightmap. Intended for very large scenes with distant particles.

Resolution256 = 0

Generate a 256×256 heightmap. Intended for small-scale scenes, or larger scenes with no distant particles.

Resolution4096 = 4

Generate a 4096×4096 heightmap. Intended for huge scenes with distant particles.

Resolution512 = 1

Generate a 512×512 heightmap. Intended for medium-scale scenes, or larger scenes with no distant particles.

Resolution8192 = 5

Generate a 8192×8192 heightmap. Intended for gigantic scenes with distant particles.

GpuParticlesCollisionHeightField3D.UpdateModeEnum

ValueDescription
Always = 1

Update the heightmap every frame. This has a significant performance cost. This update should only be used when geometry that particles can collide with changes significantly during gameplay.

WhenMoved = 0

Only update the heightmap when the GpuParticlesCollisionHeightField3D node is moved, or when the camera moves if GpuParticlesCollisionHeightField3D.FollowCameraEnabled is true. An update can be forced by slightly moving the GpuParticlesCollisionHeightField3D in any direction, or by calling RenderingServer.ParticlesCollisionHeightFieldUpdate.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.