-
This is Slide 1 Title
This is slide 1 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
-
This is Slide 2 Title
This is slide 2 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
-
This is Slide 3 Title
This is slide 3 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
2016년 2월 19일 금요일
게임-개발에-주로-사용되는-디자인-패턴
https://github.com/skatpgusskat/December/wiki/%EA%B2%8C%EC%9E%84-%EA%B0%9C%EB%B0%9C%EC%97%90-%EC%A3%BC%EB%A1%9C-%EC%82%AC%EC%9A%A9%EB%90%98%EB%8A%94-%EB%94%94%EC%9E%90%EC%9D%B8-%ED%8C%A8%ED%84%B4
조정훈, 게임 프로그래머를 위한 클래스 설계, NDC2012
http://www.slideshare.net/devcatpublications/ndc2012-12695564?related=1
2014년 12월 22일 월요일
2014년 10월 7일 화요일
두 박스 간의 겹침 % 계산하는 로직- 따온거임.
http://forum.ragezone.com/f144/total-overlapping-percent-2-rectangles-895041/
-func-
function rectCollisionPercentage(argRectA,argRectB){
/*
* argRectA = {x:0, y:0, r width:100, height:100};
* argRectB ={x:0, y:0, r width:100, height:100};
*/
var r1 = {
left:argRectA.x,
top:argRectA.y,
right:argRectA.x+argRectA.width-1,
bottom:argRectA.y+argRectA.height-1,
width:argRectA.width,
height:argRectA.height
};
var r2 = {
left:argRectB.x,
top:argRectB.y,
right:argRectB.x+argRectB.width-1,
bottom:argRectB.y+argRectB.height-1,
width:argRectB.width,
height:argRectB.height
};
// console.log(r1,r2);
var left = r1.left >= r2.left ? r1.left : r2.left;
var top = r1.top >= r2.top ? r1.top : r2.top;
var right = r1.right >= r2.right ? r2.right : r1.right;
var bottom = r1.bottom >= r2.bottom ? r2.bottom : r1.bottom
var overlapHeight = bottom - top;
var overlapWidth = right - left;
var r2Area = r2.height * r2.width;
var overlapArea = overlapHeight * overlapWidth;
var oPercent = (Math.round((overlapArea / r2Area ) * 100)) * 1.414;
console.log(oPercent);
return oPercent;
}
-use-
opatrans=rectCollisionPercentage(
{ x:boundOutBoxContainer.x,
y:boundOutBoxContainer.y,
width:mainAblumViewFlipper.getOutBoundWH().w,
height:mainAblumViewFlipper.getOutBoundWH().h } ,
{ x:( arg_newBitmapConteiner.x + ((vvAlbumList.container.getChildByName("vAlbumSubList").x)) ),
y:arg_newBitmapConteiner.y,
width:mainAblumViewFlipper.getInBoundBaseWH().w,
height:mainAblumViewFlipper.getInBoundBaseWH().h }
);
-func-
function rectCollisionPercentage(argRectA,argRectB){
/*
* argRectA = {x:0, y:0, r width:100, height:100};
* argRectB ={x:0, y:0, r width:100, height:100};
*/
var r1 = {
left:argRectA.x,
top:argRectA.y,
right:argRectA.x+argRectA.width-1,
bottom:argRectA.y+argRectA.height-1,
width:argRectA.width,
height:argRectA.height
};
var r2 = {
left:argRectB.x,
top:argRectB.y,
right:argRectB.x+argRectB.width-1,
bottom:argRectB.y+argRectB.height-1,
width:argRectB.width,
height:argRectB.height
};
// console.log(r1,r2);
var left = r1.left >= r2.left ? r1.left : r2.left;
var top = r1.top >= r2.top ? r1.top : r2.top;
var right = r1.right >= r2.right ? r2.right : r1.right;
var bottom = r1.bottom >= r2.bottom ? r2.bottom : r1.bottom
var overlapHeight = bottom - top;
var overlapWidth = right - left;
var r2Area = r2.height * r2.width;
var overlapArea = overlapHeight * overlapWidth;
var oPercent = (Math.round((overlapArea / r2Area ) * 100)) * 1.414;
console.log(oPercent);
return oPercent;
}
-use-
opatrans=rectCollisionPercentage(
{ x:boundOutBoxContainer.x,
y:boundOutBoxContainer.y,
width:mainAblumViewFlipper.getOutBoundWH().w,
height:mainAblumViewFlipper.getOutBoundWH().h } ,
{ x:( arg_newBitmapConteiner.x + ((vvAlbumList.container.getChildByName("vAlbumSubList").x)) ),
y:arg_newBitmapConteiner.y,
width:mainAblumViewFlipper.getInBoundBaseWH().w,
height:mainAblumViewFlipper.getInBoundBaseWH().h }
);