Exemplo n.º 1
0
    public void Register()
    {
        Bounds bounds1 = this.collider.get_bounds();

        this.center = ((Bounds) ref bounds1).get_center();
        Bounds bounds2 = this.collider.get_bounds();
        // ISSUE: variable of the null type
        __Null x = ((Bounds) ref bounds2).get_extents().x;

        bounds2 = this.collider.get_bounds();
        // ISSUE: variable of the null type
        __Null y   = ((Bounds) ref bounds2).get_extents().y;
        double num = (double)Mathf.Max((float)x, (float)y);

        bounds2 = this.collider.get_bounds();
        // ISSUE: variable of the null type
        __Null z = ((Bounds) ref bounds2).get_extents().z;

        this.radius     = Mathf.Max((float)num, (float)z);
        this.occludeeId = OcclusionCulling.RegisterOccludee(this.center, this.radius, this.renderer.get_enabled(), this.minTimeVisible, this.isStatic, ((Component)this).get_gameObject().get_layer(), new OcclusionCulling.OnVisibilityChanged(this.OnVisibilityChanged));
        if (this.occludeeId < 0)
        {
            Debug.LogWarning((object)("[OcclusionCulling] Occludee registration failed for " + ((Object)this).get_name() + ". Too many registered."));
        }
        this.state = OcclusionCulling.GetStateById(this.occludeeId);
    }
    public OccludeeSphere(int id, OcclusionCulling.Sphere sphere)
    {
        OccludeeState stateById;

        this.id = id;
        if (id < 0)
        {
            stateById = null;
        }
        else
        {
            stateById = OcclusionCulling.GetStateById(id);
        }
        this.state  = stateById;
        this.sphere = sphere;
    }
    public OccludeeSphere(int id)
    {
        OccludeeState stateById;

        this.id = id;
        if (id < 0)
        {
            stateById = null;
        }
        else
        {
            stateById = OcclusionCulling.GetStateById(id);
        }
        this.state  = stateById;
        this.sphere = new OcclusionCulling.Sphere(Vector3.zero, 0f);
    }
Exemplo n.º 4
0
    public void Register()
    {
        Bounds bound = this.collider.bounds;

        this.center = bound.center;
        bound       = this.collider.bounds;
        float single = bound.extents.x;

        bound = this.collider.bounds;
        float single1 = Mathf.Max(single, bound.extents.y);

        bound       = this.collider.bounds;
        this.radius = Mathf.Max(single1, bound.extents.z);
        Occludee occludee = this;

        this.occludeeId = OcclusionCulling.RegisterOccludee(this.center, this.radius, this.renderer.enabled, this.minTimeVisible, this.isStatic, base.gameObject.layer, new OcclusionCulling.OnVisibilityChanged(occludee.OnVisibilityChanged));
        if (this.occludeeId < 0)
        {
            Debug.LogWarning(string.Concat("[OcclusionCulling] Occludee registration failed for ", base.name, ". Too many registered."));
        }
        this.state = OcclusionCulling.GetStateById(this.occludeeId);
    }
 public void Invalidate()
 {
     this.id     = -1;
     this.state  = null;
     this.sphere = new OcclusionCulling.Sphere();
 }
Exemplo n.º 6
0
 public OccludeeSphere(int id, OcclusionCulling.Sphere sphere)
 {
     this.id     = id;
     this.state  = id < 0 ? (OccludeeState)null : OcclusionCulling.GetStateById(id);
     this.sphere = sphere;
 }
Exemplo n.º 7
0
 public OccludeeSphere(int id)
 {
     this.id     = id;
     this.state  = id < 0 ? (OccludeeState)null : OcclusionCulling.GetStateById(id);
     this.sphere = new OcclusionCulling.Sphere(Vector3.get_zero(), 0.0f);
 }