hifi-production tutorials -> vircadia-content

This commit is contained in:
Kalila L 2020-10-07 19:42:51 -04:00
parent dc554bb8c6
commit 46ddde0bd6
17 changed files with 38 additions and 38 deletions

View file

@ -16,7 +16,7 @@ var FRAME_RATE = 30; // 30 default
function getFrame(callback) { function getFrame(callback) {
// A model exported from blender with a texture named 'Picture' on one face. // A model exported from blender with a texture named 'Picture' on one face.
var FRAME_URL = "http://hifi-production.s3.amazonaws.com/tutorials/pictureFrame/finalFrame.fbx"; var FRAME_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pictureFrame/finalFrame.fbx";
var model = ModelCache.prefetch(FRAME_URL); var model = ModelCache.prefetch(FRAME_URL);
if (model.state === Resource.State.FINISHED) { if (model.state === Resource.State.FINISHED) {

View file

@ -86,13 +86,13 @@ function addButterfly() {
dimensions: dimensions, dimensions: dimensions,
color: color, color: color,
animation: { animation: {
url: "http://hifi-production.s3.amazonaws.com/tutorials/butterflies/butterfly.fbx", url: "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/butterflies/butterfly.fbx",
fps: newFrameRate, fps: newFrameRate,
loop: true, loop: true,
running: true, running: true,
startAutomatically:false startAutomatically:false
}, },
modelURL: "http://hifi-production.s3.amazonaws.com/tutorials/butterflies/butterfly.fbx" modelURL: "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/butterflies/butterfly.fbx"
}; };
butterflies.push(Entities.addEntity(properties)); butterflies.push(Entities.addEntity(properties));
} }

View file

@ -9,9 +9,9 @@
// //
// references to our assets. entity scripts need to be served from somewhere that is publically accessible -- so http(s) or atp // references to our assets. entity scripts need to be served from somewhere that is publically accessible -- so http(s) or atp
var SCRIPT_URL ="http://hifi-production.s3.amazonaws.com/tutorials/entity_scripts/cow.js"; var SCRIPT_URL ="https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/entity_scripts/cow.js";
var MODEL_URL = "http://hifi-production.s3.amazonaws.com/tutorials/cow/cow.fbx"; var MODEL_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/cow/cow.fbx";
var ANIMATION_URL = 'http://hifi-production.s3.amazonaws.com/tutorials/cow/cow.fbx'; var ANIMATION_URL = 'https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/cow/cow.fbx';
// this part of the code describes how to center the entity in front of your avatar when it is created. // this part of the code describes how to center the entity in front of your avatar when it is created.
var orientation = MyAvatar.orientation; var orientation = MyAvatar.orientation;

View file

@ -23,7 +23,7 @@ var DIE_SIZE = 0.20;
var madeSound = true; // Set false at start of throw to look for collision var madeSound = true; // Set false at start of throw to look for collision
SoundCache.getSound("http://hifi-production.s3.amazonaws.com/tutorials/dice/diceCollide.wav"); SoundCache.getSound("https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/dice/diceCollide.wav");
var INSUFFICIENT_PERMISSIONS_ERROR_MSG = "You do not have the necessary permissions to create new objects." var INSUFFICIENT_PERMISSIONS_ERROR_MSG = "You do not have the necessary permissions to create new objects."
@ -45,7 +45,7 @@ var toolBar = new ToolBar(0, 0, ToolBar.HORIZONTAL, "highfidelity.toolbars-dice"
var offButton = toolBar.addOverlay("image", { var offButton = toolBar.addOverlay("image", {
width: BUTTON_SIZE, width: BUTTON_SIZE,
height: BUTTON_SIZE, height: BUTTON_SIZE,
imageURL: "http://hifi-production.s3.amazonaws.com/tutorials/dice/close.png", imageURL: "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/dice/close.png",
alpha: 1 alpha: 1
}); });
@ -54,11 +54,11 @@ var deleteButton = toolBar.addOverlay("image", {
y: screenSize.y - (BUTTON_SIZE + PADDING)+BOTTOM_PADDING, y: screenSize.y - (BUTTON_SIZE + PADDING)+BOTTOM_PADDING,
width: BUTTON_SIZE, width: BUTTON_SIZE,
height: BUTTON_SIZE, height: BUTTON_SIZE,
imageURL: "http://hifi-production.s3.amazonaws.com/tutorials/dice/delete.png", imageURL: "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/dice/delete.png",
alpha: 1 alpha: 1
}); });
var diceIconURL = "http://hifi-production.s3.amazonaws.com/tutorials/dice/dice.png" var diceIconURL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/dice/dice.png"
var diceButton = toolBar.addOverlay("image", { var diceButton = toolBar.addOverlay("image", {
x: screenSize.x / 2 + PADDING, x: screenSize.x / 2 + PADDING,
y: screenSize.y - (BUTTON_SIZE + PADDING)+BOTTOM_PADDING, y: screenSize.y - (BUTTON_SIZE + PADDING)+BOTTOM_PADDING,
@ -82,7 +82,7 @@ function shootDice(position, velocity) {
for (var i = 0; i < NUMBER_OF_DICE; i++) { for (var i = 0; i < NUMBER_OF_DICE; i++) {
dice.push(Entities.addEntity({ dice.push(Entities.addEntity({
type: "Model", type: "Model",
modelURL: "http://hifi-production.s3.amazonaws.com/tutorials/dice/goldDie.fbx", modelURL: "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/dice/goldDie.fbx",
position: position, position: position,
velocity: velocity, velocity: velocity,
rotation: Quat.fromPitchYawRollDegrees(Math.random() * 360, Math.random() * 360, Math.random() * 360), rotation: Quat.fromPitchYawRollDegrees(Math.random() * 360, Math.random() * 360, Math.random() * 360),
@ -99,7 +99,7 @@ function shootDice(position, velocity) {
lifetime: LIFETIME, lifetime: LIFETIME,
shapeType: "box", shapeType: "box",
dynamic: true, dynamic: true,
collisionSoundURL: "http://hifi-production.s3.amazonaws.com/tutorials/dice/diceCollide.wav" collisionSoundURL: "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/dice/diceCollide.wav"
})); }));
position = Vec3.sum(position, Vec3.multiply(DIE_SIZE, Vec3.normalize(Quat.getRight(Camera.getOrientation())))); position = Vec3.sum(position, Vec3.multiply(DIE_SIZE, Vec3.normalize(Quat.getRight(Camera.getOrientation()))));
} }

View file

@ -9,8 +9,8 @@
// //
var SCRIPT_URL = "http://hifi-production.s3.amazonaws.com/tutorials/entity_scripts/flashlight.js"; var SCRIPT_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/entity_scripts/flashlight.js";
var MODEL_URL = "http://hifi-production.s3.amazonaws.com/tutorials/flashlight/flashlight2.fbx"; var MODEL_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/flashlight/flashlight2.fbx";
var center = Vec3.sum(Vec3.sum(MyAvatar.position, { var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
x: 0, x: 0,

View file

@ -17,8 +17,8 @@ orientation.x = 0;
orientation = Quat.fromVec3Degrees(orientation); orientation = Quat.fromVec3Degrees(orientation);
var center = Vec3.sum(MyAvatar.getHeadPosition(), Vec3.multiply(2, Quat.getForward(orientation))); var center = Vec3.sum(MyAvatar.getHeadPosition(), Vec3.multiply(2, Quat.getForward(orientation)));
var CLUB_MODEL = "http://hifi-production.s3.amazonaws.com/tutorials/golfClub/putter_VR.fbx"; var CLUB_MODEL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/golfClub/putter_VR.fbx";
var CLUB_COLLISION_HULL = "http://hifi-production.s3.amazonaws.com/tutorials/golfClub/club_collision_hull.obj"; var CLUB_COLLISION_HULL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/golfClub/club_collision_hull.obj";
var CLUB_DIMENSIONS = { var CLUB_DIMENSIONS = {
"x": 0.043093059211969376, "x": 0.043093059211969376,
@ -34,7 +34,7 @@ var CLUB_ROTATION = {
}; };
var SCRIPT_URL = "http://hifi-production.s3.amazonaws.com/tutorials/entity_scripts/golfClub.js"; var SCRIPT_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/entity_scripts/golfClub.js";
var golfClubProperties = { var golfClubProperties = {
position: center, position: center,
lifetime: 3600, lifetime: 3600,

View file

@ -17,7 +17,7 @@ var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
}), Vec3.multiply(1, Quat.getForward(Camera.getOrientation()))); }), Vec3.multiply(1, Quat.getForward(Camera.getOrientation())));
// this is just a model exported from blender with a texture named 'Picture' on one face. also made it emissive so it doesn't require lighting. // this is just a model exported from blender with a texture named 'Picture' on one face. also made it emissive so it doesn't require lighting.
var MODEL_URL = "http://hifi-production.s3.amazonaws.com/tutorials/pictureFrame/finalFrame.fbx"; var MODEL_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pictureFrame/finalFrame.fbx";
//this is where we are going to get our image from. the stuff at the end is our API key. //this is where we are going to get our image from. the stuff at the end is our API key.
var NASA_API_ENDPOINT = "https://api.nasa.gov/planetary/apod?api_key=XNmgPJvVK8hGroZHB19PaQtlqKZk4q8GorWViuND"; var NASA_API_ENDPOINT = "https://api.nasa.gov/planetary/apod?api_key=XNmgPJvVK8hGroZHB19PaQtlqKZk4q8GorWViuND";
@ -59,7 +59,7 @@ function makePictureFrame() {
} }
var pictureFrame = Entities.addEntity(pictureFrameProperties); var pictureFrame = Entities.addEntity(pictureFrameProperties);
var OUTER_FRAME_MODEL_URL = "http://hifi-production.s3.amazonaws.com/tutorials/pictureFrame/outer_frame.fbx"; var OUTER_FRAME_MODEL_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pictureFrame/outer_frame.fbx";
var outerFrameProps = { var outerFrameProps = {
name: "Tutorial Outer Frame", name: "Tutorial Outer Frame",
type: "Model", type: "Model",

View file

@ -7,9 +7,9 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
var SCRIPT_URL = "http://hifi-production.s3.amazonaws.com/tutorials/entity_scripts/pingPongGun.js"; var SCRIPT_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/entity_scripts/pingPongGun.js";
var MODEL_URL = 'http://hifi-production.s3.amazonaws.com/tutorials/pingPongGun/Pingpong-Gun-New.fbx'; var MODEL_URL = 'https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pingPongGun/Pingpong-Gun-New.fbx';
var COLLISION_HULL_URL = 'http://hifi-production.s3.amazonaws.com/tutorials/pingPongGun/Pingpong-Gun-New.obj'; var COLLISION_HULL_URL = 'https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pingPongGun/Pingpong-Gun-New.obj';
var center = Vec3.sum(Vec3.sum(MyAvatar.position, { var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
x: 0, x: 0,
y: 0.5, y: 0.5,

View file

@ -7,9 +7,9 @@
// //
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(1.5, Quat.getForward(Camera.getOrientation()))); var center = Vec3.sum(MyAvatar.position, Vec3.multiply(1.5, Quat.getForward(Camera.getOrientation())));
var SCRIPT_URL = "http://hifi-production.s3.amazonaws.com/tutorials/entity_scripts/pistol.js"; var SCRIPT_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/entity_scripts/pistol.js";
var MODEL_URL = "http://hifi-production.s3.amazonaws.com/tutorials/pistol/gun.fbx"; var MODEL_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pistol/gun.fbx";
var COLLISION_SOUND_URL = 'http://hifi-production.s3.amazonaws.com/tutorials/pistol/drop.wav' var COLLISION_SOUND_URL = 'https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pistol/drop.wav'
var pistolProperties = { var pistolProperties = {
type: 'Model', type: 'Model',

View file

@ -6,8 +6,8 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
var SCRIPT_URL = "http://hifi-production.s3.amazonaws.com/tutorials/entity_scripts/soundMaker.js"; var SCRIPT_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/entity_scripts/soundMaker.js";
var MODEL_URL = "http://hifi-production.s3.amazonaws.com/tutorials/soundMaker/Front-Desk-Bell.fbx"; var MODEL_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/soundMaker/Front-Desk-Bell.fbx";
var center = Vec3.sum(Vec3.sum(MyAvatar.position, { var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
x: 0, x: 0,

View file

@ -19,7 +19,7 @@
//set our id so other methods can get it. //set our id so other methods can get it.
_this.entityID = entityID; _this.entityID = entityID;
//load the mooing sound //load the mooing sound
_this.mooSound = SoundCache.getSound("http://hifi-production.s3.amazonaws.com/tutorials/cow/moo.wav") _this.mooSound = SoundCache.getSound("https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/cow/moo.wav")
_this.mooSoundOptions = { _this.mooSoundOptions = {
volume: 0.7, volume: 0.7,
loop: false loop: false

View file

@ -13,7 +13,7 @@
(function() { (function() {
var ball = null; var ball = null;
var collisionSoundURL = "http://hifi-production.s3.amazonaws.com/tutorials/golfClub/collision1.wav"; var collisionSoundURL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/golfClub/collision1.wav";
var triggerState = false; var triggerState = false;
var BALL_GRAVITY = -9.8; var BALL_GRAVITY = -9.8;
var BALL_START_VELOCITY = 0.1; var BALL_START_VELOCITY = 0.1;

View file

@ -12,7 +12,7 @@
(function() { (function() {
var _this = this; var _this = this;
var SHOOTING_SOUND_URL = 'http://hifi-production.s3.amazonaws.com/tutorials/pingPongGun/pong_sound.wav'; var SHOOTING_SOUND_URL = 'https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pingPongGun/pong_sound.wav';
function PingPongGun() { function PingPongGun() {
return; return;

View file

@ -30,8 +30,8 @@
this.forceMultiplier = 1; this.forceMultiplier = 1;
this.laserLength = 100; this.laserLength = 100;
this.fireSound = SoundCache.getSound("http://hifi-production.s3.amazonaws.com/tutorials/pistol/GUN-SHOT2.raw"); this.fireSound = SoundCache.getSound("https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pistol/GUN-SHOT2.raw");
this.ricochetSound = SoundCache.getSound("http://hifi-production.s3.amazonaws.com/tutorials/pistol/Ricochet.L.wav"); this.ricochetSound = SoundCache.getSound("https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pistol/Ricochet.L.wav");
this.playRichochetSoundChance = 0.1; this.playRichochetSoundChance = 0.1;
this.fireVolume = 0.2; this.fireVolume = 0.2;
this.bulletForce = 10; this.bulletForce = 10;
@ -220,7 +220,7 @@
"alphaStart": 0, "alphaStart": 0,
"alphaFinish": 0, "alphaFinish": 0,
"additiveBlending": true, "additiveBlending": true,
"textures": "http://hifi-production.s3.amazonaws.com/tutorials/pistol/star.png" "textures": "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pistol/star.png"
}); });
Script.setTimeout(function() { Script.setTimeout(function() {
@ -270,7 +270,7 @@
"alphaStart": 0, "alphaStart": 0,
"alphaFinish": 0, "alphaFinish": 0,
"additiveBlending": 0, "additiveBlending": 0,
"textures": "http://hifi-production.s3.amazonaws.com/tutorials/pistol/smoke.png" "textures": "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pistol/smoke.png"
}); });
Script.setTimeout(function() { Script.setTimeout(function() {
Entities.editEntity(smoke, { Entities.editEntity(smoke, {
@ -333,7 +333,7 @@
"alphaStart": 0, "alphaStart": 0,
"alphaFinish": 0, "alphaFinish": 0,
"additiveBlending": true, "additiveBlending": true,
"textures": "http://hifi-production.s3.amazonaws.com/tutorials/pistol/star.png" "textures": "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/pistol/star.png"
}); });
Script.setTimeout(function() { Script.setTimeout(function() {
Entities.editEntity(flash, { Entities.editEntity(flash, {

View file

@ -8,7 +8,7 @@
(function(){ (function(){
var soundURL ='http://hifi-production.s3.amazonaws.com/tutorials/soundMaker/bell.wav'; var soundURL ='https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/soundMaker/bell.wav';
var ringSound; var ringSound;
this.preload = function(entityID) { this.preload = function(entityID) {

View file

@ -76,7 +76,7 @@ var particleProperties = {
alphaStart: 1, alphaStart: 1,
alphaFinish: 0, alphaFinish: 0,
emitterShouldTrail: true, emitterShouldTrail: true,
textures: 'http://hifi-production.s3.amazonaws.com/tutorials/particleFingers/smoke.png', textures: 'https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/particleFingers/smoke.png',
lifetime: 3600 lifetime: 3600
}; };

View file

@ -8,7 +8,7 @@
// //
// An animation of the avatar clapping its hands while standing // An animation of the avatar clapping its hands while standing
var ANIM_URL = "http://hifi-production.s3.amazonaws.com/tutorials/avatarAnimation/clap.fbx"; var ANIM_URL = "https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/avatarAnimation/clap.fbx";
// overrideRoleAnimation only replaces a single animation at a time. the rest of the motion is driven normally // overrideRoleAnimation only replaces a single animation at a time. the rest of the motion is driven normally
// @animationRole - name of animation // @animationRole - name of animation