Package com.sun.j3d.utils.audio

Source Code of com.sun.j3d.utils.audio.DistanceAttenuation

/*     */ package com.sun.j3d.utils.audio;
/*     */
/*     */ import com.sun.j3d.internal.J3dUtilsI18N;
/*     */ import javax.media.j3d.SoundException;
/*     */ import javax.vecmath.Point2f;
/*     */
/*     */ public class DistanceAttenuation
/*     */ {
/*     */   static final int DOUBLE_DISTANCE_HALF_GAIN = 1;
/*     */
/*     */   public void fillDistanceAttenuation(float unitDistance, float unitGain, Point2f[] distanceAttenuation)
/*     */   {
/*  82 */     if (distanceAttenuation == null) {
/*  83 */       throw new SoundException(J3dUtilsI18N.getString("DistanceAttenuation0"));
/*     */     }
/*  85 */     int length = distanceAttenuation.length;
/*  86 */     distanceAttenuation[0].x = 0.0F;
/*  87 */     distanceAttenuation[0].y = unitGain;
/*  88 */     float nextDistance = unitDistance;
/*  89 */     float nextGain = unitGain;
/*     */
/*  91 */     for (int i = 1; i < length; i++) {
/*  92 */       distanceAttenuation[i].x = nextDistance;
/*  93 */       distanceAttenuation[i].y = nextGain;
/*  94 */       nextDistance *= 2.0F;
/*  95 */       nextGain *= 0.5F;
/*     */     }
/*     */   }
/*     */
/*     */   public void fillDistanceAttenuation(float innerRadius, float maxConstantGain, float unitDistance, float unitGain, int curveType, Point2f[] distanceAttenuation)
/*     */   {
/* 103 */     if (distanceAttenuation == null) {
/* 104 */       throw new SoundException(J3dUtilsI18N.getString("DistanceAttenuation0"));
/*     */     }
/* 106 */     int length = distanceAttenuation.length;
/* 107 */     distanceAttenuation[0].x = innerRadius;
/* 108 */     distanceAttenuation[0].y = maxConstantGain;
/*     */
/* 111 */     float nextDistance = unitDistance;
/* 112 */     float nextGain = unitGain;
/*     */
/* 114 */     for (int i = 1; i < length; i++) {
/* 115 */       distanceAttenuation[i].x = (innerRadius + nextDistance);
/* 116 */       distanceAttenuation[i].y = nextGain;
/* 117 */       nextDistance *= 2.0F;
/* 118 */       nextGain *= 0.5F;
/*     */     }
/*     */   }
/*     */
/*     */   public void fillDistanceAttenuation(float innerRadius, float maxConstantGain, float unitDistance, float unitGain, float outerRadius, float minConstantGain, int curveType, Point2f[] distanceAttenuation)
/*     */   {
/*     */   }
/*     */ }

/* Location:           Z:\System\Library\Java\Extensions\j3dutils.jar
* Qualified Name:     com.sun.j3d.utils.audio.DistanceAttenuation
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of com.sun.j3d.utils.audio.DistanceAttenuation

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.