Value

Inheritance diagram of rumba.Value
class Value

Base class of all Rumba values.

Variables

default_value (Value) – Static. The default value.

Methods

__eq__

Return self==value.

__hash__

Return hash(self).

__init__

Constructor(s)

__ne__

Return self!=value.

as_Box3f()

Returns the value as a Box3f.

as_Color4f()

Returns the value as a Color4f.

as_M44d()

Returns the value as a M44d.

as_M44f()

Returns the value as a M44f.

as_Quatd()

Returns the value as a Quatd.

as_Quatf()

Returns the value as a Quatf.

as_V2d()

Returns the value as a V2d.

as_V2f()

Returns the value as a V2f.

as_V2i()

Returns the value as a V2i.

as_V3d()

Returns the value as a V3d.

as_V3f()

Returns the value as a V3f.

as_V3i()

Returns the value as a V3i.

as_V4d()

Returns the value as a V4d.

as_V4f()

Returns the value as a V4f.

as_V4i()

Returns the value as a V4i.

as_bool()

Returns the value as a bool.

as_double()

Returns the value as a double.

as_float()

Returns the value as a float.

as_int()

Returns the value as an integer.

as_string()

Returns the value as a string.

duplicate()

Duplicate the value.

is_instance(value_type_name)

Check if this type derives from another value type.

is_interpolable()

Checks if the value is interpolable.

lerp(other, weight)

Performs linear interpolation between this value and another value.

type_name()

Return the type name of the Value.

Properties

default_value

__init__()

Constructor(s)

Value (arg1: bool)

Create a boolean value.

Value (arg1: int)

Create an integer value.

Value (arg1: float)

Create a float value.

Value (arg1: double)

Create a double value.

Value (string: unicode)

Create a string value.

Value (string: wchar_t)

Create a string value.

Value (string: unicode)

Create a string value.

Value (string: unicode)

Create a wide string value.

Value (arg1: Imath.V2f)

Create a Imath::V2f value.

Value (arg1: Imath.V3f)

Create a Imath::V3f value.

Value (arg1: Imath.V4f)

Create a Imath::V4f value.

Value (arg1: Imath.V2d)

Create a Imath::V2d value.

Value (arg1: Imath.V3d)

Create a Imath::V3d value.

Value (arg1: Imath.V4d)

Create a Imath::V4d value.

Value (arg1: Imath.V2i)

Create a Imath::V2i value.

Value (arg1: Imath.V3i)

Create a Imath::V3i value.

Value (arg1: Imath.V4i)

Create a Imath::V4i value.

Value (arg1: Imath.Color4f)

Create a Imath::Color4f value.

Value (arg1: Imath.M44f)

Create a Imath::M44f value.

Value (arg1: Imath.M44d)

Create a Imath::M44d value.

Value (arg1: Imath.Box3f)

Create a Imath::Box3f value.

Value (arg1: Imath.Quatf)

Create a Imath::Quatf value.

Value (arg1: Imath.Quatd)

Create a Imath::Quatd value.

Value (user_data: UserData)

Create a user data value.

as_Box3f() Imath.Box3f

Returns the value as a Box3f.

You must be sure this value is a Box3f or you will have an empty box.

Return type

Imath.Box3f

as_Color4f() Imath.Color4f

Returns the value as a Color4f.

You must be sure this value is a Color4f or you will have {0,0,0,0}.

Return type

Imath.Color4f

as_M44d() Imath.M44d

Returns the value as a M44d.

You must be sure this value is a M44f or M44d or you will have an identity matrix.

Return type

Imath.M44d

as_M44f() Imath.M44f

Returns the value as a M44f.

You must be sure this value is a M44f or M44d or you will have an identity matrix.

Return type

Imath.M44f

as_Quatd() Imath.Quatd

Returns the value as a Quatd.

You must be sure this value is a Quatf/Quatd or you will have an identity quaternion.

Return type

Imath.Quatd

as_Quatf() Imath.Quatf

Returns the value as a Quatf.

You must be sure this value is a Quatf or you will have an identity quaternion.

Return type

Imath.Quatf

as_V2d() Imath.V2d

Returns the value as a V2d.

You must be sure this value is a V2d or you will have {0,0}.

Return type

Imath.V2d

as_V2f() Imath.V2f

Returns the value as a V2f.

You must be sure this value is a V2f/V2d or you will have {0,0}.

Return type

Imath.V2f

as_V2i() Imath.V2i

Returns the value as a V2i.

You must be sure this value is a V2i or you will have {0,0}.

Return type

Imath.V2i

as_V3d() Imath.V3d

Returns the value as a V3d.

You must be sure this value is a V3d or you will have {0,0,0}.

Return type

Imath.V3d

as_V3f() Imath.V3f

Returns the value as a V3f.

You must be sure this value is a V3f/V3d or you will have {0,0,0}.

Return type

Imath.V3f

as_V3i() Imath.V3i

Returns the value as a V3i.

You must be sure this value is a V3i or you will have {0,0,0}.

Return type

Imath.V3i

as_V4d() Imath.V4d

Returns the value as a V4d.

You must be sure this value is a V4d or you will have {0,0,0,0}.

Return type

Imath.V4d

as_V4f() Imath.V4f

Returns the value as a V4f.

You must be sure this value is a V4f/V4d or you will have {0,0,0,0}.

Return type

Imath.V4f

as_V4i() Imath.V4i

Returns the value as a V4i.

You must be sure this value is a V4i or you will have {0,0,0,0}.

Return type

Imath.V4i

as_bool() bool

Returns the value as a bool.

You must be sure this value is an integer, a float or a boolean or you get false.

Return type

bool

as_double() double

Returns the value as a double.

You must be sure this value is an integer, a float or a boolean or you get 0.0.

Return type

double

as_float() float

Returns the value as a float.

You must be sure this value is an integer, a float or a boolean or you get 0.f.

Return type

float

as_int() int

Returns the value as an integer.

You must be sure this value is an integer, a float or a boolean or you get 0.

Return type

int

as_string() unicode

Returns the value as a string.

You must be sure this value is a string or you will have an empty string.

Return type

unicode

duplicate() Value

Duplicate the value.

In most cases, the duplication is a light process, i-e, the internal buffers are shared and copied-on-write

Return type

Value

static get_default_value(type_name: unicode) Value

Return a default value for a given type.

Return type

Value

is_instance(value_type_name: unicode) bool

Check if this type derives from another value type.

Return type

bool

is_interpolable() bool

Checks if the value is interpolable.

This function determines whether the current value can be smoothly interpolated using interpolation methods like lerp() or weighted_sum().

True if the value is interpolable; otherwise, false.

Return type

bool

lerp(other: Value, weight: double) Value

Performs linear interpolation between this value and another value.

This function interpolates between the current value and the specified other value based on the given weight. If the value is not interpolable, it returns this if the weight is less than or equal to 0.5, and returns other otherwise.

The interpolated value, or this or other depending on the weight if the value is not interpolable.

Return type

Value

type_name() StringView

Return the type name of the Value.

For basic types names are : “Int”, “Bool”, “Float”, “String”, “V2f”, “V3f”, “V4f”, “V2i”, “V3i”, “V4i”, “M44f”, “Box3f”, “Color4f”, “Quat4f”

Return type

StringView

static validate_type_name(type_name: unicode) bool

Return true if the name is a valid type name.

Return type

bool