MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / ASGetCollisionVertex

Function ASGetCollisionVertex

Source/Objects/envobject.cpp:2002–2016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2000}
2001
2002static vec3 ASGetCollisionVertex(EnvObject* eo, int index) {
2003 LOG_ASSERT(index >= 0);
2004 if (eo->GetCollisionModelID() == -1 || eo->ofr->no_collision) {
2005 return vec3(0.0);
2006 } else {
2007 Model* model = &Models::Instance()->GetModel(eo->GetCollisionModelID());
2008 if (!model || (int)model->faces.size() <= index) {
2009 return vec3(0.0);
2010 } else {
2011 vec3 vec;
2012 memcpy(&vec, &model->vertices[index * 3], sizeof(vec3));
2013 return vec;
2014 }
2015 }
2016}
2017
2018static int ASGetLedgeLine(EnvObject* eo, int index) {
2019 return eo->ledge_lines[index];

Callers

nothing calls this directly

Calls 4

GetCollisionModelIDMethod · 0.80
vec3Class · 0.50
GetModelMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected