Drag[en]gine Script Module DragonScript  1.23
Dragengine.Audio.MaterialSounds.ImpactMaterialSound Class Reference

Impact material sound. More...

Inheritance diagram for Dragengine.Audio.MaterialSounds.ImpactMaterialSound:

Public Member Functions

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

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.

◆ getImpulsePower()

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

Conversation factor from impulse to impact power.

◆ getSound()

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

Impact sound.

◆ new() [1/2]

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

Create material.

◆ 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.

◆ 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.

◆ 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.

◆ setImpulsePower()

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

Set conversation factor from impulse to power.

◆ setSound()

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

Set impact sound.


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