mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 02:48:12 +02:00
Merge pull request #6350 from imgntn/pongupdates
Add New Collision Hull and Collision Sound to Ping Pong Gun
This commit is contained in:
commit
4b684c0e63
3 changed files with 15 additions and 11 deletions
|
@ -14,8 +14,8 @@ Script.include("../../utilities.js");
|
||||||
var scriptURL = Script.resolvePath('pingPongGun.js');
|
var scriptURL = Script.resolvePath('pingPongGun.js');
|
||||||
|
|
||||||
var MODEL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun.fbx'
|
var MODEL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun.fbx'
|
||||||
var COLLISION_HULL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun_collision_hull.obj';
|
var COLLISION_HULL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun_convex.obj';
|
||||||
|
var COLLISION_SOUND_URL = 'http://hifi-public.s3.amazonaws.com/sounds/Collisions-otherorganic/plastic_impact.L.wav';
|
||||||
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,
|
||||||
|
@ -25,9 +25,8 @@ var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
|
||||||
var pingPongGun = Entities.addEntity({
|
var pingPongGun = Entities.addEntity({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: MODEL_URL,
|
modelURL: MODEL_URL,
|
||||||
shapeType:'box',
|
shapeType: 'compound',
|
||||||
// shapeType: 'compound',
|
compoundShapeURL: COLLISION_HULL_URL,
|
||||||
// compoundShapeURL: COLLISION_HULL_URL,
|
|
||||||
script: scriptURL,
|
script: scriptURL,
|
||||||
position: center,
|
position: center,
|
||||||
dimensions: {
|
dimensions: {
|
||||||
|
@ -36,6 +35,7 @@ var pingPongGun = Entities.addEntity({
|
||||||
z: 0.47
|
z: 0.47
|
||||||
},
|
},
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
|
collisionSoundURL: COLLISION_SOUND_URL
|
||||||
});
|
});
|
||||||
|
|
||||||
function cleanUp() {
|
function cleanUp() {
|
||||||
|
|
|
@ -887,8 +887,8 @@
|
||||||
|
|
||||||
function createPingPongBallGun() {
|
function createPingPongBallGun() {
|
||||||
var MODEL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun.fbx';
|
var MODEL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun.fbx';
|
||||||
var COLLISION_HULL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun_collision_hull.obj';
|
var COLLISION_HULL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun_convex.obj';
|
||||||
|
var COLLISION_SOUND_URL = 'http://hifi-public.s3.amazonaws.com/sounds/Collisions-otherorganic/plastic_impact.L.wav';
|
||||||
var position = {
|
var position = {
|
||||||
x: 548.6,
|
x: 548.6,
|
||||||
y: 495.4,
|
y: 495.4,
|
||||||
|
@ -900,7 +900,8 @@
|
||||||
var pingPongGun = Entities.addEntity({
|
var pingPongGun = Entities.addEntity({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: MODEL_URL,
|
modelURL: MODEL_URL,
|
||||||
shapeType: 'box',
|
shapeType: 'compound',
|
||||||
|
compoundShapeURL: COLLISION_SOUND_URL,
|
||||||
script: pingPongScriptURL,
|
script: pingPongScriptURL,
|
||||||
position: position,
|
position: position,
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
|
@ -915,6 +916,7 @@
|
||||||
z: 0.47
|
z: 0.47
|
||||||
},
|
},
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
|
collisionSoundURL: COLLISION_SOUND_URL,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
resetMe: {
|
resetMe: {
|
||||||
resetMe: true
|
resetMe: true
|
||||||
|
|
|
@ -869,8 +869,8 @@ MasterReset = function() {
|
||||||
|
|
||||||
function createPingPongBallGun() {
|
function createPingPongBallGun() {
|
||||||
var MODEL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun.fbx';
|
var MODEL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun.fbx';
|
||||||
var COLLISION_HULL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun_collision_hull.obj';
|
var COLLISION_HULL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun_convex.obj';
|
||||||
|
var COLLISION_SOUND_URL = 'http://hifi-public.s3.amazonaws.com/sounds/Collisions-otherorganic/plastic_impact.L.wav';
|
||||||
var position = {
|
var position = {
|
||||||
x: 548.6,
|
x: 548.6,
|
||||||
y: 495.4,
|
y: 495.4,
|
||||||
|
@ -882,7 +882,8 @@ MasterReset = function() {
|
||||||
var pingPongGun = Entities.addEntity({
|
var pingPongGun = Entities.addEntity({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: MODEL_URL,
|
modelURL: MODEL_URL,
|
||||||
shapeType: 'box',
|
shapeType: 'compound',
|
||||||
|
compoundShapeURL:COLLISION_SOUND_URL,
|
||||||
script: pingPongScriptURL,
|
script: pingPongScriptURL,
|
||||||
position: position,
|
position: position,
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
|
@ -897,6 +898,7 @@ MasterReset = function() {
|
||||||
z: 0.47
|
z: 0.47
|
||||||
},
|
},
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
|
collisionSoundURL: COLLISION_SOUND_URL,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
resetMe: {
|
resetMe: {
|
||||||
resetMe: true
|
resetMe: true
|
||||||
|
|
Loading…
Reference in a new issue