World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Структура stru141_actor_collision_object

#include <Indoor.h>

Открытые члены

int CalcMovementExtents (int a2)
 

Открытые атрибуты

int field_0
 
int prolly_normal_d
 
int field_8_radius
 
int height
 
int field_10
 
int field_14
 
int field_18
 
Vec3_int_ velocity
 
Vec3_int_ normal
 
Vec3_int_ position
 
Vec3_int_ normal2
 
int field_4C
 
int field_50
 
int field_54
 
Vec3_int_ direction
 
int speed
 
int inv_speed
 
int field_6C
 
int field_70
 
unsigned int uSectorID
 
unsigned int pid
 
int field_7C
 
int field_80
 
int field_84
 
int field_88
 
int sMaxX
 
int sMinX
 
int sMaxY
 
int sMinY
 
int sMaxZ
 
int sMinZ
 
int field_A4
 

Подробное описание

См. определение в файле Indoor.h строка 148

Методы

◆ CalcMovementExtents()

int stru141_actor_collision_object::CalcMovementExtents ( int  a2)

См. определение в файле Indoor.cpp строка 5697

5697  {
5698  int v7; // eax@1
5699  signed int result; // eax@4
5700  int v17; // eax@5
5701  int v18; // eax@7
5702  int v21; // eax@9
5703  int v22; // eax@11
5704 
5705  int speed = 1 | integer_sqrt(this->velocity.z * this->velocity.z +
5706  this->velocity.y * this->velocity.y +
5707  this->velocity.x * this->velocity.x);
5708 
5709  this->direction.x = 65536 / speed * this->velocity.x;
5710  this->direction.y = 65536 / speed * this->velocity.y;
5711  this->direction.z = 65536 / speed * this->velocity.z;
5712 
5713  this->speed = speed;
5714  this->inv_speed = 65536 / speed;
5715 
5716  if (dt)
5717  v7 = dt;
5718  else
5720 
5721  // v8 = fixpoint_mul(v7, speed) - this->field_70; // speed * dt - something
5722  this->field_6C = fixpoint_mul(v7, speed) - this->field_70;
5723  if (this->field_6C > 0) {
5724  // v10 = fixpoint_mul(v8, this->direction.x) + this->normal.x;
5725  this->field_4C =
5726  fixpoint_mul(this->field_6C, this->direction.x) + this->normal.x;
5727  this->normal2.x =
5728  fixpoint_mul(this->field_6C, this->direction.x) + this->normal.x;
5729  // v11 = fixpoint_mul(this->field_6C, this->direction.y) +
5730  // this->normal.y;
5731  this->field_50 =
5732  fixpoint_mul(this->field_6C, this->direction.y) + this->normal.y;
5733  this->normal2.y =
5734  fixpoint_mul(this->field_6C, this->direction.y) + this->normal.y;
5735  this->normal2.z =
5736  fixpoint_mul(this->field_6C, this->direction.z) + this->normal.z;
5737  // v12 = this->position.z;
5738  // v13 = this->normal.x;
5739  // v14 = this->normal2.x;
5740  // v15 = this->prolly_normal_d;
5741  // v16 = this->position.z + fixpoint_mul(this->field_6C,
5742  // this->direction.z); v28 = this->position.z +
5743  // fixpoint_mul(this->field_6C, this->direction.z);
5744  this->field_54 =
5745  this->position.z + fixpoint_mul(this->field_6C, this->direction.z);
5746  v17 = this->normal.x;
5747  if (v17 >= this->normal2.x) v17 = this->normal2.x;
5748  this->sMaxX = v17 - this->prolly_normal_d;
5749  v18 = this->prolly_normal_d + this->normal.x;
5750  if (this->normal.x <= this->normal2.x)
5751  v18 = this->prolly_normal_d + this->normal2.x;
5752  // v19 = this->normal.y;
5753  // v20 = this->normal2.y;
5754  this->sMinX = v18;
5755  v21 = this->normal.y;
5756  if (v21 >= this->normal2.y) v21 = this->normal2.y;
5757  this->sMaxY = v21 - this->prolly_normal_d;
5758  v22 = this->prolly_normal_d + this->normal.y;
5759  if (this->normal.y <= this->normal2.y)
5760  v22 = this->normal2.y + this->prolly_normal_d;
5761  // v23 = this->normal2.z;
5762  this->sMinY = v22;
5763  // v24 = this->normal.z;
5764  if (this->normal.z >= this->normal2.z)
5765  this->sMaxZ = this->normal2.z - this->prolly_normal_d;
5766  else
5767  this->sMaxZ = this->normal.z - this->prolly_normal_d;
5768  // this->sMaxZ = v25;
5769  // v26 = this->field_8_radius;
5770  if (this->position.z <=
5771  this->position.z + fixpoint_mul(this->field_6C, this->direction.z))
5772  this->sMinZ = (this->position.z +
5773  fixpoint_mul(this->field_6C, this->direction.z)) +
5774  this->field_8_radius;
5775  else
5776  this->sMinZ = this->position.z + this->field_8_radius;
5777  this->pid = 0;
5778  this->field_80 = -1;
5779  this->field_88 = -1;
5780  // this->sMinZ = v27;
5781  this->field_7C = 0xFFFFFFu;
5782  result = 0;
5783  } else {
5784  result = 1;
5785  }
5786  return result;
5787 }

Перекрестные ссылки direction, Timer::dt_in_some_format, field_4C, field_50, field_54, field_6C, field_70, field_7C, field_80, field_88, field_8_radius, fixpoint_mul(), integer_sqrt(), inv_speed, normal, normal2, pEventTimer, pid, position, prolly_normal_d, sMaxX, sMaxY, sMaxZ, sMinX, sMinY, sMinZ, speed и velocity.

Используется в BLV_ProcessPartyActions(), ODM_ProcessPartyActions(), UpdateActors_BLV(), UpdateActors_ODM(), SpriteObject::UpdateObject_fn0_BLV() и SpriteObject::UpdateObject_fn0_ODM().

+ Граф вызовов:
+ Граф вызова функции:

Данные класса

◆ field_0

◆ prolly_normal_d

◆ field_8_radius

◆ height

int stru141_actor_collision_object::height

◆ field_10

int stru141_actor_collision_object::field_10

См. определение в файле Indoor.h строка 155

◆ field_14

int stru141_actor_collision_object::field_14

См. определение в файле Indoor.h строка 156

◆ field_18

int stru141_actor_collision_object::field_18

См. определение в файле Indoor.h строка 157

◆ velocity

Vec3_int_ stru141_actor_collision_object::velocity

◆ normal

◆ position

◆ normal2

◆ field_4C

int stru141_actor_collision_object::field_4C

См. определение в файле Indoor.h строка 162

Используется в _46E44E_collide_against_faces_and_portals(), _46E889_collide_against_bmodels() и CalcMovementExtents().

◆ field_50

int stru141_actor_collision_object::field_50

См. определение в файле Indoor.h строка 163

Используется в _46E44E_collide_against_faces_and_portals(), _46E889_collide_against_bmodels() и CalcMovementExtents().

◆ field_54

int stru141_actor_collision_object::field_54

См. определение в файле Indoor.h строка 164

Используется в _46E44E_collide_against_faces_and_portals(), _46E889_collide_against_bmodels() и CalcMovementExtents().

◆ direction

◆ speed

int stru141_actor_collision_object::speed

◆ inv_speed

int stru141_actor_collision_object::inv_speed

См. определение в файле Indoor.h строка 167

Используется в CalcMovementExtents().

◆ field_6C

◆ field_70

int stru141_actor_collision_object::field_70

◆ uSectorID

◆ pid

◆ field_7C

◆ field_80

int stru141_actor_collision_object::field_80

См. определение в файле Indoor.h строка 173

Используется в _46F04E_collide_against_portals() и CalcMovementExtents().

◆ field_84

int stru141_actor_collision_object::field_84

◆ field_88

int stru141_actor_collision_object::field_88

См. определение в файле Indoor.h строка 175

Используется в CalcMovementExtents().

◆ sMaxX

◆ sMinX

◆ sMaxY

◆ sMinY

◆ sMaxZ

◆ sMinZ

◆ field_A4

int stru141_actor_collision_object::field_A4

См. определение в файле Indoor.h строка 182


Объявления и описания членов структур находятся в файлах:
stru141_actor_collision_object::field_50
int field_50
Definition: Indoor.h:163
stru141_actor_collision_object::field_88
int field_88
Definition: Indoor.h:175
stru141_actor_collision_object::field_6C
int field_6C
Definition: Indoor.h:168
stru141_actor_collision_object::speed
int speed
Definition: Indoor.h:166
stru141_actor_collision_object::sMaxZ
int sMaxZ
Definition: Indoor.h:180
stru141_actor_collision_object::normal
Vec3_int_ normal
Definition: Indoor.h:159
stru141_actor_collision_object::inv_speed
int inv_speed
Definition: Indoor.h:167
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9435
stru141_actor_collision_object::field_8_radius
int field_8_radius
Definition: Indoor.h:153
stru141_actor_collision_object::sMinY
int sMinY
Definition: Indoor.h:179
stru141_actor_collision_object::normal2
Vec3_int_ normal2
Definition: Indoor.h:161
stru141_actor_collision_object::field_7C
int field_7C
Definition: Indoor.h:172
Timer::dt_in_some_format
int dt_in_some_format
Definition: Time.h:134
stru141_actor_collision_object::field_70
int field_70
Definition: Indoor.h:169
fixpoint_mul
__int64 fixpoint_mul(int a1, int a2)
Definition: OurMath.cpp:138
stru141_actor_collision_object::sMaxX
int sMaxX
Definition: Indoor.h:176
stru141_actor_collision_object::sMinX
int sMinX
Definition: Indoor.h:177
stru141_actor_collision_object::sMaxY
int sMaxY
Definition: Indoor.h:178
stru141_actor_collision_object::prolly_normal_d
int prolly_normal_d
Definition: Indoor.h:152
integer_sqrt
int integer_sqrt(int val)
Definition: OurMath.cpp:164
stru141_actor_collision_object::field_54
int field_54
Definition: Indoor.h:164
stru141_actor_collision_object::field_80
int field_80
Definition: Indoor.h:173
stru141_actor_collision_object::direction
Vec3_int_ direction
Definition: Indoor.h:165
stru141_actor_collision_object::field_4C
int field_4C
Definition: Indoor.h:162
stru141_actor_collision_object::position
Vec3_int_ position
Definition: Indoor.h:160
stru141_actor_collision_object::velocity
Vec3_int_ velocity
Definition: Indoor.h:158
pEventTimer
Timer * pEventTimer
Definition: Time.cpp:8
stru141_actor_collision_object::pid
unsigned int pid
Definition: Indoor.h:171
stru141_actor_collision_object::sMinZ
int sMinZ
Definition: Indoor.h:181