Giter Club home page Giter Club logo

physics_mathematics_skills_for_game_development's People

Contributors

allovince avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

physics_mathematics_skills_for_game_development's Issues

长方形物体间的碰撞检测 code error

你好,最近在看你翻译的《游戏开发的数学和物理》一书,在书本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 算法

你好,我对第 1.5 章(P41)的 Box-Muller 算法存在以下疑问:

fRand_r = sqrtf( -2.0f * logf( ( float )( rand() + 1 ) / ( RAND_MAX + 1 ) ) ); // √-2ln(a)

( rand() + 1 ) / ( RAND_MAX + 1 ) 这里:

  1. rand() 返回 [0, 1),RAND_MAX 为 1,那么得到结果就不是 [0, 1) 的随机数,而是 [0.5, 1) 区间的随机数。

√-2ln(a) 的 a 不应该是 (0, 1] 吗?

对于 log(x),需要把 [0, 1) 的随机数转换成 (0, 1],避免了 log(0) 的出现

感谢~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.