Beispiel #1
0
	   m_pPhysicsShell->applyHit(pHDS->p_in_bone_space,pHDS->dir,pHDS->impulse,pHDS->boneID,pHDS->hit_type);
	
	if (!bWasAlive) return;

	if (pHDS->boneID==light_bone)
	    SetHealth ( 0.f );
	else
	{
		float damage = pHDS->damage() * 100.f;
		Msg("DEBUG: %s health = %.3f, damage = %.3f", Name_script(), GetHealth(), damage);
		SetHealth(GetHealth() - damage);
	}
	if (bWasAlive && (!Alive()))		TurnOff	();
}

static BONE_P_MAP bone_map=BONE_P_MAP();
void CHangingLamp::CreateBody(CSE_ALifeObjectHangingLamp	*lamp)
{
	if (!Visual())			return;
	if (m_pPhysicsShell)	return;
	
	CKinematics* pKinematics= smart_cast<CKinematics*>	(Visual());

	m_pPhysicsShell			= P_create_Shell();

	bone_map					.clear();
	LPCSTR	fixed_bones=*lamp->fixed_bones;
	if(fixed_bones){
		int count =					_GetItemCount(fixed_bones);
		for (int i=0 ;i<count; ++i){
			string64					fixed_bone							;
Beispiel #2
0
#include "ActorEffector.h"
#include "math.h"
#include "script_entity_action.h"
#include "inventory.h"
#include "xrserver_objects_alife_items.h"
#include "../Include/xrRender/Kinematics.h"
#include "level.h"
#include "ui/UIMainIngameWnd.h"
#include "CarWeapon.h"
#include "game_object_space.h"
#include "../xrEngine/gamemtllib.h"
//#include "PHActivationShape.h"
#include "CharacterPhysicsSupport.h"
#include "car_memory.h"
#include "../xrphysics/IPHWorld.h"
BONE_P_MAP CCar::bone_map=BONE_P_MAP();

//extern CPHWorld*	ph_world;

CCar::CCar()
{
	m_memory		= NULL;
	m_driver_anim_type = 0;
	m_bone_steer	= BI_NONE;
	active_camera	= 0;
	camera[ectFirst]= xr_new<CCameraFirstEye>	(this, CCameraBase::flRelativeLink|CCameraBase::flPositionRigid); 
	camera[ectFirst]->tag	= ectFirst;
	camera[ectFirst]->Load("car_firsteye_cam");

	camera[ectChase]= xr_new<CCameraLook>		(this,	CCameraBase::flRelativeLink); 
	camera[ectChase]->tag	= ectChase;