Search Results for

    Show / Hide Table of Contents

    Class PhysicsSettings

    Physics simulation settings container.

    Inheritance
    ISerializable
    SettingsBase
    PhysicsSettings
    Inherited Members
    ISerializable::DeserializeIfExists(DeserializeStream& stream, const char* memberName, ISerializeModifier* modifier)
    PhysicsSettings
    PhysicsSettings
    PhysicsSettings
    ISerializable::~ISerializable()
    Assembly: FlaxEngine.dll
    File: Engine/Physics/PhysicsSettings.h
    Syntax
    public class PhysicsSettings : public SettingsBase

    Constructors

    PhysicsSettings()

    Initializes a new instance of the PhysicsSettings class.

    Declaration
    public PhysicsSettings()

    Fields

    BounceThresholdVelocity

    Minimum relative velocity required for an object to bounce. A typical value for simulation stability is about 0.2 * gravity

    Declaration
    public float BounceThresholdVelocity = 200.0f
    Field Value
    float

    BroadPhaseType

    Broad phase algorithm to use in the simulation.

    Declaration
    public PhysicsBroadPhaseType BroadPhaseType = PhysicsBroadPhaseType::ParallelAutomaticBoxPruning
    Field Value
    PhysicsBroadPhaseType

    DefaultGravity

    The default gravity force value (in cm^2/s).

    Declaration
    public Vector3 DefaultGravity = Vector3(0, -981.0f, 0)
    Field Value
    Vector3

    DisableCCD

    If true CCD will be ignored. This is an optimization when CCD is never used which removes the need for physics to check it internally.

    Declaration
    public bool DisableCCD = false
    Field Value
    bool

    EnableEnhancedDeterminism

    Enables enhanced determinism in the simulation. This has a performance impact.

    Declaration
    public bool EnableEnhancedDeterminism = false
    Field Value
    bool

    EnableSubstepping

    Whether to substep the physics simulation.

    Declaration
    public bool EnableSubstepping = false
    Field Value
    bool

    FrictionCombineMode

    Default friction combine mode, controls how friction is computed for multiple materials.

    Declaration
    public PhysicsCombineMode FrictionCombineMode = PhysicsCombineMode::Average
    Field Value
    PhysicsCombineMode

    LayerMasks

    The collision layers masks. Used to define layer-based collision detection.

    Declaration
    public uint32 LayerMasks[32]
    Field Value
    uint32

    MaxDeltaTime

    The maximum allowed delta time (in seconds) for the physics simulation step.

    Declaration
    public float MaxDeltaTime = 0.1f
    Field Value
    float

    MaxSubsteps

    The maximum number of substeps for physics simulation.

    Declaration
    public int32 MaxSubsteps = 5
    Field Value
    int32

    QueriesHitTriggers

    If enabled, any Raycast or other scene query that intersects with a Collider marked as a Trigger will return with a hit. Individual raycasts can override this behavior.

    Declaration
    public bool QueriesHitTriggers = true
    Field Value
    bool

    RestitutionCombineMode

    Default restitution combine mode, controls how restitution is computed for multiple materials.

    Declaration
    public PhysicsCombineMode RestitutionCombineMode = PhysicsCombineMode::Average
    Field Value
    PhysicsCombineMode

    SolverType

    The solver type to use in the simulation.

    Declaration
    public PhysicsSolverType SolverType = PhysicsSolverType::ProjectedGaussSeidelIterativeSolver
    Field Value
    PhysicsSolverType

    SubstepDeltaTime

    Delta time (in seconds) for an individual simulation substep.

    Declaration
    public float SubstepDeltaTime = 0.00833333333f
    Field Value
    float

    SupportCookingAtRuntime

    Enables support for cooking physical collision shapes geometry at runtime. Use it to enable generating runtime terrain collision or convex mesh colliders.

    Declaration
    public bool SupportCookingAtRuntime = false
    Field Value
    bool

    TriangleMeshTriangleMinAreaThreshold

    Triangles from triangle meshes (CSG) with an area less than or equal to this value will be removed from physics collision data. Set to less than or equal 0 to disable.

    Declaration
    public float TriangleMeshTriangleMinAreaThreshold = 5.0f
    Field Value
    float

    Methods

    Apply()

    Applies the settings to the target system.

    Declaration
    public virtual void Apply() override
    Overrides
    SettingsBase::Apply()

    Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

    Deserializes object from the input stream.

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

    The input stream.

    ISerializeModifier modifier

    The deserialization modifier object. Always valid.

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

    Get()

    Gets the instance of the settings asset (default value if missing). Object returned by this method is always loaded with valid data to use.

    Declaration
    public static PhysicsSettings* Get()
    Returns
    PhysicsSettings

    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
    SettingsBase::Serialize(SerializeStream& stream, const void* otherObj)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat