Search Results for

    Show / Hide Table of Contents

    Class TerrainChunk

    Represents a single terrain chunk.

    Inheritance
    Object
    ScriptingObject
    TerrainChunk
    Inherited Members
    ScriptingObject::_gcHandle
    ScriptingObject::_id
    ScriptingObject::_type
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    ScriptingObject::Cast(ScriptingObject* obj)
    ScriptingObject::ChangeID(const Guid& newId)
    ScriptingObject::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    ScriptingObject::Deleted
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    ISerializable::DeserializeIfExists(DeserializeStream& stream, const char* memberName, ISerializeModifier* modifier)
    TerrainChunk
    ScriptingObject::DestroyManaged()
    Object::Flags
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    ScriptingObject::GetClass()
    ScriptingObject::GetID()
    ScriptingObject::GetManagedInstance()
    ScriptingObject::GetOrCreateManagedInstance()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    ScriptingObject::HasManagedInstance()
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    ScriptingObject::IsRegistered()
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    ScriptingObject::OnDeleteObject()
    ScriptingObject::OnManagedInstanceDeleted()
    ScriptingObject::OnScriptingDispose()
    ScriptingObject::RegisterObject()
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    TerrainChunk
    TerrainChunk
    ScriptingObject::SetManagedInstance(MObject* instance)
    TerrainChunk
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    ScriptingObject::ToString()
    ScriptingObject::UnregisterObject()
    ISerializable::~ISerializable()
    Object::~Object()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Terrain/TerrainChunk.h
    Syntax
    public class TerrainChunk : public ScriptingObject, public ISerializable

    Fields

    Lightmap

    The baked lightmap entry info for this chunk.

    Declaration
    public LightmapEntry Lightmap
    Field Value
    LightmapEntry

    OverrideMaterial

    The material to override the terrain default one for this chunk.

    Declaration
    public AssetReference<MaterialBase> OverrideMaterial
    Field Value
    AssetReference<MaterialBase>

    Methods

    CacheNeighbors()

    Caches the neighbor chunks of this chunk.

    Declaration
    public void CacheNeighbors()

    Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

    Deserializes object from the input stream.

    Declaration
    public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
    Parameters
    DeserializeStream stream

    The input stream.

    ISerializeModifier modifier

    The deserialization modifier object. Always valid.

    Overrides
    ISerializable::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

    Draw(const RenderContext& renderContext)

    Draws the chunk (adds the draw call). Must be called after PrepareDraw.

    Declaration
    public void Draw(const RenderContext& renderContext) const
    Parameters
    RenderContext renderContext

    The rendering context.

    Draw(const RenderContext& renderContext, MaterialBase* material, int32 lodIndex = 0)

    Draws the terrain chunk.

    Declaration
    public void Draw(const RenderContext& renderContext, MaterialBase* material, int32 lodIndex = 0) const
    Parameters
    RenderContext renderContext

    The rendering context.

    MaterialBase material

    The material to use for rendering.

    int32 lodIndex

    The LOD index.

    GetBounds()

    Gets the chunk world bounds.

    Declaration
    public BoundingBox GetBounds() const
    Returns
    BoundingBox

    GetHeightmapUVScaleBias()

    Gets the scale (in XY) and bias (in ZW) applied to the vertex UVs to get the chunk coordinates.

    Declaration
    public Float4 GetHeightmapUVScaleBias() const
    Returns
    Float4

    GetPatch()

    Gets the patch.

    Declaration
    public TerrainPatch* GetPatch() const
    Returns
    TerrainPatch

    GetTransform()

    Gets the chunk transformation (world to local).

    Declaration
    public Transform GetTransform() const
    Returns
    Transform

    GetX()

    Gets the x coordinate.

    Declaration
    public int32 GetX() const
    Returns
    int32

    GetZ()

    Gets the z coordinate.

    Declaration
    public int32 GetZ() const
    Returns
    int32

    HasLightmap()

    Determines whether this chunk has valid lightmap data.

    Declaration
    public bool HasLightmap() const
    Returns
    bool

    Intersects(const Ray& ray, Real& distance)

    Determines if there is an intersection between the terrain chunk and a point

    Declaration
    public bool Intersects(const Ray& ray, Real& distance)
    Parameters
    Ray ray

    The ray.

    Real distance

    The output distance.

    Returns
    bool

    True if chunk intersects with the ray, otherwise false.

    PrepareDraw(const RenderContext& renderContext)

    Prepares for drawing chunk. Cached LOD and material.

    Declaration
    public bool PrepareDraw(const RenderContext& renderContext)
    Parameters
    RenderContext renderContext

    The rendering context.

    Returns
    bool

    True if draw chunk, otherwise false.

    RemoveLightmap()

    Removes the lightmap data from the chunk.

    Declaration
    public void RemoveLightmap()
    Returns
    void

    Serialize(SerializeStream& stream, const void* otherObj)

    Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.

    Declaration
    public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
    Parameters
    SerializeStream stream

    The output stream.

    void otherObj

    The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties.

    Overrides
    ISerializable::Serialize(SerializeStream& stream, const void* otherObj)

    UpdateBounds()

    Updates the cached bounds of the chunk.

    Declaration
    public void UpdateBounds()

    UpdateTransform()

    Updates the cached transform of the chunk.

    Declaration
    public void UpdateTransform()
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat