function HealthBar( scene , model , width , height , elevation )
{
    this.healthBarMaterial = new BABYLON.StandardMaterial( "hb1mat" , scene );
	this.healthBarMaterial.diffuseColor = BABYLON.Color3.Green();
    this.healthBarMaterial.specularColor = BABYLON.Color3.Black();

	this.healthBarContainerMaterial = new BABYLON.StandardMaterial( "hb2mat" , scene );
	this.healthBarContainerMaterial.diffuseColor = BABYLON.Color3.Black();
    this.healthBarContainerMaterial.specularColor = BABYLON.Color3.Black();
		
	this.healthBar = BABYLON.MeshBuilder.CreatePlane( "hb1" , { width: width , height: height , subdivisions: 4 } , scene );
    this.healthBar.isPickable = false;
    this.healthBar.material = this.healthBarMaterial;
	this.healthBarContainer = BABYLON.MeshBuilder.CreatePlane( "hb2" , { width: width , height: height , subdivisions: 4 } , scene );
    this.healthBarContainer.isPickable = false;
    this.healthBarContainer.material = this.healthBarContainerMaterial;
    this.healthBarContainer.billboardMode = BABYLON.Mesh.BILLBOARDMODE_X;

    // move in front of container slightly, without this there is flickering
	this.healthBar.position = new BABYLON.Vector3( 0 , 0 , -0.01 );
    // position above player
	this.healthBarContainer.position = new BABYLON.Vector3( 0 , elevation , 0 );

	this.healthBar.parent = this.healthBarContainer;
    this.healthBarContainer.parent = model;

    this.update( 1 , 1 );
}



HealthBar.prototype.update = function( hp , maxHP )
{
    var percent = hp/maxHP;
    this.healthBar.scaling.x = percent;
    // #TODO the health bar is weird and only scales towards the middle ...
    // this.healthBar.position.x = -(1-percent)/2;
    // this.healthBar.computeWorldMatrix();

    if ( this.healthBar.scaling.x < .5 )
    {
        this.healthBarMaterial.diffuseColor = BABYLON.Color3.Yellow();
    }
    else if ( this.healthBar.scaling.x < .3 )
    {
        this.healthBarMaterial.diffuseColor = BABYLON.Color3.Red();
    }					
}



HealthBar.prototype.refill = function()
{
    this.healthBarMaterial.diffuseColor = BABYLON.Color3.Green();
    this.update( 1 , 1 );
}