forum.boolean.name

forum.boolean.name (http://forum.boolean.name/index.php)
-   C++ (http://forum.boolean.name/forumdisplay.php?f=22)
-   -   Нужна помощь (http://forum.boolean.name/showthread.php?t=18562)

4yBa4Ok 23.09.2013 00:49

Нужна помощь
 
Никто не знает случайно где можно найти документацию\уроки\демки с кодом для PhysX 3.X? Облазил много всего, так и не смог найти.

jimon 23.09.2013 02:02

Ответ: Нужна помощь
 
https://developer.nvidia.com/physxapex-download-page
регистрируешься и скачиваешь

RegIon 08.12.2013 21:17

Ответ: Нужна помощь
 
Код:

float Vector::Length(Vector a,Vector b){
    return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}

float Vector::Length(){
  return sqrt((x)*(x)+(y)*(y)); 
}

float Vector::Dot(Vector a,Vector b){
    return a.x*b.x+a.y*b.y;
}

float Vector::Angle(Vector a,Vector b){
    if(a.Length()*b.Length()==0)
        return 0;
       
    float ang=acos(fabs(Vector::Dot(a,b))/(a.Length()*b.Length()));
    return ang;
}

Не правильно работает Vector::Angle
если вектора одинаковые, то дает -1.#, причем это из-за acosб в чем трабла?

pozitiffcat 10.12.2013 11:14

Ответ: Нужна помощь
 
Цитата:

Сообщение от RegIon (Сообщение 271178)
Код:

float Vector::Length(Vector a,Vector b){
    return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}

float Vector::Length(){
  return sqrt((x)*(x)+(y)*(y)); 
}

float Vector::Dot(Vector a,Vector b){
    return a.x*b.x+a.y*b.y;
}

float Vector::Angle(Vector a,Vector b){
    if(a.Length()*b.Length()==0)
        return 0;
       
    float ang=acos(fabs(Vector::Dot(a,b))/(a.Length()*b.Length()));
    return ang;
}

Не правильно работает Vector::Angle
если вектора одинаковые, то дает -1.#, причем это из-за acosб в чем трабла?

(a.Length()*b.Length()) не должно быть нулем


Часовой пояс GMT +4, время: 09:06.

vBulletin® Version 3.6.5.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot