(float[] p, int headnode,
float[] origin, float[] angles)
| 1027 | * entities ================== |
| 1028 | */ |
| 1029 | public int TransformedPointContents(float[] p, int headnode, |
| 1030 | float[] origin, float[] angles) { |
| 1031 | float[] p_l = { 0, 0, 0 }; |
| 1032 | float[] temp = { 0, 0, 0 }; |
| 1033 | float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 }, up = { 0, 0, 0 }; |
| 1034 | int l; |
| 1035 | |
| 1036 | // subtract origin offset |
| 1037 | Math3D.VectorSubtract(p, origin, p_l); |
| 1038 | |
| 1039 | // rotate start and end into the models frame of reference |
| 1040 | if (headnode != box_headnode |
| 1041 | && (angles[0] != 0 || angles[1] != 0 || angles[2] != 0)) { |
| 1042 | Math3D.AngleVectors(angles, forward, right, up); |
| 1043 | |
| 1044 | Math3D.VectorCopy(p_l, temp); |
| 1045 | p_l[0] = Math3D.DotProduct(temp, forward); |
| 1046 | p_l[1] = -Math3D.DotProduct(temp, right); |
| 1047 | p_l[2] = Math3D.DotProduct(temp, up); |
| 1048 | } |
| 1049 | |
| 1050 | l = CM_PointLeafnum_r(p_l, headnode); |
| 1051 | |
| 1052 | return map_leafs[l].contents; |
| 1053 | } |
| 1054 | |
| 1055 | /* |
| 1056 | * =============================================================================== |
no test coverage detected