Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
SfxPlayer Class Reference

## Public Member Functions
| __init__ (self)
| getCutoffDistance (self)
| getLocalizedVolume (self, node, listenerNode=None, cutoff=None)
| playSfx (self, sfx, looping=0, interrupt=1, volume=None, time=0.0, node=None, listenerNode=None, cutoff=None)
| setCutoffDistance (self, d)
| setFinalVolume (self, sfx, node, volume, listenerNode, cutoff=None)

## Public Attributes
| cutoffDistance = d
int | cutoffVolume = .02
| distanceScale = rawCutoffDistance / self.cutoffDistance

## Static Public Attributes
int | UseInverseSquare = 0

## Detailed Description

    Play sound effects, potentially localized.

## Constructor & Destructor Documentation

## ◆ __init__()

__init__ | ( |  | self | ) |

## Member Function Documentation

## ◆ getCutoffDistance()

getCutoffDistance | ( |  | self | ) |

    Return the curent cutoff distance.

## ◆ getLocalizedVolume()

getLocalizedVolume | ( |  | self,
|  |  | node,
|  |  | listenerNode = None,
|  |  | cutoff = None )

    Get the volume that a sound should be played at if it is
    localized at this node. We compute this wrt the camera
    or to listenerNode.

## ◆ playSfx()

playSfx | ( |  | self,
|  |  | sfx,
|  |  | looping = 0,
|  |  | interrupt = 1,
|  |  | volume = None,
|  |  | time = 0.0,
|  |  | node = None,
|  |  | listenerNode = None,
|  |  | cutoff = None )

## ◆ setCutoffDistance()

setCutoffDistance | ( |  | self,
|  |  | d )

## ◆ setFinalVolume()

setFinalVolume | ( |  | self,
|  |  | sfx,
|  |  | node,
|  |  | volume,
|  |  | listenerNode,
|  |  | cutoff = None )

    Calculate the final volume based on all contributed factors.

## Member Data Documentation

## ◆ cutoffDistance

cutoffDistance = d

## ◆ cutoffVolume

int cutoffVolume = .02

## ◆ distanceScale

distanceScale = rawCutoffDistance / self.cutoffDistance

## ◆ UseInverseSquare

int UseInverseSquare = 0
| static