MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / PhysCastWalkRay

Function PhysCastWalkRay

physics/physics.cpp:1611–1650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1609}
1610
1611int PhysCastWalkRay(object *obj, vector *p0, vector *p1, vector *hitpnt, int *start_roomnum = NULL,
1612 int *end_roomnum = NULL, vector *hit_normal = NULL) {
1613 int fate;
1614
1615 fvi_info hit_info;
1616 fvi_query fq;
1617
1618 fq.p0 = p0;
1619 fq.p1 = p1;
1620
1621 if (start_roomnum)
1622 fq.startroom = *start_roomnum;
1623 else
1624 fq.startroom = obj->roomnum;
1625
1626 fq.rad = 0.0f;
1627 fq.flags = FQ_CHECK_OBJS | FQ_IGNORE_POWERUPS | FQ_IGNORE_WEAPONS | FQ_IGNORE_MOVING_OBJECTS |
1628 FQ_IGNORE_NON_LIGHTMAP_OBJECTS;
1629 if (!end_roomnum)
1630 fq.flags |= FQ_NO_RELINK;
1631
1632 fq.thisobjnum = OBJNUM(obj);
1633 fq.ignore_obj_list = NULL;
1634
1635 fate = fvi_FindIntersection(&fq, &hit_info);
1636 if (end_roomnum)
1637 *end_roomnum = hit_info.hit_room;
1638 if (hit_normal)
1639 *hit_normal = hit_info.hit_wallnorm[0];
1640
1641 if (fate == HIT_WALL) {
1642 if (GameTextures[Rooms[hit_info.hit_face_room[0]].faces[hit_info.hit_face[0]].tmap].flags &
1643 (TF_VOLATILE | TF_FORCEFIELD | TF_LAVA)) {
1644 return HIT_NONE;
1645 }
1646 }
1647
1648 *hitpnt = hit_info.hit_pnt;
1649 return fate;
1650}
1651
1652void PhysCalPntOnCPntPlane(object *obj, vector *s_pnt, vector *d_pnt, float *dist) {
1653 vector tpnt = *s_pnt - obj->pos;

Callers 1

Calls 1

fvi_FindIntersectionFunction · 0.85

Tested by

no test coverage detected