public BasicEntity(ModelDefinition modelbb, MaterialEffect material, Vector3 position, double angleZ, double angleX, double angleY, Vector3 scale, MeshMaterialLibrary library = null, Entity physicsObject = null)
{
Id = IdGenerator.GetNewId();
Name = GetType().Name + " " + Id;
WorldTransform = new TransformMatrix(Matrix.Identity, Id);
ModelDefinition = modelbb;
Model = modelbb.Model;
BoundingBox = modelbb.BoundingBox;
BoundingBoxOffset = modelbb.BoundingBoxOffset;
SignedDistanceField = modelbb.SDF;
Material = material;
Position = position;
Scale = scale;
RotationMatrix = Matrix.CreateRotationX((float)angleX) * Matrix.CreateRotationY((float)angleY) *
Matrix.CreateRotationZ((float)angleZ);
if (library != null)
{
RegisterInLibrary(library);
}
if (physicsObject != null)
{
RegisterPhysics(physicsObject);
}
WorldTransform.World = Matrix.CreateScale(Scale) * RotationMatrix * Matrix.CreateTranslation(Position);
WorldTransform.Scale = Scale;
WorldTransform.InverseWorld = Matrix.Invert(Matrix.CreateTranslation(BoundingBoxOffset * Scale) * RotationMatrix * Matrix.CreateTranslation(Position));
}