StatsHelix / demoinfo

A library to analyze CS:GO demos in C#
MIT License
321 stars 78 forks source link

Calculating a player's bone positions #151

Open joshdixon opened 5 years ago

joshdixon commented 5 years ago

Hi, I was wondering how I could calculate a player's bone positions inside the parser and what properties I would need to do this. The only relevant thing I have found so far is m_nForceBone, but I'm not sure how I could use this in anyway.

Does anyone know how I can achieve this? Any help would be appreciated.

master117 commented 5 years ago

You have position, view direction and equipped gun. From these you can calculate the bones using a 3d model with the correct animation applied. I doubt that demos contain the information you seek.

joshdixon commented 5 years ago

Okay, thanks for your quick reply. since posting this i have found the vectors m_Collision.m_vecMaxs and m_Collision.m_vecMins which have worked pretty well for determining if an enemy player is visible by performing a raycast with the correct map BSP loaded

master117 commented 5 years ago

What do you use to apply the maps geometry in your calculations? How do you load the BSP?

joshdixon commented 5 years ago

Im using code from here: https://github.com/DarcPhansea/Darc-Euphoria/tree/master/Darc%20Euphoria/Euphoric/BspParsing

Vis-Viva commented 5 years ago

The issue of calculating who is visible to who is very relevant to my interests - did anything ever come of this for either of you? Any code you're willing to share?