IRaptorBlockModifier
A feature that changes how a RaptorMesh Block builds without changing its editable mesh (the cage).
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | interface | preview, since 0.1.0 |
RAPTOR discovers every non-abstract implementation that has a public parameterless constructor (RaptorBlockModifiers.All). No registration is needed. Hash markers below 2000 are reserved for RAPTOR. A third-party modifier must mix a hash of its Id first.
public interface IRaptorBlockModifierProperties
DisplayPriority
int DisplayPriority { get; }Of the modifiers whose DisplayActive returns true, the one with the highest priority builds the Block's display copy. Ties go to the modifier that comes first in Order.
Id
string Id { get; }A persistent id, for example "studio.rounded-corners". Must be unique.
Order
int Order { get; }The order for hashing and Inspector lines. Lower values come first; ties are sorted by Id (ordinal).
Methods
Display
RaptorBlockDisplay Display(RaptorMesh km, PolygonMesh cage, int version)Returns the render-only copy of cage, or null to pack the cage unchanged. The cage is packed beside the copy as collision only. version is the live mesh's edit version (0 for a packed mesh). Use it as a cache key.
| Parameter | Type | Description |
|---|---|---|
km | RaptorMesh | The Block. |
cage | PolygonMesh | The Block's editable mesh. |
version | int | The live mesh's version, or 0 for packed data. |
Returns: The copy, or null.
DisplayActive
bool DisplayActive(RaptorMesh km)Returns whether this modifier builds km's display copy.
| Parameter | Type | Description |
|---|---|---|
km | RaptorMesh | The Block. |
Returns: True to build the display copy.
InspectorLine
string InspectorLine(IReadOnlyList<RaptorMesh> meshes)Returns the Unity Inspector line for these Blocks, or null for none.
| Parameter | Type | Description |
|---|---|---|
meshes | IReadOnlyList<RaptorMesh> | The Blocks. |
Returns: The line, or null.
MixBakeHash
void MixBakeHash(RaptorMesh km, Action<long> mix)Mixes this modifier's words into the persisted bake hash. Mix nothing when the modifier does not change the Block, so its hash is unaffected.
| Parameter | Type | Description |
|---|---|---|
km | RaptorMesh | The Block. |
mix | Action<long> | Mixes one word into the hash. |
MixSessionHash
void MixSessionHash(RaptorMesh km, Action<ulong> mix)Mixes this modifier's words into the session hash, which the editor uses to detect rebuilds and does not save. As with MixBakeHash, mix nothing when the modifier does not change the Block.
| Parameter | Type | Description |
|---|---|---|
km | RaptorMesh | The Block. |
mix | Action<ulong> | Mixes one word into the hash. |
Related types
- RaptorBlockModifiers: The registry of IRaptorBlockModifiers.
- RaptorBlockDisplay: The display copy a Block modifier builds: a render-only mesh and optional corner normals.
- RaptorMesh: A RAPTOR Mesh Block.