Class PostProcessingVolume
java.lang.Object
net.risingworld.api.worldelements.GameObject
net.risingworld.api.worldelements.PostProcessingVolume
Represents a local (or global) post-processing volume in the scene. This can either be used to create
multiple post-processing volumes (with individual settings, like weighting, priority etc), or to create
local volumes which are only applied if the player is inside the volume (based on the collider of the element).
Example: Create local volume and change screen color inside the volume
-
Nested Class Summary
Nested classes/interfaces inherited from class net.risingworld.api.worldelements.GameObject
GameObject.AttachTarget
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a global post processing volume, i.e affecting the whole world.PostProcessingVolume
(float weight) Creates a global post processing volume, i.e affecting the whole world.PostProcessingVolume
(float weight, float blendDistance, Collider collider) Creates a local post processing volume, i.e only affecting the area inside this volume. -
Method Summary
Modifier and TypeMethodDescriptionfloat
int
float
boolean
isLocal()
Gets whether or not this is a local volume.void
setBlendDistance
(float blendDistance) Changes the blend distance for this volume.final void
setCollider
(Collider collider) Assigns a collider to this volume.void
setLocal
(boolean set) void
setPriority
(int priority) Sets the priority for this volume.void
setWeight
(float weight) Sets the weight for this volume, i.e how much the post processing effects should be applied.void
Applies all changes which were done to the post processing profile.Methods inherited from class net.risingworld.api.worldelements.GameObject
addChild, addComponent, attachTo, attachTo, deleteAttribute, getAttribute, getAttributes, getChildCount, getChilds, getCollider, getID, getLayer, getLocalPosition, getLocalRotation, getLocalScale, getParent, getPluginID, hasAttribute, hasAttribute, invokeComponentMethod, isActive, isAttached, isColliderVisible, isDisposed, moveToLocalPosition, moveToLocalPosition, moveToLocalPosition, moveToLocalPosition, moveToLocalTransform, readWorldPosition, readWorldRotation, removeAllChilds, removeChild, removeComponent, removeFromParent, rotateToLocalRotation, setActive, setAttribute, setColliderVisible, setComponentEnabled, setComponentProperty, setLayer, setLocalPosition, setLocalPosition, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale
-
Field Details
-
profile
-
-
Constructor Details
-
PostProcessingVolume
public PostProcessingVolume()Creates a global post processing volume, i.e affecting the whole world. -
PostProcessingVolume
public PostProcessingVolume(float weight) Creates a global post processing volume, i.e affecting the whole world.- Parameters:
weight
- weight of the volume. 1 means that post processing effects are fully applied, 0 means that post processing effects are not applied at all. Default is 1.
-
PostProcessingVolume
Creates a local post processing volume, i.e only affecting the area inside this volume. The effective area is determined by a collider.- Parameters:
weight
- weight of the volume. 1 means that post processing effects are fully applied, 0 means that post processing effects are not applied at all. Default is 1.blendDistance
- determines how smoothly the post-processing effects should be blended if the player moves towards this volume.collider
- a collider representing the collision area.
-
-
Method Details
-
getBlendDistance
public float getBlendDistance() -
setBlendDistance
public void setBlendDistance(float blendDistance) Changes the blend distance for this volume. Only relevant if this is a local volume! Determines how smoothly the post processing effects are interpolated when entering this volume. A value if 0 gives a rough and instant transition. A value of 10, for example, interpolates the post processing effects over a distance of 10 blocks etc. The blend distance is applied outside the collider.- Parameters:
blendDistance
- the new blend distance.
-
getWeight
public float getWeight() -
setWeight
public void setWeight(float weight) Sets the weight for this volume, i.e how much the post processing effects should be applied. 1 means that the post processing effects are fully applied, 0 means that the post processing effects are not applied at all.- Parameters:
weight
- the weight for this volume. Default value is 1.
-
getPriority
public int getPriority() -
setPriority
public void setPriority(int priority) Sets the priority for this volume. This is only relevant if you have multiple post processing volumes which are either global or overlapping. In this case, the priority determines which post processing volume should be used.- Parameters:
priority
- the priority for this volume. Default value is 0.
-
isLocal
public boolean isLocal()Gets whether or not this is a local volume. If it's a local volume, the post processing profile is only applied while the player is inside the volume (determined by the collider). Otherwise, if it's a global volume, the post processing effects are visible everywhere (based on weight and priority).- Returns:
- true if this is a local volume, false if this is a global volume.
-
setLocal
public void setLocal(boolean set) -
setCollider
Assigns a collider to this volume. In this particular case, the collider is used to determine whether or not the player is inside the volume (if it's a local volume). To prevent the player from actually getting blocked by the collider, it's recommendable to make this atrigger
collider. Alternatively don't change the layer of the game object (by default, volumes use the TRANSPARENT_FX layer, which never collides with the player).- Overrides:
setCollider
in classGameObject
- Parameters:
collider
- the new collider. Set to null to remove the collider.
-
updateProfile
public void updateProfile()Applies all changes which were done to the post processing profile. Always call this method after modifying theprofile
, so the changes are synced with the players.
-