

BMPPhysObj = {

	bNoImpuls=1,
	
	bBMPPhysObj=1,
	CanShoot = 1,	-- player can shoot from his veapon while driving this vehicle - 
			-- don't change action map to vehicle when entering

	fileModelDead = "Objects\Buildings\boat\wood_raft.cgf",
		
	
	userCounter = 0,
	driverWaiting = 0,
	driverDelay = 0,
	passengerLimit = 0,
	
	messageTime=0,
	
	-- previous state on the client before entering the vehicle
	bDriverInTheVehicle = 0,
	-- previous driver on the client before leaving the vehicle
	pPreviousDriver=nil,
	-- previous passenger state on the client before entering the vehicle
	bPassengerInTheVehicle = 0,
	-- previous passenger on the client before leaving the vehicle
	pPreviousPassenger=nil,

	IsPhisicalized = 0,	
	
	-- [kirill] vehicle gets different damage depending on who's shooter
	-- defines the intensity of the damage caused by the weapons to
	-- the vehicle	
	
	--
	DamageParams = {
		fDmgScaleAIBullet = 0.01,
		fDmgScaleAIExplosion = 0.7,
		fDmgScaleBullet = 0.01,
		fDmgScaleExplosion = 1.1,
	},
		
	--szNormalModel="objects/default.cgf",
	szNormalModel="Objects\Buildings\boat\wood_raft.cgf",

	PropertiesInstance = {
		sightrange = 180,
		soundrange = 10,	-- rememeber that sound ranges intersect and sound range for AI doubles when in alert
		aibehavior_behaviour = "Boat_idle",		
		groupid = 154,
	},

	Properties = {		
		bTrackable=1,

		--fileName = "objects/Vehicles/zodiacraft/zodiacraft.cgf",			
		fileName = "Objects\Buildings\boat\wood_raft.cgf",

		bUserPassanger = 0,
		bDrawDriver = 0,
		damping = 0.1,
		water_damping = 0,
		water_resistance = 0,
		fLimitLRAngles = 150,
		fLimitUDMinAngles = -45,
		fLimitUDMaxAngles = 40,
		max_time_step = 0.01,
		sleep_speed = 0.04,
		freefall_damping = 0.03,
		gravityz = -10.81,
		freefall_gravityz = -10.81,
		air_resistance = 5,
		accuracy= 0.01,
		water_density = 30,		
		Sleep_speed = 0.01,
		max_collision_impulse = 160,
		friction = 1,
		collision_impulse_scale = 1,
		explosion_scale = 0.2,
		impulse_scale = 0.2,
		Resting = false,
		
	},

	


	boat_params={
		Damprot	 	= 25,	--turning dump
		Dampv		= 30,	--movement dump
		Dampvs		= 100,	--
		Dampvh		= 100,	--
		Dampw		= 20,	--waves dump
		Turn		= 30,		
		--Speedv		= 5000,
		Speedv		= 500,		
		Speedturnmin	= 2,
		WaveM		= 500,	--fake waves momentum
		Stand		= 30,	-- forsing to normal vertical position impuls
		TiltTurn	= 5,	--tilt momentum when turning		
		
		TiltSpd		= 3,	--tilt momentum when speeding up
		TiltSpdA	= 0.06,	--tilt momentum when speeding up (acceleration thrhld)
		TiltSpdMinV	= 10.0,	--tilt momentum when speeding up (min speed to tilt when not accelerating)
		TiltSpdMinVTilt	= 0.37,	--tilt momentum when speeding up (how much to tilt when not accelerating)
		
		DownRate 	= 110,	
		BackUpRate 	= 900,
		BackUpSlowDwnRate=120.3,
		UpSpeedThrhld 	= 6,
		
		fMass 		= 50,
		bResting = 0,
		Flying		= 1,
	},


--	boat_params={
--		Damprot	 	= 25,	--turning dump		
--		Dampv		= 30,	--movement dump
--		Dampvs		= 100,	--
--		Dampvh		= 100,	--
--		Dampw		= 20,	--waves dump
--		Turn		= 60,				
--		--Speedv		= 5000,		
--		Speedv		= 200,		
--		Speedturnmin	= 2,
--		WaveM		= 500,	--fake waves momentum
--		Stand		= 30,	-- forsing to normal vertical position impuls
--		TiltTurn	= 15,	--tilt momentum when turning		
--		
--		TiltSpd		= 3,	--tilt momentum when speeding up
--		TiltSpdA	= 0.06,	--tilt momentum when speeding up (acceleration thrhld)
--		TiltSpdMinV	= 10.0,	--tilt momentum when speeding up (min speed to tilt when not accelerating)
--		TiltSpdMinVTilt	= 0.37,	--tilt momentum when speeding up (how much to tilt when not accelerating)
--		
--		fMass 		= 100,
--		Flying		= 1,
--	},


	
	sound_time = 0,
		
	bExploded=false,

	-- engine health, status of the vehicle
	-- default is set to maximum (1.0f)
	fEngineHealth = 1.0,

	-- damage inflicted to the vehicle when it collides
	fOnCollideDamage=0,

	-- damage inflicted to the vehicle when it collides with terrain (falls off)
	fOnCollideGroundDamage=3,

	bGroundVehicle=0,

	driverT = {
		type = PVS_DRIVER,	-- not to switch action map to "vehicle"
	
		helper = "driver",
		in_helper = "driver_sit_pos",
		sit_anim = "glider_driver_sit",	-- "vzsittingd",
		anchor = AIAnchor.AIANCHOR_BOATENTER_SPOT,
		out_ang = -90,
		timePast=0,
		HS=0,	-- used for fake jump arch calculatio - arch scale
		HK=0,	-- used for fake jump arch calculatio
		HO=0,	-- used for fake jump arch calculatio	
		HT=0,	-- used for fake jump arch calculatio
	},
}

VC.CreateVehicle(BMPPhysObj);

--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnReset()
	VC.OnResetCommon(self);

	self:NetPresent(1);

	VC.EveryoneOutForce(self);
	--VC.ReleaseDriver(self);
	--self:PassengerOut();

	self.fEngineHealth = 1.0;
	self.bExploded=false;
	self.cnt:SetVehicleEngineHealth(self.fEngineHealth);	
end
------------------------------------------------------------------------------------------------------
function BMPPhysObj:IsARigidBody()
	local qual=tonumber(getglobal("physics_quality"));
	
 	if qual>0 or self.Properties.Physics.LowSpec.bKeepRigidBody==1 then
		return self.Properties.Physics.bRigidBody;
	end
	
	return self.Properties.Physics.LowSpec.bRigidBody;
end

------------------------------------------------------------------------------------------------------
function BMPPhysObj:SetFromProperties()
	if (self.Properties.object_Model == "") then
		do return end;
	end
	local bPhysicalize = 1;
	if (self.ModelName ~= self.Properties.object_Model) then
		self.ModelName = self.Properties.object_Model;
		--bPhysicalize = 1;
		
		-- try to load an animated model first
		if (self:LoadCharacter(self.ModelName,0)) then
			-- Needs to be updated when visible
			self.bCharacter = 1;
			self:DrawCharacter(0,1);
		else
			-- Dont need to be updated.
			-- let's create either a rigid body or a normal static object
			self:LoadObject( self.ModelName,0,1 );
			self.bCharacter = 0;
			self:DrawObject(0,1); --param nPos(slot number), nMode(0 = Don't draw, 1 = Draw normally, 3 = Draw near)
		end
	end
	
	if (self.Properties.Animation.bPlaying ~= self.bAnimPlaying or self.Properties.Animation.bLoop ~= self.bAnimLoop or 
			self.Properties.Animation.Animation ~= self.AnimName) then
		self.bAnimPlaying = self.Properties.Animation.bPlaying;
		self.bAnimLoop = self.Properties.Animation.bLoop;
		self.AnimName = self.Properties.Animation.Animation;
		if (self.Properties.Animation.bPlaying == 1) then
			self:StartAnimation( 0,self.Properties.Animation.Animation,0,0,1,self.Properties.Animation.bLoop );			
		else
			self:ResetAnimation(0);
		end
	end
	self:SetAnimationSpeed( self.Properties.Animation.Speed )
	
	-- Set physics.
	self:SetPhysicsProperties( bPhysicalize,self.Properties.Physics.bRigidBodyActive );

	--self:EnablePhysics(1);
	
	self:SetSoundProperties();
	
	if (self.bCharacter == 1) then
		if (self:IsARigidBody() == 1) then
			-- Characters needs also to be updated when they are visible.
			self:SetUpdateType( eUT_PhysicsVisible );
		else
			self:SetUpdateType( eUT_Visible );
		end
	else
		if (self:IsARigidBody() == 1) then
			-- Rigid bodies needs only to be updated when physics awake.
			self:SetUpdateType( eUT_Physics );
		else
			-- Static objects should be updated depending on when update is enabled.
			self:SetUpdateType( eUT_Always );
		end
	end
	
	self:GotoState("Default");
end

------------------------------------------------------------------------------------------------------
function BMPPhysObj:SetSoundProperties()
	-- load sounds
	self.SplashSound=Sound:Load3DSound("sounds/player/water/watersplash.wav", 0, 255, 2, 50);

	if (self.Properties.sndAnimStart~="") then
		self.animsoundstart=Sound:Load3DSound(self.Properties.sndAnimStart, 0,255,1,10);
	end

	if (self.Properties.sndAnimStop~="") then
		self.animsoundstop=Sound:Load3DSound(self.Properties.sndAnimStop, 0,255,1,10);
	end
end

------------------------------------------------------------------------------------------------------
-- Set Physics parameters.
------------------------------------------------------------------------------------------------------
function BMPPhysObj:SetPhysicsProperties( bPhysicalize,bActivateRigidBody )
  local Mass,Density,qual;

	-- [marco] in multiplayer settings must be exactly the same
	-- on all machines
	if (Game:IsMultiplayer()) then
		qual=2;
	else
		qual = tonumber(getglobal("physics_quality"));
	end

  	if (qual>0 or self.Properties.Physics.LowSpec.bKeepMassAndWater==1) then
  	  	Mass    = self.Properties.Physics.Mass; 
  	  	Density = self.Properties.Physics.Density;
	else
	    Mass    = self.Properties.Physics.LowSpec.Mass; 
  		Density = self.Properties.Physics.LowSpec.Density;
	end
  
	if (self:IsARigidBody() == 1) then
		-- Make Rigid body.
		if (bPhysicalize==1) then
			self:CreateRigidBody( Density,Mass,-1 );
			if (self.bCharacter == 1) then
				self:PhysicalizeCharacter( Mass,0,0,0);
			end
		end

		local SimParams = {
			max_time_step = self.Properties.Physics.max_time_step,
			sleep_speed = self.Properties.Physics.sleep_speed,
			damping = self.Properties.Physics.damping,
			water_damping = self.Properties.Physics.water_damping,
			water_resistance = self.Properties.Physics.water_resistance,
			water_density = self.Properties.Physics.water_density,
			mass = Mass,
			density = Density
		};
		
		if qual==0 then
		  SimParams.max_time_step = self.Properties.Physics.LowSpec.max_time_step;
		  SimParams.sleep_speed = self.Properties.Physics.LowSpec.sleep_speed;
		  if (self.Properties.Physics.LowSpec.bKeepMassAndWater==0) then
		    SimParams.water_resistance = self.Properties.Physics.LowSpec.water_resistance;
			  SimParams.water_density = self.Properties.Physics.LowSpec.water_density;
		  end
		end
		
		self.bRigidBodyActive = bActivateRigidBody;
		if (bActivateRigidBody ~= 1) then
			-- If rigid body should not be activated, it must have 0 mass.
			SimParams.mass = 0;
			SimParams.density = 0;
		end

		local Flags = { flags_mask=pef_fixed_damping+ref_use_simple_solver, flags=0 };
		Flags.flags = self.Properties.Physics.bFixedDamping*pef_fixed_damping;
		if self.Properties.Physics.bUseSimpleSolver then
			Flags.flags = Flags.flags + self.Properties.Physics.bUseSimpleSolver*ref_use_simple_solver;
		end	
		
		self:SetPhysicParams(PHYSICPARAM_SIMULATION, SimParams );
		self:SetPhysicParams(PHYSICPARAM_BUOYANCY, self.Properties.Physics );
		self:SetPhysicParams(PHYSICPARAM_FLAGS, Flags );
		
		if (self.Properties.Physics.bResting == 0) then
			self:EnableUpdate(1);
			self:AwakePhysics(1);
		else
			self:EnableUpdate(0);
			self:AwakePhysics(0);
		end
		
	else
		-- Not rigid body, not character.
		-- Make simple static physics.
		if (bPhysicalize == 1) then
			self:CreateStaticEntity( self.Mass,-1 );
			if (self.bCharacter == 1) then
				self:PhysicalizeCharacter( Mass,0,0,0);
			end
		end
	end
	
	-- physics-sounds
	if (PhysicsSoundsTable) then
		local SoundDesc;
		-- load soft contact sounds
		self.ContactSounds_Soft={};
		if (PhysicsSoundsTable.Soft and PhysicsSoundsTable.Soft[self.Properties.Physics.Type]) then
			SoundDesc=PhysicsSoundsTable.Soft[self.Properties.Physics.Type].Impact;
			if (SoundDesc) then
				self.ContactSounds_Soft.Impact=Sound:Load3DSound(SoundDesc[1], SoundDesc[2], 255, SoundDesc[4], SoundDesc[5]);
				self.ContactSounds_Soft.ImpactVolume=SoundDesc[3];
			end
			SoundDesc=PhysicsSoundsTable.Soft[self.Properties.Physics.Type].Roll;
			if (SoundDesc) then
				self.ContactSounds_Soft.Roll=Sound:Load3DSound(SoundDesc[1], SoundDesc[2], 255, SoundDesc[4], SoundDesc[5]);
				self.ContactSounds_Soft.RollVolume=SoundDesc[3];
				Sound:SetSoundLoop(self.ContactSounds_Soft.Roll, 1);
			end
			SoundDesc=PhysicsSoundsTable.Soft[self.Properties.Physics.Type].Slide;
			if (SoundDesc) then
				self.ContactSounds_Soft.Slide=Sound:Load3DSound(SoundDesc[1], SoundDesc[2], 255, SoundDesc[4], SoundDesc[5]);
				self.ContactSounds_Soft.SlideVolume=SoundDesc[3];
				Sound:SetSoundLoop(self.ContactSounds_Soft.Slide, 1);
			end
		else
			--System:Log("[BMPPhysObj] Warning: Table *PhysicsSoundsTable.Soft* or *PhysicsSoundsTable.Soft["..self.Properties.Physics.Type.."]* no found !");
		end
		-- load hard contact sounds
		self.ContactSounds_Hard={};
		if (PhysicsSoundsTable.Hard and PhysicsSoundsTable.Hard[self.Properties.Physics.Type]) then
			SoundDesc=PhysicsSoundsTable.Hard[self.Properties.Physics.Type].Impact;
			if (SoundDesc) then
				self.ContactSounds_Hard.Impact=Sound:Load3DSound(SoundDesc[1], SoundDesc[2], 255, SoundDesc[4], SoundDesc[5]);
				self.ContactSounds_Hard.ImpactVolume=SoundDesc[3];
			end
			SoundDesc=PhysicsSoundsTable.Hard[self.Properties.Physics.Type].Roll;
			if (SoundDesc) then
				self.ContactSounds_Hard.Roll=Sound:Load3DSound(SoundDesc[1], SoundDesc[2], 255, SoundDesc[4], SoundDesc[5]);
				self.ContactSounds_Hard.RollVolume=SoundDesc[3];
				Sound:SetSoundLoop(self.ContactSounds_Hard.Roll, 1);
			end
			SoundDesc=PhysicsSoundsTable.Hard[self.Properties.Physics.Type].Slide;
			if (SoundDesc) then
				self.ContactSounds_Hard.Slide=Sound:Load3DSound(SoundDesc[1], SoundDesc[2], 255, SoundDesc[4], SoundDesc[5]);
				self.ContactSounds_Hard.SlideVolume=SoundDesc[3];
				Sound:SetSoundLoop(self.ContactSounds_Hard.Slide, 1);
			end
		else
			--System:Log("[BMPPhysObj] Warning: Table *PhysicsSoundsTable.Hard* or *PhysicsSoundsTable.Hard["..self.Properties.Physics.Type.."]* no found !");
		end
	else
		--System:Log("[BMPPhysObj] Warning: Table *PhysicsSoundsTable* no found !");
	end
end

------------------------------------------------------------------------------------------------------
--////////////////////////////////////////////////////////////////////////////////////////
--////////////////////////////////////////////////////////////////////////////////////////
--// CLIENT functions definitions
--////////////////////////////////////////////////////////////////////////////////////////
--////////////////////////////////////////////////////////////////////////////////////////
BMPPhysObj.Client = {
	OnInit = function(self)
		--System:Log("CLIENT BMPPhysObj onInit");
		self:OnInitClient();
	end,

	OnUpdate = function(self,dt)
		self:UpdateClient(dt);
	end,

	OnContact = function(self,player)
 		self:OnContactClient(player);
	end,

	OnDamage = function(self,hit)
		self:OnDamageClient(hit);
	end,

	--OnCollide = function(self,hit)
	--	self:OnCollide(hit);
	--end,
	
	OnBind = VC.OnBind,
        
        Dead = {
	},
	
	Inactive = {
	},
}

--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnInitClient()
	VC.InitSeats(self, BMPPhysObj);

	--// load sounds on client only 
	--////////////////////////////////////////////////////////////////////////////////////////
	
	--self.ExplosionSound=Sound:Load3DSound("sounds\\weapons\\explosions\\mbarrel.wav",0,0,7,100000);

	self.drive_sound = Sound:Load3DSound("sounds\\Ambient\\E3\\whistlewindLP.wav",0,175,7,1000);
	self.drive_sound_move = Sound:Load3DSound("sounds\\jungle\\silence.wav",0,0,7,100);

	self.accelerate_sound = {
		Sound:Load3DSound("sounds\\vehicle\\rev1.wav",0,0,7,100000),
		Sound:Load3DSound("sounds\\vehicle\\rev2.wav",0,0,7,100000),
		Sound:Load3DSound("sounds\\vehicle\\rev3.wav",0,0,7,100000),
		Sound:Load3DSound("sounds\\vehicle\\rev4.wav",0,0,7,100000),
	};

	self.break_sound = Sound:Load3DSound("sounds\\vehicle\\break1.wav",0,0,7,100000);
	self.engine_start = Sound:Load3DSound("sounds\\vehicle\\boat\\zod_start.wav",0,0,7,100000);
	self.engine_off = Sound:Load3DSound("sounds\\vehicle\\boat\\zod_off.wav",0,0,7,100000);
	self.sliding_sound = Sound:Load3DSound("sounds\\vehicle\\break2.wav",0,0,7,100000);

	self.crash_sound = Sound:Load3DSound("sounds\\vehicle\\boat\\rubber.wav",0,0,7,100000);

	-- init common stuff for client and server
	VC.InitBoatCommon(self,self.szNormalModel);

end

--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:UpdateClient(dt)

	VC.PlayEngineOnOffSounds(self);

	-- plays the sounds, using a timestep of 0.04 		

	self.sound_time = self.sound_time + dt;
	if ( self.sound_time > 0.04 ) then		
		
		-- reset timer
		self.sound_time = 0;

		-- get vehicle's velocity
		local fCarSpeed = self.cnt:GetVehicleVelocity();
		
		VC.PlayDrivingSounds(self,fCarSpeed);

	end

	if(self.messageTime<0) then
		self.messageTime = self.messageTime + dt;
		if(self.driverT.entity == _localplayer ) then
--			Hud.label = "press F1 to switch the view";			
		end	
	end
end

--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnContactClient( player )

	--VC.OnContactBoatClient(self,player);	
	VC.OnContactClientT(self,player);
end

--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:DoParticles(dt)

	--VC.CreateWaterParticles(self);

end


--////////////////////////////////////////////////////////////////////////////////////////
--////////////////////////////////////////////////////////////////////////////////////////
--// SERVER functions definitions
--////////////////////////////////////////////////////////////////////////////////////////
--////////////////////////////////////////////////////////////////////////////////////////
BMPPhysObj.Server = {
	OnInit = function(self)
		self:OnInitServer();
	end,

	OnContact = function(self,player)
 		self:OnContactServer(player);
	end,

	OnEvent = function (self, id, params)
		self:OnEventServer( id, params);
	end,

	OnUpdate = function(self,dt)
		self:UpdateServer(dt);
	end,

	OnDamage = function(self,hit)
		self:OnDamageClient(hit);
	end,
	
	Dead = {
	},
	
	Inactive = {
	},
}

--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnInitServer()
	VC.InitSeats(self, BMPPhysObj);

	-- init common stuff for client and server
	VC.InitBoatCommon(self,self.szNormalModel);

	self:OnReset();
end

-- called on the server when the player collides with the BMPPhysObj
--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnContactServer( collider )

	if(self.driverT.entity) then

		if(collider~=self.driverT.entity) then -- collided with something - fall down
			VC.EveryoneOutForce(self);
		end	
		return
	end

	if(VC.OnContactServerT(self,collider) == 1) then
		local startPos = self:GetPos();
		startPos.z = startPos.z+4;
		self:SetPos( startPos );
		local startAng = self:GetAngles();
		startAng.x=0;
		startAng.y=0;
		self:SetAngles( startAng );
--		Game:SetThirdPerson(1);
		
		self.messageTime = -10;
		
		local	baseAngles={x=0,y=0,z=180};
		collider.cnt:SetAngleLimitBase(baseAngles);
		collider.cnt:SetMaxAngleLimitH(130);
		collider.cnt:SetMinAngleLimitH(-130);
		collider.cnt:EnableAngleLimitH( 1 );
		
		
	end
end


--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:UpdateServer(dt)

--System:Log("\004 BMPPhysObj:UpdateServer");

	VC.UpdateServerCommonT(self,dt);

	if( self.driverT.entity ) then
		local pos=self:GetPos();
		pos.z = pos.z-2;
		if (Game:IsPointInWater(pos) ~= nil) then	-- stop flying - landing on water
			VC.EveryoneOutForce(self);
		end
	end
end


--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnEventServer( id, params)
end


--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnDamageClient(hit)

--	VC.OnDamageClient(self,hit);
	
end

--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnDamageServer(hit)

	VC.OnDamageServer(self,hit);	
end

--////////////////////////////////////////////////////////////////////////////////////////
--function BMPPhysObj:OnCollide(hit)
--	VC.OnCollideClient(self,hit);
	
--	if (hit.fSpeed > .1) then
--		VC.EveryoneOutForce(self);
--	end

--end

--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnShutDown()

	VC.EveryoneOutForce(self);
	--VC.ReleaseDriver(self);
	--self:PassengerOut();
end


----------------------------------------------------------------------------------------------------------------------------
--
--
function BMPPhysObj:OnEventServer( id, params)

	if (id == ScriptEvent_Reset)
	then
		-- make the guy exit the vehicle
		self:OnShutDown();
	end
end


--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnSave(stm)
end

--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnLoad(stm)
end


--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnWrite( stm )	
end

--////////////////////////////////////////////////////////////////////////////////////////
function BMPPhysObj:OnRead( stm )
end

----------------------------------------------------------------------------------------------------------------------------
--
function BMPPhysObj:Event_DriverIn( params )

	BroadcastEvent( self,"DriverIn" );
	
	if( self.driverT.entity == _localplayer ) then
		local	baseAngles={x=0,y=0,z=180};
		_localplayer.cnt:SetAngleLimitBase(baseAngles);
		_localplayer.cnt:SetMaxAngleLimitH(130);
		_localplayer.cnt:SetMinAngleLimitH(-130);
		_localplayer.cnt:EnableAngleLimitH( 1 );
	end	
end	


--------------------------------------------------------------------------------------------------------
-- empty function to get reed of script error - it's called from behavours
function BMPPhysObj:MakeAlerted()
end


--------------------------------------------------------------------------------------------------------------
