예제 #1
0
        private void ConfigureGeometryObject(TGeom geom)
        {
            geom.Enabled      = Enabled;
            geom.CategoryBits = CategoryBits.GetValueOrDefault(-1);
            geom.CollideBits  = CollideBits.GetValueOrDefault(-1);
            geom.Tag          = new GeomMetadata(Material);

            var position    = Position;
            var orientation = Orientation;

            if (position.HasValue || orientation.HasValue)
            {
                if (geom.Body != null)
                {
                    geom.OffsetPosition   = position.GetValueOrDefault();
                    geom.OffsetQuaternion = orientation.HasValue ? orientation.Value : Quaternion.Identity;
                }
                else
                {
                    geom.Position   = position.GetValueOrDefault();
                    geom.Quaternion = orientation.HasValue ? orientation.Value : Quaternion.Identity;
                }
            }
        }
예제 #2
0
파일: Fixture.cs 프로젝트: prepare/box2c
 public override int GetHashCode()
 {
     return(CategoryBits.GetHashCode() + MaskBits.GetHashCode() + GroupIndex.GetHashCode());
 }
예제 #3
0
파일: Fixture.cs 프로젝트: prepare/box2c
 /// <summary>
 /// Convert this FilterData to a human-readable format.
 /// </summary>
 /// <returns>The formatted string</returns>
 public override string ToString()
 {
     return("CategoryBits=" + CategoryBits.ToString() + " MaskBits=" + MaskBits.ToString() + " GroupIndex=" + GroupIndex.ToString());
 }