panda3d.core.AudioVolumeAttrib

from panda3d.core import AudioVolumeAttrib
class AudioVolumeAttrib

Bases: RenderAttrib

Applies a scale to audio volume for positional sounds in the scene graph.

Inheritance diagram

Inheritance diagram of AudioVolumeAttrib

property class_slot
Return type

int

static getClassSlot() → int
static getClassType() → TypeHandle
Return type

TypeHandle

getVolume() → float

Returns the volume to be applied to sounds.

hasVolume() → bool

Returns true if the AudioVolumeAttrib has a non-identity volume, false otherwise (in which case it might be an off attrib or an identity attrib).

isOff() → bool

Returns true if the AudioVolumeAttrib will ignore any color scales inherited from above, false otherwise. This is not the same thing as !has_scale(); a AudioVolumeAttrib may have the “off” flag set and also have another scale specified.

static make(volume: float) → RenderAttrib

Constructs a new AudioVolumeAttrib object that indicates audio volume should be scaled by the indicated factor.

Return type

RenderAttrib

static makeDefault() → RenderAttrib

Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

Return type

RenderAttrib

static makeIdentity() → RenderAttrib

Constructs an identity audio volume attrib.

Return type

RenderAttrib

static makeOff() → RenderAttrib

Constructs a new AudioVolumeAttrib object that ignores any AudioVolumeAttrib inherited from above. You may also specify an additional volume scale to apply to geometry below (using setVolume()).

Return type

RenderAttrib

setVolume(volume: float) → RenderAttrib

Returns a new AudioVolumeAttrib, just like this one, but with the volume changed to the indicated value.

Return type

RenderAttrib

property volume

Returns the volume to be applied to sounds.

Return type

float