mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:38:02 +02:00
have breakdance entity script use the model and location of the entity
This commit is contained in:
parent
66bd59b142
commit
10585a1b30
2 changed files with 13 additions and 6 deletions
|
@ -49,7 +49,8 @@
|
||||||
if (!_this.beingGrabbed) {
|
if (!_this.beingGrabbed) {
|
||||||
// remember we're being grabbed so we can detect being released
|
// remember we're being grabbed so we can detect being released
|
||||||
_this.beingGrabbed = true;
|
_this.beingGrabbed = true;
|
||||||
breakdanceStart();
|
var props = Entities.getEntityProperties(entityID);
|
||||||
|
breakdanceStart(props.modelURL, props.position);
|
||||||
print("I'm was grabbed...");
|
print("I'm was grabbed...");
|
||||||
} else {
|
} else {
|
||||||
breakdanceUpdate();
|
breakdanceUpdate();
|
||||||
|
|
|
@ -358,13 +358,19 @@ var NATURAL_DIMENSIONS = { x: 1.63, y: 1.67, z: 0.31 };
|
||||||
var DIMENSIONS = Vec3.multiply(NATURAL_DIMENSIONS, 0.3);
|
var DIMENSIONS = Vec3.multiply(NATURAL_DIMENSIONS, 0.3);
|
||||||
var puppetEntityID;
|
var puppetEntityID;
|
||||||
|
|
||||||
function createPuppet() {
|
function createPuppet(model, location) {
|
||||||
|
if (model === undefined) {
|
||||||
|
model = "https://hifi-public.s3.amazonaws.com/models/Bboys/bboy1/bboy1.fbx";
|
||||||
|
}
|
||||||
|
if (location == undefined) {
|
||||||
|
location = getPositionPuppet();
|
||||||
|
}
|
||||||
puppetEntityID = Entities.addEntity({
|
puppetEntityID = Entities.addEntity({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: "https://hifi-public.s3.amazonaws.com/models/Bboys/bboy1/bboy1.fbx",
|
modelURL: model,
|
||||||
animationURL: "http://s3.amazonaws.com/hifi-public/animations/Breakdancing/breakdance_ready.fbx",
|
animationURL: "http://s3.amazonaws.com/hifi-public/animations/Breakdancing/breakdance_ready.fbx",
|
||||||
animationSettings: ANIMATION_SETTINGS,
|
animationSettings: ANIMATION_SETTINGS,
|
||||||
position: getPositionPuppet(),
|
position: location,
|
||||||
ignoreForCollisions: true,
|
ignoreForCollisions: true,
|
||||||
dimensions: DIMENSIONS,
|
dimensions: DIMENSIONS,
|
||||||
lifetime: TEMPORARY_LIFETIME
|
lifetime: TEMPORARY_LIFETIME
|
||||||
|
@ -452,10 +458,10 @@ poses[LEFT_SIDE + RIGHT_FRONT ] = { name: "Left Side + Right Front",
|
||||||
poses[LEFT_FRONT + RIGHT_FRONT ] = { name: "Left Front + Right Front", animation: "http://s3.amazonaws.com/hifi-public/animations/Breakdancing/breakdance_uprock_var_1_end.fbx" };
|
poses[LEFT_FRONT + RIGHT_FRONT ] = { name: "Left Front + Right Front", animation: "http://s3.amazonaws.com/hifi-public/animations/Breakdancing/breakdance_uprock_var_1_end.fbx" };
|
||||||
|
|
||||||
|
|
||||||
breakdanceStart = function() {
|
breakdanceStart = function(model, location) {
|
||||||
print("breakdanceStart...");
|
print("breakdanceStart...");
|
||||||
createOverlays();
|
createOverlays();
|
||||||
createPuppet();
|
createPuppet(model, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
breakdanceUpdate = function(deltaTime) {
|
breakdanceUpdate = function(deltaTime) {
|
||||||
|
|
Loading…
Reference in a new issue