
function ENTITY_CREATE_sprite( params )
{
	Sprite =
	{
		texture_path = params.texture,
		position = clone( params.position ),
		color = clone( params.color ),
		size = params.size,
	};
	
	sprite_mesh = gSGR_SS3D.createMesh( true );
	sprite_mesh.numParts = 1;
	sprite_mesh.transparent = true;
	sprite_mesh.setPartShader( 0, "sprite" );
	sprite_mesh.setPartTexture( 0, 0, gSGR_SS3D.getTexture( params.texture ) );
	sprite_mesh.setPartTexture( 0, 1, gSGR_SS3D.getTexture( "rsrc/normal.png" ) );
	sprite_mesh_inst = gSGR_Scene.createMeshInstance();
	sprite_mesh_inst.mesh = sprite_mesh;
	sprite_mesh_inst.setConstV3( 1, vec3( 0.5 ) );
	
	Sprite.mesh = sprite_mesh;
	Sprite.mesh_inst = sprite_mesh_inst;
	
	function Sprite.serialize(){ return "sprite", { texture = this.texture_path, position = this.position, color = this.color, size = this.size }; }
	
	function Sprite.tick( dt )
	{
		SS3D_UpdateParticleMesh( gSGR_SS3D, this.mesh, gSGR_Scene.camera.viewMatrix, vec3array(this.position), floatarray(this.size), floatarray(this.color.r,this.color.g,this.color.b,this.color.a) );
	}
	
	return Sprite;
}
