User Tools

Site Tools


en:examples:physics:get_bodypart_count_on_object

Getting the BodyPart count on an Object

	//someObject defined elsewhere
 
	int count = 0;
 
	orxBODY *someBody = orxOBJECT_GET_STRUCTURE(someObject , BODY);
 
	orxBODY_PART *part = orxBody_GetNextPart(someBody, orxNULL);
	while (part != orxNULL){
		orxBODY_PART *nextPart = orxBody_GetNextPart(someBody, part);
 
		if (orxString_Compare(orxBody_GetPartName(part), "SomeBodyPart") == 0) {
			count++;
		}			
		part = nextPart;
	}
 
	return count;
en/examples/physics/get_bodypart_count_on_object.txt · Last modified: 2022/07/12 20:19 (2 years ago) by sausage