我正在使用StackOverflowException我的C#程序.
Cmodel.cs
public class CModel
{
public Vector3 Position { get; set; }
public Vector3 Rotation { get; set; }
public Vector3 Scale { get; set; }
public Model Model { get; private set; }
public BoundingSphere BoundingSphere
{
get
{
// no need for rotation, as this is a sphere
Matrix worldTransform = Matrix.CreateScale(Scale) *
Matrix.CreateTranslation(Position); // THIS IS WHERE THE EXCEPTION OCCURS
BoundingSphere transformed = BoundingSphere;
transformed = transformed.Transform(worldTransform);
return transformed;
}
}
private Matrix[] modelTransforms; …Run Code Online (Sandbox Code Playgroud) 我的代码有问题.我终于得到它所以没有错误,但现在我必须处理stackoverflow ...
谁能告诉我我的代码有什么问题?
public Matrix Projection
{
get { return Projection; }
protected set
{
Projection = value;
generateFrustum();
}
}
Run Code Online (Sandbox Code Playgroud)
如果你可以帮忙的话会很好!
谢谢