小编Nat*_*ate的帖子

如何修复StackOverflowException?

我正在使用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)

c# stack-overflow unhandled

-2
推荐指数
1
解决办法
1641
查看次数

C#中的'StackOverflowException未处理'错误

我的代码有问题.我终于得到它所以没有错误,但现在我必须处理stackoverflow ...

谁能告诉我我的代码有什么问题?

    public Matrix Projection
    {
        get { return Projection; }
        protected set 
        {
            Projection = value;
            generateFrustum();
        }
    }
Run Code Online (Sandbox Code Playgroud)

如果你可以帮忙的话会很好!

谢谢

c# stack-overflow xna unhandled

-5
推荐指数
1
解决办法
766
查看次数

标签 统计

c# ×2

stack-overflow ×2

unhandled ×2

xna ×1