Axiom.Graphics.EdgeData.UpdateTriangleLightFacing C# (CSharp) Méthode

UpdateTriangleLightFacing() public méthode

Calculate the light facing state of the triangles in this edge list.
This is normally the first stage of calculating a silhouette, ie establishing which tris are facing the light and which are facing away. This state is stored in the 'lightFacing' flag in each Triangle.
public UpdateTriangleLightFacing ( Vector4 lightPos ) : void
lightPos Vector4 /// 4D position of the light in object space, note that /// for directional lights (which have no position), the w component /// is 0 and the x/y/z position are the direction. ///
Résultat void
		public void UpdateTriangleLightFacing( Vector4 lightPos )
		{
			for ( int i = 0; i < triangles.Count; i++ )
			{
				Triangle tri = (Triangle)triangles[ i ];

				float dot = tri.normal.Dot( lightPos );

				tri.lightFacing = ( dot > 0 );
			}
		}

Usage Example

Exemple #1
0
		/// <summary>
		///		Tells the caster to perform the tasks necessary to update the
		///		edge data's light listing. Can be overridden if the subclass needs
		///		to do additional things.
		/// </summary>
		/// <param name="edgeData">The edge information to update.</param>
		/// <param name="lightPosition">4D vector representing the light, a directional light has w=0.0.</param>
		protected virtual void UpdateEdgeListLightFacing( EdgeData edgeData, Vector4 lightPosition )
		{
			edgeData.UpdateTriangleLightFacing( lightPosition );
		}
All Usage Examples Of Axiom.Graphics.EdgeData::UpdateTriangleLightFacing