modified superpositions to get only one superposition by mapitem
This commit is contained in:
parent
6f5062b774
commit
ecc838abbb
@ -94,16 +94,19 @@ export default {
|
|||||||
superposition_ids: [],
|
superposition_ids: [],
|
||||||
clone: false,
|
clone: false,
|
||||||
}
|
}
|
||||||
// loop through superposistions couples
|
// loop through all superposistions couples
|
||||||
couple_ids.forEach(couple_id => {
|
couple_ids.forEach(couple_id => {
|
||||||
let cids = couple_id.match(/(\d+)-(\d+)/i);
|
let cids = couple_id.match(/(\d+)-(\d+)/i);
|
||||||
// console.log('cids', cids);
|
// console.log('cids', cids);
|
||||||
if (concernement.id === parseInt(cids[1]) || concernement.id === parseInt(cids[2])) {
|
if (concernement.id === parseInt(cids[1]) || concernement.id === parseInt(cids[2])) {
|
||||||
let i = 0;
|
let i = 0;
|
||||||
|
// loop through all superpositions of couple
|
||||||
for(let [superposition_id, superposition] of Object.entries(this.allSuperpositions_byid[couple_id])){
|
for(let [superposition_id, superposition] of Object.entries(this.allSuperpositions_byid[couple_id])){
|
||||||
i++;
|
i++;
|
||||||
if (i === 1) {
|
if (!mapitem.superposition_ids.length) {
|
||||||
|
// if main map item does not yet have a superposition use it and alter his id (for matter constraints)
|
||||||
mapitem.superposition_ids.push(superposition_id)
|
mapitem.superposition_ids.push(superposition_id)
|
||||||
|
mapitem.id = `${concernement.id}___${superposition_id}`
|
||||||
}else{
|
}else{
|
||||||
let mapitem_superposition = {
|
let mapitem_superposition = {
|
||||||
id: `${concernement.id}___${superposition_id}`,
|
id: `${concernement.id}___${superposition_id}`,
|
||||||
|
@ -522,7 +522,9 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// fadein intro
|
// fadein intro
|
||||||
|
if(!this.mapitem.clone){
|
||||||
this.paper_main_object.opacity = (1 + Math.random())*0.001;
|
this.paper_main_object.opacity = (1 + Math.random())*0.001;
|
||||||
|
}
|
||||||
|
|
||||||
// the sub items for one concernement
|
// the sub items for one concernement
|
||||||
this.paper_main_object.addChild(this.setPaperContour());
|
this.paper_main_object.addChild(this.setPaperContour());
|
||||||
@ -2142,11 +2144,13 @@ export default {
|
|||||||
this.paper_main_object.position = this.pos = this.body.position;
|
this.paper_main_object.position = this.pos = this.body.position;
|
||||||
|
|
||||||
// fadein intro
|
// fadein intro
|
||||||
|
if(!this.mapitem.clone){
|
||||||
if (this.paper_main_object.opacity < 9) {
|
if (this.paper_main_object.opacity < 9) {
|
||||||
this.paper_main_object.opacity = this.paper_main_object.opacity * 1.04;
|
this.paper_main_object.opacity = this.paper_main_object.opacity * 1.04;
|
||||||
} else{
|
} else{
|
||||||
this.paper_main_object.opacity = 1;
|
this.paper_main_object.opacity = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.handlePaperVisibilityOnAfterEnginUpdate()
|
this.handlePaperVisibilityOnAfterEnginUpdate()
|
||||||
|
|
||||||
|
@ -1139,13 +1139,13 @@ export default {
|
|||||||
|
|
||||||
// console.log('superposition', superposition_id, superposition);
|
// console.log('superposition', superposition_id, superposition);
|
||||||
let mapitemA_id, mapitemB_id;
|
let mapitemA_id, mapitemB_id;
|
||||||
if (i === 1) {
|
// if (i === 1) {
|
||||||
mapitemA_id = superposition[0].cid
|
// mapitemA_id = superposition[0].cid
|
||||||
mapitemB_id = superposition[1].cid
|
// mapitemB_id = superposition[1].cid
|
||||||
} else {
|
// } else {
|
||||||
mapitemA_id = `${superposition[0].cid}___${superposition_id}`
|
mapitemA_id = `${superposition[0].cid}___${superposition_id}`
|
||||||
mapitemB_id = `${superposition[1].cid}___${superposition_id}`
|
mapitemB_id = `${superposition[1].cid}___${superposition_id}`
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
// get the concernement matter bodies with id
|
// get the concernement matter bodies with id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user