Skip to content

Commit

Permalink
sadasd
Browse files Browse the repository at this point in the history
  • Loading branch information
The-O-King committed Oct 29, 2016
1 parent c37a7cc commit 4103362
Show file tree
Hide file tree
Showing 2,580 changed files with 31,475 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
12 changes: 12 additions & 0 deletions Assets/GoogleVR/Scripts/Audio/GvrAudioListener.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

118 changes: 118 additions & 0 deletions Assets/GoogleVR/Scripts/Audio/GvrAudioRoom.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// Copyright 2016 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using UnityEngine;
using System.Collections;

/// GVR audio room component that simulates environmental effects of a room with respect to the
/// properties of the attached game object.
[AddComponentMenu("GoogleVR/Audio/GvrAudioRoom")]
public class GvrAudioRoom : MonoBehaviour {
/// Material type that determines the acoustic properties of a room surface.
public enum SurfaceMaterial {
Transparent = 0, ///< Transparent
AcousticCeilingTiles = 1, ///< Acoustic ceiling tiles
BrickBare = 2, ///< Brick, bare
BrickPainted = 3, ///< Brick, painted
ConcreteBlockCoarse = 4, ///< Concrete block, coarse
ConcreteBlockPainted = 5, ///< Concrete block, painted
CurtainHeavy = 6, ///< Curtain, heavy
FiberglassInsulation = 7, ///< Fiberglass insulation
GlassThin = 8, ///< Glass, thin
GlassThick = 9, ///< Glass, thick
Grass = 10, ///< Grass
LinoleumOnConcrete = 11, ///< Linoleum on concrete
Marble = 12, ///< Marble
Metal = 13, ///< Galvanized sheet metal
ParquetOnConcrete = 14, ///< Parquet on concrete
PlasterRough = 15, ///< Plaster, rough
PlasterSmooth = 16, ///< Plaster, smooth
PlywoodPanel = 17, ///< Plywood panel
PolishedConcreteOrTile = 18, ///< Polished concrete or tile
Sheetrock = 19, ///< Sheetrock
WaterOrIceSurface = 20, ///< Water or ice surface
WoodCeiling = 21, ///< Wood ceiling
WoodPanel = 22 ///< Wood panel
}

/// Room surface material in negative x direction.
public SurfaceMaterial leftWall = SurfaceMaterial.ConcreteBlockCoarse;

/// Room surface material in positive x direction.
public SurfaceMaterial rightWall = SurfaceMaterial.ConcreteBlockCoarse;

/// Room surface material in negative y direction.
public SurfaceMaterial floor = SurfaceMaterial.ParquetOnConcrete;

/// Room surface material in positive y direction.
public SurfaceMaterial ceiling = SurfaceMaterial.PlasterRough;

/// Room surface material in negative z direction.
public SurfaceMaterial backWall = SurfaceMaterial.ConcreteBlockCoarse;

/// Room surface material in positive z direction.
public SurfaceMaterial frontWall = SurfaceMaterial.ConcreteBlockCoarse;

/// Reflectivity scalar for each surface of the room.
public float reflectivity = 1.0f;

/// Reverb gain modifier in decibels.
public float reverbGainDb = 0.0f;

/// Reverb brightness modifier.
public float reverbBrightness = 0.0f;

/// Reverb time modifier.
public float reverbTime = 1.0f;

/// Size of the room (normalized with respect to scale of the game object).
public Vector3 size = Vector3.one;

/// Surface materials holder.
private SurfaceMaterial[] surfaceMaterials = null;

void Awake () {
surfaceMaterials = new SurfaceMaterial[GvrAudio.numRoomSurfaces];
}

void OnEnable () {
GvrAudio.UpdateAudioRoom(this, GvrAudio.IsListenerInsideRoom(this));
}

void OnDisable () {
GvrAudio.UpdateAudioRoom(this, false);
}

void Update () {
GvrAudio.UpdateAudioRoom(this, GvrAudio.IsListenerInsideRoom(this));
}

/// Returns a list of surface materials of the room.
public SurfaceMaterial[] GetSurfaceMaterials () {
surfaceMaterials[0] = leftWall;
surfaceMaterials[1] = rightWall;
surfaceMaterials[2] = floor;
surfaceMaterials[3] = ceiling;
surfaceMaterials[4] = backWall;
surfaceMaterials[5] = frontWall;
return surfaceMaterials;
}

void OnDrawGizmosSelected () {
// Draw shoebox model wireframe of the room.
Gizmos.color = Color.yellow;
Gizmos.matrix = transform.localToWorldMatrix;
Gizmos.DrawWireCube(Vector3.zero, size);
}
}
12 changes: 12 additions & 0 deletions Assets/GoogleVR/Scripts/Audio/GvrAudioRoom.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4103362

Please sign in to comment.