Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Audio.MaterialSounds.ImpactMaterialSound Class Reference

Impact material sound. More...

Inheritance diagram for Dragengine.Audio.MaterialSounds.ImpactMaterialSound:

Public Member Functions

String getID ()
 Identifier.
float getImpulsePower ()
 Conversation factor from impulse to impact power.
MaterialSound getSound ()
 Impact sound.
ImpactMaterialSound new (String id)
 Create material.
ImpactMaterialSound new (String id, ImpactMaterialSound material)
 Create copy of material with new identifier.
void playSound (GameWorld world, CollisionInfo collision, ImpactMaterialSound material)
 Play impact sound of this material hitting another.
void playSound (GameWorld world, DVector position, float impulse)
 Play impact sound.
void playSound (GameWorld world, DVector position, float impulse, ImpactMaterialSound material)
 Play impact sound of this material hitting another.
void setImpulsePower (float factor)
 Set conversation factor from impulse to power.
void setSound (MaterialSound sound)
 Set impact sound.

Detailed Description

Impact material sound.

Material sounds used for objects hitting each other. Typically used for collisions between dynamic or kinematic colliders. Collider rig shapes are assigned the model texture they belong to. This can be used to figure out what skins are involved in the collision. Using SkinAnnotations the ImpactMaterialSound identifier for the skin file path can be looked up. Each ImpactMaterialSound involved in the collision plays back an impact sound. This allows to simulate a vaste amount of inter-material collisions without needing to record an explicit sound for each possible combination of materials. You only need to record a collision sound for each material.

Member Function Documentation

◆ getID()

String Dragengine.Audio.MaterialSounds.ImpactMaterialSound.getID ( )

Identifier.

Referenced by setImpulsePower().

◆ getImpulsePower()

float Dragengine.Audio.MaterialSounds.ImpactMaterialSound.getImpulsePower ( )

Conversation factor from impulse to impact power.

Referenced by playSound().

◆ getSound()

MaterialSound Dragengine.Audio.MaterialSounds.ImpactMaterialSound.getSound ( )

Impact sound.

Referenced by setImpulsePower().

◆ new() [1/2]

ImpactMaterialSound Dragengine.Audio.MaterialSounds.ImpactMaterialSound.new ( String id)

Create material.

References new().

Referenced by new().

◆ new() [2/2]

ImpactMaterialSound Dragengine.Audio.MaterialSounds.ImpactMaterialSound.new ( String id,
ImpactMaterialSound material )

Create copy of material with new identifier.

◆ playSound() [1/3]

void Dragengine.Audio.MaterialSounds.ImpactMaterialSound.playSound ( GameWorld world,
CollisionInfo collision,
ImpactMaterialSound material )

Play impact sound of this material hitting another.

Parameters
[in]worldWorld to play sound in.
[in]collisionCollision information originating by owner this material.
[in]materialHit material. If null default parameters are assumed.

References setSound().

Referenced by playSound().

◆ playSound() [2/3]

void Dragengine.Audio.MaterialSounds.ImpactMaterialSound.playSound ( GameWorld world,
DVector position,
float impulse )

Play impact sound.

Parameters
[in]worldWorld to play sound in.
[in]positionImpact position in world space.
[in]impulseImpact impulse.

References playSound().

◆ playSound() [3/3]

void Dragengine.Audio.MaterialSounds.ImpactMaterialSound.playSound ( GameWorld world,
DVector position,
float impulse,
ImpactMaterialSound material )

Play impact sound of this material hitting another.

Parameters
[in]worldWorld to play sound in.
[in]positionImpact position in world space.
[in]impulseImpact impulse.
[in]materialHit material. If null default parameters are assumed.

References getImpulsePower(), and setImpulsePower().

◆ setImpulsePower()

void Dragengine.Audio.MaterialSounds.ImpactMaterialSound.setImpulsePower ( float factor)

Set conversation factor from impulse to power.

References getID(), and getSound().

Referenced by playSound().

◆ setSound()

void Dragengine.Audio.MaterialSounds.ImpactMaterialSound.setSound ( MaterialSound sound)

Set impact sound.

Referenced by playSound().


The documentation for this class was generated from the following file: