/* END CONSTRUCTORS */ public override bool directedTowardsObjectside(Scientrace.SurfaceSide side, Trace aTrace) { Scientrace.NonzeroVector traceline_direction = aTrace.traceline.direction; switch (side) { case Scientrace.SurfaceSide.Back: // == SurfaceSide.Inside // Vector is directed TOWARDS (so in the contrary direction) of the surface normal // if (aVector.dotProduct(this.front_normal_direction)>0) /*Console.WriteLine(aTrace.traceid+" analysing: "+traceline_direction.tricon()+" from: "+aTrace.traceline.startingpoint.tricon()+ * aTrace.parent.intensityFraction()+" = intensity \n"+ * " DISTANCE: "+(aTrace.endloc-aTrace.traceline.startingpoint).length +" direction along: "+this.front_normal_direction.trico()+ " @"+aTrace.currentObject.GetType()); */ return(traceline_direction.dotProduct(this.front_normal_direction) > 0); //break; case Scientrace.SurfaceSide.Front: // Vector is directed AWAY FROM (so along the direction) of the surface normal return(traceline_direction.dotProduct(this.front_normal_direction) < 0); //break; case Scientrace.SurfaceSide.Both: return(true); //break; default: throw new NotImplementedException("Side " + side.ToString() + " not implemented"); //break; } }
public virtual bool directedTowardsObjectside(Scientrace.SurfaceSide side, Scientrace.Trace aTrace) { switch (side) { case Scientrace.SurfaceSide.Back: // == SurfaceSide.Inside throw new NotImplementedException("Side " + side.ToString() + " not implemented for class" + this.GetType().ToString()); //break; case Scientrace.SurfaceSide.Front: throw new NotImplementedException("Side " + side.ToString() + " not implemented for class" + this.GetType().ToString()); //break; case Scientrace.SurfaceSide.Both: return(true); //break; default: throw new NotImplementedException("Side " + side.ToString() + " not implemented"); //break; } }