allovince / physics_mathematics_skills_for_game_development Goto Github PK
View Code? Open in Web Editor NEW《游戏开发的数学和物理》配套示例代码
Home Page: http://www.ituring.com.cn/book/1373
《游戏开发的数学和物理》配套示例代码
Home Page: http://www.ituring.com.cn/book/1373
你好,最近在看你翻译的《游戏开发的数学和物理》一书,在书本101页最下面说 当矩形1的下端比矩形2的上端靠下......然而给出的代码确实
if ( ( prcRect1->fBottom > prcRect2->fTop ) &&
( prcRect1->fTop < prcRect2->fBottom ) )
{
nResult = true;
}
}
我认为这里应该是 (prcRect1->fBottom < prcRect2->fTop) && (prcRect1->fTop > prcRect2->fBottom)
此外我在另外一款开源游戏引擎里面看见判断2个矩形是否相交,给出的代码如下:
public boolean overlaps (Rectangle r) {
return x < r.x + r.width && x + width > r.x && y < r.y + r.height && y + height > r.y;
}
是否是我理解错了,如果是作者原著写错了,是否可以在github上先修改相应的代码
你好,我对第 1.5 章(P41)的 Box-Muller 算法存在以下疑问:
的 ( rand() + 1 ) / ( RAND_MAX + 1 )
这里:
√-2ln(a)
的 a 不应该是 (0, 1] 吗?
对于 log(x),需要把 [0, 1) 的随机数转换成 (0, 1],避免了 log(0) 的出现
感谢~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.