mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:57:59 +02:00
Only render equip-hotspots for objects with attach points.
This commit is contained in:
parent
b21fbe5d99
commit
42068cf2dd
1 changed files with 13 additions and 19 deletions
|
@ -894,30 +894,24 @@ function MyController(hand) {
|
||||||
var grabData = getEntityCustomData(GRABBABLE_DATA_KEY, entities[i], undefined);
|
var grabData = getEntityCustomData(GRABBABLE_DATA_KEY, entities[i], undefined);
|
||||||
var grabProps = Entities.getEntityProperties(entities[i], GRABBABLE_PROPERTIES);
|
var grabProps = Entities.getEntityProperties(entities[i], GRABBABLE_PROPERTIES);
|
||||||
if (grabData) {
|
if (grabData) {
|
||||||
|
|
||||||
var hotspotPos = grabProps.position;
|
|
||||||
|
|
||||||
// does this entity have an attach point?
|
// does this entity have an attach point?
|
||||||
var wearableData = getEntityCustomData("wearable", entities[i], undefined);
|
var wearableData = getEntityCustomData("wearable", entities[i], undefined);
|
||||||
if (wearableData) {
|
if (wearableData && wearableData.joints) {
|
||||||
var handJointName = this.hand === RIGHT_HAND ? "RightHand" : "LeftHand";
|
var handJointName = this.hand === RIGHT_HAND ? "RightHand" : "LeftHand";
|
||||||
if (wearableData[handJointName]) {
|
if (wearableData.joints[handJointName]) {
|
||||||
// draw the hotspot around the attach point.
|
// draw the hotspot
|
||||||
hotspotPos = wearableData[handJointName][0];
|
this.equipHotspotOverlays.push(Overlays.addOverlay("sphere", {
|
||||||
|
position: grabProps.position,
|
||||||
|
size: 0.2,
|
||||||
|
color: { red: 90, green: 255, blue: 90 },
|
||||||
|
alpha: 0.7,
|
||||||
|
solid: true,
|
||||||
|
visible: true,
|
||||||
|
ignoreRayIntersection: false,
|
||||||
|
drawInFront: false
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw a hotspot!
|
|
||||||
this.equipHotspotOverlays.push(Overlays.addOverlay("sphere", {
|
|
||||||
position: hotspotPos,
|
|
||||||
size: 0.2,
|
|
||||||
color: { red: 90, green: 255, blue: 90 },
|
|
||||||
alpha: 0.7,
|
|
||||||
solid: true,
|
|
||||||
visible: true,
|
|
||||||
ignoreRayIntersection: false,
|
|
||||||
drawInFront: false
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue