| 43 | addr[2] = sp_ftoc(vec.z); |
| 44 | |
| 45 | static cell_t GetVectorLength(IPluginContext *pContext, const cell_t *params) |
| 46 | { |
| 47 | cell_t *addr; |
| 48 | |
| 49 | pContext->LocalToPhysAddr(params[1], &addr); |
| 50 | |
| 51 | Vector source(sp_ctof(addr[0]), sp_ctof(addr[1]), sp_ctof(addr[2])); |
| 52 | |
| 53 | if (!params[2]) |
| 54 | { |
| 55 | return sp_ftoc(source.Length()); |
| 56 | } else { |
| 57 | return sp_ftoc(source.LengthSqr()); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | static cell_t GetVectorDistance(IPluginContext *pContext, const cell_t *params) |
| 62 | { |