mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:47:30 +02:00
namechange ignoreForCollisions --> collisionless
This commit is contained in:
parent
fca5b29e6f
commit
7fb145e819
33 changed files with 87 additions and 84 deletions
|
@ -76,7 +76,7 @@ var RainSquall = function (properties) {
|
||||||
velocity: { x: 0, y: -dropFallSpeed, z: 0 },
|
velocity: { x: 0, y: -dropFallSpeed, z: 0 },
|
||||||
damping: 0,
|
damping: 0,
|
||||||
angularDamping: 0,
|
angularDamping: 0,
|
||||||
ignoreForCollisions: true
|
collisionless: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -409,7 +409,7 @@ function createPuppet(model, location) {
|
||||||
registrationPoint: { x: 0.5, y: 0, z: 0.5 },
|
registrationPoint: { x: 0.5, y: 0, z: 0.5 },
|
||||||
animation: ANIMATION_SETTINGS,
|
animation: ANIMATION_SETTINGS,
|
||||||
position: location,
|
position: location,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
dimensions: DIMENSIONS,
|
dimensions: DIMENSIONS,
|
||||||
lifetime: TEMPORARY_LIFETIME
|
lifetime: TEMPORARY_LIFETIME
|
||||||
});
|
});
|
||||||
|
@ -595,4 +595,4 @@ breakdanceEnd= function() {
|
||||||
Overlays.deleteOverlay(rightFrontOverlay);
|
Overlays.deleteOverlay(rightFrontOverlay);
|
||||||
|
|
||||||
Entities.deleteEntity(puppetEntityID);
|
Entities.deleteEntity(puppetEntityID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ function createQuakeMarker(earthquake) {
|
||||||
parentID:earth,
|
parentID:earth,
|
||||||
dimensions: QUAKE_MARKER_DIMENSIONS,
|
dimensions: QUAKE_MARKER_DIMENSIONS,
|
||||||
position: getQuakePosition(earthquake),
|
position: getQuakePosition(earthquake),
|
||||||
ignoreForCollisions:true,
|
collisionless:true,
|
||||||
lifetime: 6000,
|
lifetime: 6000,
|
||||||
color: getQuakeMarkerColor(earthquake)
|
color: getQuakeMarkerColor(earthquake)
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ Script.setInterval(function() {
|
||||||
var grabData = userData["grabKey"]
|
var grabData = userData["grabKey"]
|
||||||
|
|
||||||
// {"grabbableKey":{"invertSolidWhileHeld":true},
|
// {"grabbableKey":{"invertSolidWhileHeld":true},
|
||||||
// "grabKey":{"activated":true,"avatarId":"{6ea8b092-10e0-4058-888b-6facc40d0fe9}","refCount":1,"gravity":{"x":0,"y":0,"z":0},"ignoreForCollisions":0,"dynamic":1}
|
// "grabKey":{"activated":true,"avatarId":"{6ea8b092-10e0-4058-888b-6facc40d0fe9}","refCount":1,"gravity":{"x":0,"y":0,"z":0},"collisionless":0,"dynamic":1}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (typeof grabData != 'undefined') {
|
if (typeof grabData != 'undefined') {
|
||||||
|
|
|
@ -25,7 +25,7 @@ function createAvatarDetector() {
|
||||||
z: 1
|
z: 1
|
||||||
},
|
},
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
visible: false,
|
visible: false,
|
||||||
color: {
|
color: {
|
||||||
red: 255,
|
red: 255,
|
||||||
|
|
|
@ -91,7 +91,7 @@ var modelRatProperties = {
|
||||||
angularDamping: 0.99,
|
angularDamping: 0.99,
|
||||||
friction: 0.75,
|
friction: 0.75,
|
||||||
dynamic: true,
|
dynamic: true,
|
||||||
ignoreForCollisions: false,
|
collisionless: false,
|
||||||
gravity: {
|
gravity: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: -9.8,
|
y: -9.8,
|
||||||
|
@ -195,7 +195,7 @@ function addAvoiderBlock(position) {
|
||||||
},
|
},
|
||||||
position: position,
|
position: position,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
visible: false
|
visible: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,5 +19,5 @@ var recordAreaEntity = Entities.addEntity({
|
||||||
},
|
},
|
||||||
visible: true,
|
visible: true,
|
||||||
script: PARAMS_SCRIPT_URL,
|
script: PARAMS_SCRIPT_URL,
|
||||||
ignoreForCollision: true,
|
collisionless: true,
|
||||||
});
|
});
|
||||||
|
|
|
@ -54,10 +54,10 @@
|
||||||
preload: function (entityID) {
|
preload: function (entityID) {
|
||||||
print("RECORDING ENTITY PRELOAD");
|
print("RECORDING ENTITY PRELOAD");
|
||||||
this.entityID = entityID;
|
this.entityID = entityID;
|
||||||
|
|
||||||
var entityProperties = Entities.getEntityProperties(_this.entityID);
|
var entityProperties = Entities.getEntityProperties(_this.entityID);
|
||||||
if (!entityProperties.ignoreForCollisions) {
|
if (!entityProperties.collisionless) {
|
||||||
Entities.editEntity(_this.entityID, { ignoreForCollisions: true });
|
Entities.editEntity(_this.entityID, { collisionless: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
Messages.messageReceived.connect(receivingMessage);
|
Messages.messageReceived.connect(receivingMessage);
|
||||||
|
@ -117,4 +117,4 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return new recordingEntity();
|
return new recordingEntity();
|
||||||
});
|
});
|
||||||
|
|
|
@ -220,7 +220,7 @@
|
||||||
dimensions: COLOR_INDICATOR_DIMENSIONS,
|
dimensions: COLOR_INDICATOR_DIMENSIONS,
|
||||||
position: this.currentProperties.position,
|
position: this.currentProperties.position,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true
|
collisionless: true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.colorIndicator = Entities.addEntity(properties);
|
this.colorIndicator = Entities.addEntity(properties);
|
||||||
|
|
|
@ -82,7 +82,7 @@ function createColorBusterCube(row, column, vertical) {
|
||||||
type: 'Box',
|
type: 'Box',
|
||||||
dimensions: CUBE_DIMENSIONS,
|
dimensions: CUBE_DIMENSIONS,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: false,
|
collisionless: false,
|
||||||
color: startingColor[1],
|
color: startingColor[1],
|
||||||
position: position,
|
position: position,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
|
|
|
@ -254,7 +254,7 @@ PlankyStack = function() {
|
||||||
density: _this.options.density,
|
density: _this.options.density,
|
||||||
velocity: {x: 0, y: 0, z: 0},
|
velocity: {x: 0, y: 0, z: 0},
|
||||||
angularVelocity: Quat.fromPitchYawRollDegrees(0, 0, 0),
|
angularVelocity: Quat.fromPitchYawRollDegrees(0, 0, 0),
|
||||||
ignoreForCollisions: true
|
collisionless: true
|
||||||
};
|
};
|
||||||
_this.planks.forEach(function(plank, index, object) {
|
_this.planks.forEach(function(plank, index, object) {
|
||||||
if (plank.layer === layer && plank.row === row) {
|
if (plank.layer === layer && plank.row === row) {
|
||||||
|
@ -289,7 +289,7 @@ PlankyStack = function() {
|
||||||
}
|
}
|
||||||
if (!editMode) {
|
if (!editMode) {
|
||||||
_this.planks.forEach(function(plank, index, object) {
|
_this.planks.forEach(function(plank, index, object) {
|
||||||
Entities.editEntity(plank.entity, {ignoreForCollisions: false, dynamic: true});
|
Entities.editEntity(plank.entity, {collisionless: false, dynamic: true});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,7 +44,7 @@ ArcBall = function(spawnPosition) {
|
||||||
green: 10,
|
green: 10,
|
||||||
blue: 150
|
blue: 150
|
||||||
},
|
},
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
damping: 0.8,
|
damping: 0.8,
|
||||||
dynamic: true,
|
dynamic: true,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
|
|
|
@ -506,14 +506,14 @@ Grabber.prototype.activateEntity = function(entityID, grabbedProperties) {
|
||||||
data["activated"] = true;
|
data["activated"] = true;
|
||||||
data["avatarId"] = MyAvatar.sessionUUID;
|
data["avatarId"] = MyAvatar.sessionUUID;
|
||||||
data["refCount"] = data["refCount"] ? data["refCount"] + 1 : 1;
|
data["refCount"] = data["refCount"] ? data["refCount"] + 1 : 1;
|
||||||
// zero gravity and set ignoreForCollisions to true, but in a way that lets us put them back, after all grabs are done
|
// zero gravity and set collisionless to true, but in a way that lets us put them back, after all grabs are done
|
||||||
if (data["refCount"] == 1) {
|
if (data["refCount"] == 1) {
|
||||||
data["gravity"] = grabbedProperties.gravity;
|
data["gravity"] = grabbedProperties.gravity;
|
||||||
data["ignoreForCollisions"] = grabbedProperties.ignoreForCollisions;
|
data["collisionless"] = grabbedProperties.collisionless;
|
||||||
data["dynamic"] = grabbedProperties.dynamic;
|
data["dynamic"] = grabbedProperties.dynamic;
|
||||||
var whileHeldProperties = {gravity: {x:0, y:0, z:0}};
|
var whileHeldProperties = {gravity: {x:0, y:0, z:0}};
|
||||||
if (invertSolidWhileHeld) {
|
if (invertSolidWhileHeld) {
|
||||||
whileHeldProperties["ignoreForCollisions"] = ! grabbedProperties.ignoreForCollisions;
|
whileHeldProperties["collisionless"] = ! grabbedProperties.collisionless;
|
||||||
}
|
}
|
||||||
Entities.editEntity(entityID, whileHeldProperties);
|
Entities.editEntity(entityID, whileHeldProperties);
|
||||||
}
|
}
|
||||||
|
@ -527,7 +527,7 @@ Grabber.prototype.deactivateEntity = function(entityID) {
|
||||||
if (data["refCount"] < 1) {
|
if (data["refCount"] < 1) {
|
||||||
Entities.editEntity(entityID, {
|
Entities.editEntity(entityID, {
|
||||||
gravity: data["gravity"],
|
gravity: data["gravity"],
|
||||||
ignoreForCollisions: data["ignoreForCollisions"],
|
collisionless: data["collisionless"],
|
||||||
dynamic: data["dynamic"]
|
dynamic: data["dynamic"]
|
||||||
});
|
});
|
||||||
data = null;
|
data = null;
|
||||||
|
|
|
@ -26,7 +26,7 @@ ball = Entities.addEntity(
|
||||||
dimensions: { x: 0.1, y: 0.1, z: 0.1 },
|
dimensions: { x: 0.1, y: 0.1, z: 0.1 },
|
||||||
color: { red: 255, green: 0, blue: 255 },
|
color: { red: 255, green: 0, blue: 255 },
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true
|
collisionless: true
|
||||||
});
|
});
|
||||||
|
|
||||||
disc = Entities.addEntity(
|
disc = Entities.addEntity(
|
||||||
|
|
|
@ -261,7 +261,7 @@
|
||||||
var elAccelerationZ = document.getElementById("property-lacc-z");
|
var elAccelerationZ = document.getElementById("property-lacc-z");
|
||||||
|
|
||||||
var elDensity = document.getElementById("property-density");
|
var elDensity = document.getElementById("property-density");
|
||||||
var elIgnoreForCollisions = document.getElementById("property-ignore-for-collisions");
|
var elCollisionless = document.getElementById("property-collisionless");
|
||||||
var elDynamic = document.getElementById("property-dynamic" );
|
var elDynamic = document.getElementById("property-dynamic" );
|
||||||
var elCollisionSoundURL = document.getElementById("property-collision-sound-url");
|
var elCollisionSoundURL = document.getElementById("property-collision-sound-url");
|
||||||
var elLifetime = document.getElementById("property-lifetime");
|
var elLifetime = document.getElementById("property-lifetime");
|
||||||
|
@ -491,7 +491,7 @@
|
||||||
elAccelerationZ.value = properties.acceleration.z.toFixed(2);
|
elAccelerationZ.value = properties.acceleration.z.toFixed(2);
|
||||||
|
|
||||||
elDensity.value = properties.density.toFixed(2);
|
elDensity.value = properties.density.toFixed(2);
|
||||||
elIgnoreForCollisions.checked = properties.ignoreForCollisions;
|
elCollisionless.checked = properties.collisionless;
|
||||||
elDynamic.checked = properties.dynamic;
|
elDynamic.checked = properties.dynamic;
|
||||||
elCollisionSoundURL.value = properties.collisionSoundURL;
|
elCollisionSoundURL.value = properties.collisionSoundURL;
|
||||||
elLifetime.value = properties.lifetime;
|
elLifetime.value = properties.lifetime;
|
||||||
|
@ -718,7 +718,7 @@
|
||||||
elAccelerationZ.addEventListener('change', accelerationChangeFunction);
|
elAccelerationZ.addEventListener('change', accelerationChangeFunction);
|
||||||
|
|
||||||
elDensity.addEventListener('change', createEmitNumberPropertyUpdateFunction('density'));
|
elDensity.addEventListener('change', createEmitNumberPropertyUpdateFunction('density'));
|
||||||
elIgnoreForCollisions.addEventListener('change', createEmitCheckedPropertyUpdateFunction('ignoreForCollisions'));
|
elCollisionless.addEventListener('change', createEmitCheckedPropertyUpdateFunction('collisionless'));
|
||||||
elDynamic.addEventListener('change', createEmitCheckedPropertyUpdateFunction('dynamic'));
|
elDynamic.addEventListener('change', createEmitCheckedPropertyUpdateFunction('dynamic'));
|
||||||
elCollisionSoundURL.addEventListener('change', createEmitTextPropertyUpdateFunction('collisionSoundURL'));
|
elCollisionSoundURL.addEventListener('change', createEmitTextPropertyUpdateFunction('collisionSoundURL'));
|
||||||
|
|
||||||
|
@ -1235,9 +1235,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="property">
|
<div class="property">
|
||||||
<span class="label">Ignore For Collisions</span>
|
<span class="label">Collisionless</span>
|
||||||
<span class="value">
|
<span class="value">
|
||||||
<input type='checkbox' id="property-ignore-for-collisions">
|
<input type='checkbox' id="property-collisionless">
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ var leafSquall = function (properties) {
|
||||||
},
|
},
|
||||||
damping: 0,
|
damping: 0,
|
||||||
angularDamping: 0,
|
angularDamping: 0,
|
||||||
ignoreForCollisions: true
|
collisionless: true
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,7 +199,7 @@ EntityPropertyDialogBox = (function () {
|
||||||
index++;
|
index++;
|
||||||
array.push({ label: "Density:", value: properties.density.toFixed(decimals) });
|
array.push({ label: "Density:", value: properties.density.toFixed(decimals) });
|
||||||
index++;
|
index++;
|
||||||
array.push({ label: "Ignore for Collisions:", type: "checkbox", value: properties.ignoreForCollisions });
|
array.push({ label: "Collisionless:", type: "checkbox", value: properties.collisionless });
|
||||||
index++;
|
index++;
|
||||||
array.push({ label: "Dynamic:", type: "checkbox", value: properties.dynamic });
|
array.push({ label: "Dynamic:", type: "checkbox", value: properties.dynamic });
|
||||||
index++;
|
index++;
|
||||||
|
@ -412,7 +412,7 @@ EntityPropertyDialogBox = (function () {
|
||||||
|
|
||||||
index++; // skip header
|
index++; // skip header
|
||||||
properties.density = array[index++].value;
|
properties.density = array[index++].value;
|
||||||
properties.ignoreForCollisions = array[index++].value;
|
properties.collisionless = array[index++].value;
|
||||||
properties.dynamic = array[index++].value;
|
properties.dynamic = array[index++].value;
|
||||||
|
|
||||||
properties.lifetime = array[index++].value;
|
properties.lifetime = array[index++].value;
|
||||||
|
|
|
@ -228,7 +228,7 @@ entitySlider.prototype = {
|
||||||
name: 'Hifi-Slider-Axis::' + this.sliderType,
|
name: 'Hifi-Slider-Axis::' + this.sliderType,
|
||||||
color: this.color,
|
color: this.color,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
dimensions: {
|
dimensions: {
|
||||||
x: 3,
|
x: 3,
|
||||||
y: 3,
|
y: 3,
|
||||||
|
@ -251,7 +251,7 @@ entitySlider.prototype = {
|
||||||
name: 'Hifi-End-Of-Axis',
|
name: 'Hifi-End-Of-Axis',
|
||||||
type: 'Box',
|
type: 'Box',
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
dimensions: {
|
dimensions: {
|
||||||
x: 0.01,
|
x: 0.01,
|
||||||
y: 0.01,
|
y: 0.01,
|
||||||
|
@ -364,7 +364,7 @@ entitySlider.prototype = {
|
||||||
color: this.color,
|
color: this.color,
|
||||||
position: sliderPosition,
|
position: sliderPosition,
|
||||||
script: SLIDER_SCRIPT_URL,
|
script: SLIDER_SCRIPT_URL,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
lightModifierKey: {
|
lightModifierKey: {
|
||||||
lightID: this.lightID,
|
lightID: this.lightID,
|
||||||
|
@ -559,7 +559,7 @@ function createPanelEntity(position) {
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true
|
collisionless: true
|
||||||
}
|
}
|
||||||
|
|
||||||
var panel = Entities.addEntity(panelProperties);
|
var panel = Entities.addEntity(panelProperties);
|
||||||
|
@ -583,7 +583,7 @@ function createVisiblePanel() {
|
||||||
},
|
},
|
||||||
visible: true,
|
visible: true,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
position: moveDown,
|
position: moveDown,
|
||||||
rotation: avatarRot,
|
rotation: avatarRot,
|
||||||
script: VISIBLE_PANEL_SCRIPT_URL
|
script: VISIBLE_PANEL_SCRIPT_URL
|
||||||
|
@ -640,7 +640,7 @@ function createCloseButton(axisStart) {
|
||||||
rotation: Quat.multiply(avatarRot, Quat.fromPitchYawRollDegrees(90, 0, 45)),
|
rotation: Quat.multiply(avatarRot, Quat.fromPitchYawRollDegrees(90, 0, 45)),
|
||||||
//rotation: Quat.fromPitchYawRollDegrees(0, 0, 90),
|
//rotation: Quat.fromPitchYawRollDegrees(0, 0, 90),
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
script: CLOSE_BUTTON_SCRIPT_URL,
|
script: CLOSE_BUTTON_SCRIPT_URL,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
grabbableKey: {
|
grabbableKey: {
|
||||||
|
|
|
@ -65,7 +65,7 @@ var keysToIgnore = [
|
||||||
'registrationPoint',
|
'registrationPoint',
|
||||||
'angularVelocity',
|
'angularVelocity',
|
||||||
'angularDamping',
|
'angularDamping',
|
||||||
'ignoreForCollisions',
|
'collisionless',
|
||||||
'dynamic',
|
'dynamic',
|
||||||
'href',
|
'href',
|
||||||
'actionData',
|
'actionData',
|
||||||
|
|
|
@ -102,7 +102,7 @@ function createOrUpdateLine(event) {
|
||||||
sphereEntityID = Entities.addEntity({
|
sphereEntityID = Entities.addEntity({
|
||||||
type: "Sphere",
|
type: "Sphere",
|
||||||
position: intersection.intersection,
|
position: intersection.intersection,
|
||||||
ignoreForCollisions: 1,
|
collisionless: 1,
|
||||||
dimensions: { x: 0.6, y: 0.6, z: 0.6 },
|
dimensions: { x: 0.6, y: 0.6, z: 0.6 },
|
||||||
color: { red: 0, green: 255, blue: 0 },
|
color: { red: 0, green: 255, blue: 0 },
|
||||||
lifetime: 15 // if someone crashes while pointing, don't leave the line there forever.
|
lifetime: 15 // if someone crashes while pointing, don't leave the line there forever.
|
||||||
|
|
|
@ -48,7 +48,7 @@ var rack = Entities.addEntity({
|
||||||
z: 1.73
|
z: 1.73
|
||||||
},
|
},
|
||||||
dynamic: true,
|
dynamic: true,
|
||||||
ignoreForCollisions: false,
|
collisionless: false,
|
||||||
collisionSoundURL: collisionSoundURL,
|
collisionSoundURL: collisionSoundURL,
|
||||||
compoundShapeURL: rackCollisionHullURL,
|
compoundShapeURL: rackCollisionHullURL,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
|
@ -90,7 +90,7 @@ function createBalls() {
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
dynamic: true,
|
dynamic: true,
|
||||||
ignoreForCollisions: false,
|
collisionless: false,
|
||||||
modelURL: basketballURL,
|
modelURL: basketballURL,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
grabbableKey: {
|
grabbableKey: {
|
||||||
|
|
|
@ -235,7 +235,7 @@
|
||||||
dimensions: ARROW_DIMENSIONS,
|
dimensions: ARROW_DIMENSIONS,
|
||||||
position: this.bowProperties.position,
|
position: this.bowProperties.position,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
collisionSoundURL: ARROW_HIT_SOUND_URL,
|
collisionSoundURL: ARROW_HIT_SOUND_URL,
|
||||||
damping: 0.01,
|
damping: 0.01,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
|
@ -287,7 +287,7 @@
|
||||||
position: Vec3.sum(this.bowProperties.position, TOP_NOTCH_OFFSET),
|
position: Vec3.sum(this.bowProperties.position, TOP_NOTCH_OFFSET),
|
||||||
dimensions: LINE_DIMENSIONS,
|
dimensions: LINE_DIMENSIONS,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
grabbableKey: {
|
grabbableKey: {
|
||||||
grabbable: false
|
grabbable: false
|
||||||
|
@ -305,7 +305,7 @@
|
||||||
position: Vec3.sum(this.bowProperties.position, BOTTOM_NOTCH_OFFSET),
|
position: Vec3.sum(this.bowProperties.position, BOTTOM_NOTCH_OFFSET),
|
||||||
dimensions: LINE_DIMENSIONS,
|
dimensions: LINE_DIMENSIONS,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
grabbableKey: {
|
grabbableKey: {
|
||||||
grabbable: false
|
grabbable: false
|
||||||
|
@ -390,7 +390,7 @@
|
||||||
dimensions: LINE_DIMENSIONS,
|
dimensions: LINE_DIMENSIONS,
|
||||||
visible: true,
|
visible: true,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
grabbableKey: {
|
grabbableKey: {
|
||||||
grabbable: false
|
grabbable: false
|
||||||
|
@ -539,7 +539,7 @@
|
||||||
//make the arrow physical, give it gravity, a lifetime, and set our velocity
|
//make the arrow physical, give it gravity, a lifetime, and set our velocity
|
||||||
var arrowProperties = {
|
var arrowProperties = {
|
||||||
dynamic: true,
|
dynamic: true,
|
||||||
ignoreForCollisions: false,
|
collisionless: false,
|
||||||
collisionMask: "static,dynamic,otherAvatar", // workaround: not with kinematic --> no collision with bow
|
collisionMask: "static,dynamic,otherAvatar", // workaround: not with kinematic --> no collision with bow
|
||||||
velocity: releaseVelocity,
|
velocity: releaseVelocity,
|
||||||
gravity: ARROW_GRAVITY,
|
gravity: ARROW_GRAVITY,
|
||||||
|
|
|
@ -162,7 +162,7 @@
|
||||||
position: this.getWandTipPosition(properties),
|
position: this.getWandTipPosition(properties),
|
||||||
dimensions: BUBBLE_INITIAL_DIMENSIONS,
|
dimensions: BUBBLE_INITIAL_DIMENSIONS,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
damping: BUBBLE_LINEAR_DAMPING,
|
damping: BUBBLE_LINEAR_DAMPING,
|
||||||
shapeType: "sphere"
|
shapeType: "sphere"
|
||||||
});
|
});
|
||||||
|
|
|
@ -56,7 +56,7 @@ var targetIntervalClearer = Entities.addEntity({
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
visible: false,
|
visible: false,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
var targets = [];
|
var targets = [];
|
||||||
|
|
|
@ -153,7 +153,7 @@ var onTargetHit = function(targetEntity, projectileEntity, collision) {
|
||||||
});
|
});
|
||||||
// Attach arrow to target for the nice effect
|
// Attach arrow to target for the nice effect
|
||||||
Entities.editEntity(projectileEntity, {
|
Entities.editEntity(projectileEntity, {
|
||||||
ignoreForCollisions: true,
|
collisionless: true,
|
||||||
parentID: targetEntity
|
parentID: targetEntity
|
||||||
});
|
});
|
||||||
Entities.editEntity(targetEntity, {
|
Entities.editEntity(targetEntity, {
|
||||||
|
|
|
@ -63,7 +63,7 @@ EntityItem::EntityItem(const EntityItemID& entityItemID) :
|
||||||
_angularVelocity(ENTITY_ITEM_DEFAULT_ANGULAR_VELOCITY),
|
_angularVelocity(ENTITY_ITEM_DEFAULT_ANGULAR_VELOCITY),
|
||||||
_angularDamping(ENTITY_ITEM_DEFAULT_ANGULAR_DAMPING),
|
_angularDamping(ENTITY_ITEM_DEFAULT_ANGULAR_DAMPING),
|
||||||
_visible(ENTITY_ITEM_DEFAULT_VISIBLE),
|
_visible(ENTITY_ITEM_DEFAULT_VISIBLE),
|
||||||
_ignoreForCollisions(ENTITY_ITEM_DEFAULT_IGNORE_FOR_COLLISIONS),
|
_collisionless(ENTITY_ITEM_DEFAULT_COLLISIONLESS),
|
||||||
_collisionMask(ENTITY_COLLISION_MASK_DEFAULT),
|
_collisionMask(ENTITY_COLLISION_MASK_DEFAULT),
|
||||||
_dynamic(ENTITY_ITEM_DEFAULT_DYNAMIC),
|
_dynamic(ENTITY_ITEM_DEFAULT_DYNAMIC),
|
||||||
_locked(ENTITY_ITEM_DEFAULT_LOCKED),
|
_locked(ENTITY_ITEM_DEFAULT_LOCKED),
|
||||||
|
@ -123,7 +123,7 @@ EntityPropertyFlags EntityItem::getEntityProperties(EncodeBitstreamParams& param
|
||||||
requestedProperties += PROP_REGISTRATION_POINT;
|
requestedProperties += PROP_REGISTRATION_POINT;
|
||||||
requestedProperties += PROP_ANGULAR_DAMPING;
|
requestedProperties += PROP_ANGULAR_DAMPING;
|
||||||
requestedProperties += PROP_VISIBLE;
|
requestedProperties += PROP_VISIBLE;
|
||||||
requestedProperties += PROP_IGNORE_FOR_COLLISIONS;
|
requestedProperties += PROP_COLLISIONLESS;
|
||||||
requestedProperties += PROP_COLLISION_MASK;
|
requestedProperties += PROP_COLLISION_MASK;
|
||||||
requestedProperties += PROP_DYNAMIC;
|
requestedProperties += PROP_DYNAMIC;
|
||||||
requestedProperties += PROP_LOCKED;
|
requestedProperties += PROP_LOCKED;
|
||||||
|
@ -260,7 +260,7 @@ OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packet
|
||||||
APPEND_ENTITY_PROPERTY(PROP_REGISTRATION_POINT, getRegistrationPoint());
|
APPEND_ENTITY_PROPERTY(PROP_REGISTRATION_POINT, getRegistrationPoint());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, getAngularDamping());
|
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, getAngularDamping());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_VISIBLE, getVisible());
|
APPEND_ENTITY_PROPERTY(PROP_VISIBLE, getVisible());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_IGNORE_FOR_COLLISIONS, getIgnoreForCollisions());
|
APPEND_ENTITY_PROPERTY(PROP_COLLISIONLESS, getCollisionless());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_COLLISION_MASK, getCollisionMask());
|
APPEND_ENTITY_PROPERTY(PROP_COLLISION_MASK, getCollisionMask());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_DYNAMIC, getDynamic());
|
APPEND_ENTITY_PROPERTY(PROP_DYNAMIC, getDynamic());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_LOCKED, getLocked());
|
APPEND_ENTITY_PROPERTY(PROP_LOCKED, getLocked());
|
||||||
|
@ -680,7 +680,7 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
|
||||||
|
|
||||||
READ_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, float, updateAngularDamping);
|
READ_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, float, updateAngularDamping);
|
||||||
READ_ENTITY_PROPERTY(PROP_VISIBLE, bool, setVisible);
|
READ_ENTITY_PROPERTY(PROP_VISIBLE, bool, setVisible);
|
||||||
READ_ENTITY_PROPERTY(PROP_IGNORE_FOR_COLLISIONS, bool, updateIgnoreForCollisions);
|
READ_ENTITY_PROPERTY(PROP_COLLISIONLESS, bool, updateCollisionless);
|
||||||
READ_ENTITY_PROPERTY(PROP_COLLISION_MASK, uint8_t, updateCollisionMask);
|
READ_ENTITY_PROPERTY(PROP_COLLISION_MASK, uint8_t, updateCollisionMask);
|
||||||
READ_ENTITY_PROPERTY(PROP_DYNAMIC, bool, updateDynamic);
|
READ_ENTITY_PROPERTY(PROP_DYNAMIC, bool, updateDynamic);
|
||||||
READ_ENTITY_PROPERTY(PROP_LOCKED, bool, setLocked);
|
READ_ENTITY_PROPERTY(PROP_LOCKED, bool, setLocked);
|
||||||
|
@ -1044,7 +1044,7 @@ EntityItemProperties EntityItem::getProperties(EntityPropertyFlags desiredProper
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(glowLevel, getGlowLevel);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(glowLevel, getGlowLevel);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(localRenderAlpha, getLocalRenderAlpha);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(localRenderAlpha, getLocalRenderAlpha);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(visible, getVisible);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(visible, getVisible);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(ignoreForCollisions, getIgnoreForCollisions);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(collisionless, getCollisionless);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(collisionMask, getCollisionMask);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(collisionMask, getCollisionMask);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(dynamic, getDynamic);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(dynamic, getDynamic);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(locked, getLocked);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(locked, getLocked);
|
||||||
|
@ -1100,7 +1100,7 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(angularDamping, updateAngularDamping);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(angularDamping, updateAngularDamping);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(restitution, updateRestitution);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(restitution, updateRestitution);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(friction, updateFriction);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(friction, updateFriction);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(ignoreForCollisions, updateIgnoreForCollisions);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(collisionless, updateCollisionless);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(collisionMask, updateCollisionMask);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(collisionMask, updateCollisionMask);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(dynamic, updateDynamic);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(dynamic, updateDynamic);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(created, updateCreated);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(created, updateCreated);
|
||||||
|
@ -1444,9 +1444,9 @@ void EntityItem::updateAngularDamping(float value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityItem::updateIgnoreForCollisions(bool value) {
|
void EntityItem::updateCollisionless(bool value) {
|
||||||
if (_ignoreForCollisions != value) {
|
if (_collisionless != value) {
|
||||||
_ignoreForCollisions = value;
|
_collisionless = value;
|
||||||
_dirtyFlags |= Simulation::DIRTY_COLLISION_GROUP;
|
_dirtyFlags |= Simulation::DIRTY_COLLISION_GROUP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,11 +271,11 @@ public:
|
||||||
bool isVisible() const { return _visible; }
|
bool isVisible() const { return _visible; }
|
||||||
bool isInvisible() const { return !_visible; }
|
bool isInvisible() const { return !_visible; }
|
||||||
|
|
||||||
bool getIgnoreForCollisions() const { return _ignoreForCollisions; }
|
bool getCollisionless() const { return _collisionless; }
|
||||||
void setIgnoreForCollisions(bool value) { _ignoreForCollisions = value; }
|
void setCollisionless(bool value) { _collisionless = value; }
|
||||||
|
|
||||||
uint8_t getCollisionMask() const { return _collisionMask; }
|
uint8_t getCollisionMask() const { return _collisionMask; }
|
||||||
uint8_t getFinalCollisionMask() const { return _ignoreForCollisions ? 0 : _collisionMask; }
|
uint8_t getFinalCollisionMask() const { return _collisionless ? 0 : _collisionMask; }
|
||||||
void setCollisionMask(uint8_t value) { _collisionMask = value; }
|
void setCollisionMask(uint8_t value) { _collisionMask = value; }
|
||||||
|
|
||||||
bool getDynamic() const { return _dynamic; }
|
bool getDynamic() const { return _dynamic; }
|
||||||
|
@ -331,7 +331,7 @@ public:
|
||||||
void updateGravity(const glm::vec3& value);
|
void updateGravity(const glm::vec3& value);
|
||||||
void updateAngularVelocity(const glm::vec3& value);
|
void updateAngularVelocity(const glm::vec3& value);
|
||||||
void updateAngularDamping(float value);
|
void updateAngularDamping(float value);
|
||||||
void updateIgnoreForCollisions(bool value);
|
void updateCollisionless(bool value);
|
||||||
void updateCollisionMask(uint8_t value);
|
void updateCollisionMask(uint8_t value);
|
||||||
void updateDynamic(bool value);
|
void updateDynamic(bool value);
|
||||||
void updateLifetime(float value);
|
void updateLifetime(float value);
|
||||||
|
@ -445,7 +445,7 @@ protected:
|
||||||
glm::vec3 _angularVelocity;
|
glm::vec3 _angularVelocity;
|
||||||
float _angularDamping;
|
float _angularDamping;
|
||||||
bool _visible;
|
bool _visible;
|
||||||
bool _ignoreForCollisions;
|
bool _collisionless;
|
||||||
uint8_t _collisionMask { ENTITY_COLLISION_MASK_DEFAULT };
|
uint8_t _collisionMask { ENTITY_COLLISION_MASK_DEFAULT };
|
||||||
bool _dynamic;
|
bool _dynamic;
|
||||||
bool _locked;
|
bool _locked;
|
||||||
|
|
|
@ -255,7 +255,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
|
||||||
CHECK_PROPERTY_CHANGE(PROP_REGISTRATION_POINT, registrationPoint);
|
CHECK_PROPERTY_CHANGE(PROP_REGISTRATION_POINT, registrationPoint);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_ANGULAR_VELOCITY, angularVelocity);
|
CHECK_PROPERTY_CHANGE(PROP_ANGULAR_VELOCITY, angularVelocity);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_ANGULAR_DAMPING, angularDamping);
|
CHECK_PROPERTY_CHANGE(PROP_ANGULAR_DAMPING, angularDamping);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_IGNORE_FOR_COLLISIONS, ignoreForCollisions);
|
CHECK_PROPERTY_CHANGE(PROP_COLLISIONLESS, collisionless);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_COLLISION_MASK, collisionMask);
|
CHECK_PROPERTY_CHANGE(PROP_COLLISION_MASK, collisionMask);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_DYNAMIC, dynamic);
|
CHECK_PROPERTY_CHANGE(PROP_DYNAMIC, dynamic);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_IS_SPOTLIGHT, isSpotlight);
|
CHECK_PROPERTY_CHANGE(PROP_IS_SPOTLIGHT, isSpotlight);
|
||||||
|
@ -370,7 +370,8 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_ANGULAR_VELOCITY, angularVelocity);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_ANGULAR_VELOCITY, angularVelocity);
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_ANGULAR_DAMPING, angularDamping);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_ANGULAR_DAMPING, angularDamping);
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_VISIBLE, visible);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_VISIBLE, visible);
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_IGNORE_FOR_COLLISIONS, ignoreForCollisions);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_COLLISIONLESS, collisionless);
|
||||||
|
COPY_PROXY_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_COLLISIONLESS, collisionless, ignoreForCollisions, getCollisionless()); // legacy support
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_COLLISION_MASK, collisionMask, getCollisionMaskAsString());
|
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_COLLISION_MASK, collisionMask, getCollisionMaskAsString());
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_DYNAMIC, dynamic);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_DYNAMIC, dynamic);
|
||||||
COPY_PROXY_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_DYNAMIC, dynamic, collisionsWillMove, getDynamic()); // legacy support
|
COPY_PROXY_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_DYNAMIC, dynamic, collisionsWillMove, getDynamic()); // legacy support
|
||||||
|
@ -593,7 +594,8 @@ void EntityItemProperties::copyFromScriptValue(const QScriptValue& object, bool
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(compoundShapeURL, QString, setCompoundShapeURL);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(compoundShapeURL, QString, setCompoundShapeURL);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(glowLevel, float, setGlowLevel);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(glowLevel, float, setGlowLevel);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(localRenderAlpha, float, setLocalRenderAlpha);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(localRenderAlpha, float, setLocalRenderAlpha);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(ignoreForCollisions, bool, setIgnoreForCollisions);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(collisionless, bool, setCollisionless);
|
||||||
|
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(ignoreForCollisions, bool, setCollisionless, getCollisionless); // legacy support
|
||||||
COPY_PROPERTY_FROM_QSCRITPTVALUE_ENUM(collisionMask, CollisionMask);
|
COPY_PROPERTY_FROM_QSCRITPTVALUE_ENUM(collisionMask, CollisionMask);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(collisionsWillMove, bool, setDynamic, getDynamic); // legacy support
|
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(collisionsWillMove, bool, setDynamic, getDynamic); // legacy support
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(dynamic, bool, setDynamic);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(dynamic, bool, setDynamic);
|
||||||
|
@ -757,7 +759,8 @@ void EntityItemProperties::entityPropertyFlagsFromScriptValue(const QScriptValue
|
||||||
ADD_PROPERTY_TO_MAP(PROP_REGISTRATION_POINT, RegistrationPoint, registrationPoint, glm::vec3);
|
ADD_PROPERTY_TO_MAP(PROP_REGISTRATION_POINT, RegistrationPoint, registrationPoint, glm::vec3);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_ANGULAR_VELOCITY, AngularVelocity, angularVelocity, glm::vec3);
|
ADD_PROPERTY_TO_MAP(PROP_ANGULAR_VELOCITY, AngularVelocity, angularVelocity, glm::vec3);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_ANGULAR_DAMPING, AngularDamping, angularDamping, float);
|
ADD_PROPERTY_TO_MAP(PROP_ANGULAR_DAMPING, AngularDamping, angularDamping, float);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_IGNORE_FOR_COLLISIONS, IgnoreForCollisions, ignoreForCollisions, bool);
|
ADD_PROPERTY_TO_MAP(PROP_COLLISIONLESS, Collisionless, collisionless, bool);
|
||||||
|
ADD_PROPERTY_TO_MAP(PROP_DYNAMIC, unused, ignoreForCollisions, unused); // legacy support
|
||||||
ADD_PROPERTY_TO_MAP(PROP_COLLISION_MASK, CollisionMask, collisionMask, uint8_t);
|
ADD_PROPERTY_TO_MAP(PROP_COLLISION_MASK, CollisionMask, collisionMask, uint8_t);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_DYNAMIC, unused, collisionsWillMove, unused); // legacy support
|
ADD_PROPERTY_TO_MAP(PROP_DYNAMIC, unused, collisionsWillMove, unused); // legacy support
|
||||||
ADD_PROPERTY_TO_MAP(PROP_DYNAMIC, unused, dynamic, unused);
|
ADD_PROPERTY_TO_MAP(PROP_DYNAMIC, unused, dynamic, unused);
|
||||||
|
@ -1005,7 +1008,7 @@ bool EntityItemProperties::encodeEntityEditPacket(PacketType command, EntityItem
|
||||||
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_VELOCITY, properties.getAngularVelocity());
|
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_VELOCITY, properties.getAngularVelocity());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, properties.getAngularDamping());
|
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, properties.getAngularDamping());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_VISIBLE, properties.getVisible());
|
APPEND_ENTITY_PROPERTY(PROP_VISIBLE, properties.getVisible());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_IGNORE_FOR_COLLISIONS, properties.getIgnoreForCollisions());
|
APPEND_ENTITY_PROPERTY(PROP_COLLISIONLESS, properties.getCollisionless());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_COLLISION_MASK, properties.getCollisionMask());
|
APPEND_ENTITY_PROPERTY(PROP_COLLISION_MASK, properties.getCollisionMask());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_DYNAMIC, properties.getDynamic());
|
APPEND_ENTITY_PROPERTY(PROP_DYNAMIC, properties.getDynamic());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_LOCKED, properties.getLocked());
|
APPEND_ENTITY_PROPERTY(PROP_LOCKED, properties.getLocked());
|
||||||
|
@ -1298,7 +1301,7 @@ bool EntityItemProperties::decodeEntityEditPacket(const unsigned char* data, int
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_ANGULAR_VELOCITY, glm::vec3, setAngularVelocity);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_ANGULAR_VELOCITY, glm::vec3, setAngularVelocity);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_ANGULAR_DAMPING, float, setAngularDamping);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_ANGULAR_DAMPING, float, setAngularDamping);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_VISIBLE, bool, setVisible);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_VISIBLE, bool, setVisible);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_IGNORE_FOR_COLLISIONS, bool, setIgnoreForCollisions);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_COLLISIONLESS, bool, setCollisionless);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_COLLISION_MASK, uint8_t, setCollisionMask);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_COLLISION_MASK, uint8_t, setCollisionMask);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_DYNAMIC, bool, setDynamic);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_DYNAMIC, bool, setDynamic);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_LOCKED, bool, setLocked);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_LOCKED, bool, setLocked);
|
||||||
|
@ -1480,7 +1483,7 @@ void EntityItemProperties::markAllChanged() {
|
||||||
_glowLevelChanged = true;
|
_glowLevelChanged = true;
|
||||||
_localRenderAlphaChanged = true;
|
_localRenderAlphaChanged = true;
|
||||||
_isSpotlightChanged = true;
|
_isSpotlightChanged = true;
|
||||||
_ignoreForCollisionsChanged = true;
|
_collisionlessChanged = true;
|
||||||
_collisionMaskChanged = true;
|
_collisionMaskChanged = true;
|
||||||
_dynamicChanged = true;
|
_dynamicChanged = true;
|
||||||
|
|
||||||
|
@ -1600,7 +1603,7 @@ bool EntityItemProperties::hasTerseUpdateChanges() const {
|
||||||
bool EntityItemProperties::hasMiscPhysicsChanges() const {
|
bool EntityItemProperties::hasMiscPhysicsChanges() const {
|
||||||
return _gravityChanged || _dimensionsChanged || _densityChanged || _frictionChanged
|
return _gravityChanged || _dimensionsChanged || _densityChanged || _frictionChanged
|
||||||
|| _restitutionChanged || _dampingChanged || _angularDampingChanged || _registrationPointChanged ||
|
|| _restitutionChanged || _dampingChanged || _angularDampingChanged || _registrationPointChanged ||
|
||||||
_compoundShapeURLChanged || _dynamicChanged || _ignoreForCollisionsChanged || _collisionMaskChanged;
|
_compoundShapeURLChanged || _dynamicChanged || _collisionlessChanged || _collisionMaskChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityItemProperties::clearSimulationOwner() {
|
void EntityItemProperties::clearSimulationOwner() {
|
||||||
|
@ -1713,8 +1716,8 @@ QList<QString> EntityItemProperties::listChangedProperties() {
|
||||||
if (angularDampingChanged()) {
|
if (angularDampingChanged()) {
|
||||||
out += "angularDamping";
|
out += "angularDamping";
|
||||||
}
|
}
|
||||||
if (ignoreForCollisionsChanged()) {
|
if (collisionlessChanged()) {
|
||||||
out += "ignoreForCollisions";
|
out += "collisionless";
|
||||||
}
|
}
|
||||||
if (collisionMaskChanged()) {
|
if (collisionMaskChanged()) {
|
||||||
out += "collisionMask";
|
out += "collisionMask";
|
||||||
|
|
|
@ -127,7 +127,7 @@ public:
|
||||||
DEFINE_PROPERTY_REF(PROP_REGISTRATION_POINT, RegistrationPoint, registrationPoint, glm::vec3, ENTITY_ITEM_DEFAULT_REGISTRATION_POINT);
|
DEFINE_PROPERTY_REF(PROP_REGISTRATION_POINT, RegistrationPoint, registrationPoint, glm::vec3, ENTITY_ITEM_DEFAULT_REGISTRATION_POINT);
|
||||||
DEFINE_PROPERTY_REF(PROP_ANGULAR_VELOCITY, AngularVelocity, angularVelocity, glm::vec3, ENTITY_ITEM_DEFAULT_ANGULAR_VELOCITY);
|
DEFINE_PROPERTY_REF(PROP_ANGULAR_VELOCITY, AngularVelocity, angularVelocity, glm::vec3, ENTITY_ITEM_DEFAULT_ANGULAR_VELOCITY);
|
||||||
DEFINE_PROPERTY(PROP_ANGULAR_DAMPING, AngularDamping, angularDamping, float, ENTITY_ITEM_DEFAULT_ANGULAR_DAMPING);
|
DEFINE_PROPERTY(PROP_ANGULAR_DAMPING, AngularDamping, angularDamping, float, ENTITY_ITEM_DEFAULT_ANGULAR_DAMPING);
|
||||||
DEFINE_PROPERTY(PROP_IGNORE_FOR_COLLISIONS, IgnoreForCollisions, ignoreForCollisions, bool, ENTITY_ITEM_DEFAULT_IGNORE_FOR_COLLISIONS);
|
DEFINE_PROPERTY(PROP_COLLISIONLESS, Collisionless, collisionless, bool, ENTITY_ITEM_DEFAULT_COLLISIONLESS);
|
||||||
DEFINE_PROPERTY(PROP_COLLISION_MASK, CollisionMask, collisionMask, uint8_t, ENTITY_COLLISION_MASK_DEFAULT);
|
DEFINE_PROPERTY(PROP_COLLISION_MASK, CollisionMask, collisionMask, uint8_t, ENTITY_COLLISION_MASK_DEFAULT);
|
||||||
DEFINE_PROPERTY(PROP_DYNAMIC, Dynamic, dynamic, bool, ENTITY_ITEM_DEFAULT_DYNAMIC);
|
DEFINE_PROPERTY(PROP_DYNAMIC, Dynamic, dynamic, bool, ENTITY_ITEM_DEFAULT_DYNAMIC);
|
||||||
DEFINE_PROPERTY(PROP_IS_SPOTLIGHT, IsSpotlight, isSpotlight, bool, false);
|
DEFINE_PROPERTY(PROP_IS_SPOTLIGHT, IsSpotlight, isSpotlight, bool, false);
|
||||||
|
@ -355,7 +355,7 @@ inline QDebug operator<<(QDebug debug, const EntityItemProperties& properties) {
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, RegistrationPoint, registrationPoint, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, RegistrationPoint, registrationPoint, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, AngularVelocity, angularVelocity, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, AngularVelocity, angularVelocity, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, AngularDamping, angularDamping, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, AngularDamping, angularDamping, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, IgnoreForCollisions, ignoreForCollisions, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Collisionless, collisionless, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Dynamic, dynamic, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Dynamic, dynamic, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, IsSpotlight, isSpotlight, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, IsSpotlight, isSpotlight, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Intensity, intensity, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Intensity, intensity, "");
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#include <NumericalConstants.h>
|
#include <NumericalConstants.h>
|
||||||
|
|
||||||
// There is a minor performance gain when comparing/copying an existing glm::vec3 rather than
|
// There is a minor performance gain when comparing/copying an existing glm::vec3 rather than
|
||||||
// creating a new one on the stack so we declare the ZERO_VEC3 constant as an optimization.
|
// creating a new one on the stack so we declare the ZERO_VEC3 constant as an optimization.
|
||||||
const glm::vec3 ENTITY_ITEM_ZERO_VEC3 = glm::vec3(0.0f);
|
const glm::vec3 ENTITY_ITEM_ZERO_VEC3 = glm::vec3(0.0f);
|
||||||
const glm::vec3 ENTITY_ITEM_ONE_VEC3 = glm::vec3(1.0f);
|
const glm::vec3 ENTITY_ITEM_ONE_VEC3 = glm::vec3(1.0f);
|
||||||
|
@ -68,7 +68,7 @@ const float ENTITY_ITEM_MIN_FRICTION = 0.0f;
|
||||||
const float ENTITY_ITEM_MAX_FRICTION = 0.99f;
|
const float ENTITY_ITEM_MAX_FRICTION = 0.99f;
|
||||||
const float ENTITY_ITEM_DEFAULT_FRICTION = 0.5f;
|
const float ENTITY_ITEM_DEFAULT_FRICTION = 0.5f;
|
||||||
|
|
||||||
const bool ENTITY_ITEM_DEFAULT_IGNORE_FOR_COLLISIONS = false;
|
const bool ENTITY_ITEM_DEFAULT_COLLISIONLESS = false;
|
||||||
const bool ENTITY_ITEM_DEFAULT_DYNAMIC = false;
|
const bool ENTITY_ITEM_DEFAULT_DYNAMIC = false;
|
||||||
const bool ENTITY_ITEM_DEFAULT_BILLBOARDED = false;
|
const bool ENTITY_ITEM_DEFAULT_BILLBOARDED = false;
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ enum EntityPropertyList {
|
||||||
PROP_REGISTRATION_POINT,
|
PROP_REGISTRATION_POINT,
|
||||||
PROP_ANGULAR_VELOCITY,
|
PROP_ANGULAR_VELOCITY,
|
||||||
PROP_ANGULAR_DAMPING,
|
PROP_ANGULAR_DAMPING,
|
||||||
PROP_IGNORE_FOR_COLLISIONS,
|
PROP_COLLISIONLESS,
|
||||||
PROP_DYNAMIC,
|
PROP_DYNAMIC,
|
||||||
|
|
||||||
// property used by Light entity
|
// property used by Light entity
|
||||||
|
|
|
@ -722,15 +722,15 @@ void EntityTree::fixupTerseEditLogging(EntityItemProperties& properties, QList<Q
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (properties.ignoreForCollisionsChanged()) {
|
if (properties.collisionlessChanged()) {
|
||||||
int index = changedProperties.indexOf("ignoreForCollisions");
|
int index = changedProperties.indexOf("collisionless");
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
bool value = properties.getIgnoreForCollisions();
|
bool value = properties.getCollisionless();
|
||||||
QString changeHint = "0";
|
QString changeHint = "0";
|
||||||
if (value) {
|
if (value) {
|
||||||
changeHint = "1";
|
changeHint = "1";
|
||||||
}
|
}
|
||||||
changedProperties[index] = QString("ignoreForCollisions:") + changeHint;
|
changedProperties[index] = QString("collisionless:") + changeHint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -624,7 +624,7 @@ QString EntityMotionState::getName() const {
|
||||||
void EntityMotionState::computeCollisionGroupAndMask(int16_t& group, int16_t& mask) const {
|
void EntityMotionState::computeCollisionGroupAndMask(int16_t& group, int16_t& mask) const {
|
||||||
group = BULLET_COLLISION_GROUP_STATIC;
|
group = BULLET_COLLISION_GROUP_STATIC;
|
||||||
if (_entity) {
|
if (_entity) {
|
||||||
if (_entity->getIgnoreForCollisions()) {
|
if (_entity->getCollisionless()) {
|
||||||
group = BULLET_COLLISION_GROUP_COLLISIONLESS;
|
group = BULLET_COLLISION_GROUP_COLLISIONLESS;
|
||||||
}
|
}
|
||||||
switch (computePhysicsMotionType()){
|
switch (computePhysicsMotionType()){
|
||||||
|
|
Loading…
Reference in a new issue