/// <summary>
        /// Constructs an object placement constraint requesting that the placement volume
        /// be placed away from other place objects.
        /// </summary>
        /// <returns>Constructed object placement constraint</returns>
        public static ObjectPlacementConstraint Create_AwayFromOtherObjects()
        {
            ObjectPlacementConstraint constraint = new ObjectPlacementConstraint();

            constraint.Type = ObjectPlacementConstraintType.Constraint_AwayFromOtherObjects;
            return(constraint);
        }
        /// <summary>
        /// Constructs an object placement constraint requesting that the placement volume
        /// be placed away from the specified position.
        /// </summary>
        /// <param name="position">The center point from switch minDistance and maxDistance define their volumes</param>
        /// <returns>Constructed object placement constraint</returns>
        public static ObjectPlacementConstraint Create_AwayFromPoint(Vector3 position)
        {
            ObjectPlacementConstraint constraint = new ObjectPlacementConstraint();

            constraint.Type             = ObjectPlacementConstraintType.Constraint_AwayFromPoint;
            constraint.RuleParam_Vec3_0 = position;
            return(constraint);
        }
示例#3
0
            /// <summary>
            /// Constructs an object placement constraint requesting that the placement volume
            /// be placed away from all walls.
            /// </summary>
            /// <returns>Constructed object placement constraint</returns>
            public static ObjectPlacementConstraint Create_AwayFromWalls()
            {
                ObjectPlacementConstraint constraint = new ObjectPlacementConstraint
                {
                    Type = ObjectPlacementConstraintType.Constraint_AwayFromWalls
                };

                return(constraint);
            }
        /// <summary>
        /// Constructs an object placement constraint requesting that the placement volume
        /// be placed near the center of the playspace.
        /// </summary>
        /// <param name="minDistance">The minimum distance from the center to place the object</param>
        /// <param name="maxDistance">The maximum distance from the center to place the object</param>
        /// <returns>Constructed object placement constraint</returns>
        public static ObjectPlacementConstraint Create_NearCenter(float minDistance = 0.0f, float maxDistance = 0.0f)
        {
            ObjectPlacementConstraint constraint = new ObjectPlacementConstraint();

            constraint.Type = ObjectPlacementConstraintType.Constraint_NearCenter;
            constraint.RuleParam_Float_0 = minDistance;
            constraint.RuleParam_Float_1 = maxDistance;
            return(constraint);
        }
        /// <summary>
        /// Constructs an object placement constraint requesting that the placement volume
        /// be placed no closer than minDistance and no further than maxDistance from
        /// the specified position.
        /// </summary>
        /// <param name="position">The center point from switch minDistance and maxDistance define their volumes</param>
        /// <param name="minDistance">The minimum distance from position to place the object</param>
        /// <param name="maxDistance">The maximum distance from position to place the object</param>
        /// <returns>Constructed object placement constraint</returns>
        public static ObjectPlacementConstraint Create_NearPoint(Vector3 position, float minDistance = 0.0f, float maxDistance = 0.0f)
        {
            ObjectPlacementConstraint constraint = new ObjectPlacementConstraint();

            constraint.Type              = ObjectPlacementConstraintType.Constraint_NearPoint;
            constraint.RuleParam_Vec3_0  = position;
            constraint.RuleParam_Float_0 = minDistance;
            constraint.RuleParam_Float_1 = maxDistance;
            return(constraint);
        }
        /// <summary>
        /// Constructs an object placement constraint requesting that the placement volume
        /// be placed no closer than minDistance and no further than maxDistance from
        /// a wall.
        /// </summary>
        /// <param name="minDistance">The minimum distance from position to place the object</param>
        /// <param name="maxDistance">The maximum distance from position to place the object</param>
        /// <param name="minWallHeight">Minimum height of a wall to be considered by this rule</param>
        /// <param name="includeVirtualWalls">Indicates virtual walls should be considered in this query</param>
        /// <returns>Constructed object placement constraint</returns>
        public static ObjectPlacementConstraint Create_NearWall(float minDistance = 0.0f, float maxDistance = 0.0f, float minWallHeight = 0.0f, bool includeVirtualWalls = false)
        {
            ObjectPlacementConstraint constraint = new ObjectPlacementConstraint();

            constraint.Type = ObjectPlacementConstraintType.Constraint_NearWall;
            constraint.RuleParam_Float_0 = minDistance;
            constraint.RuleParam_Float_1 = maxDistance;
            constraint.RuleParam_Float_2 = minWallHeight;
            constraint.RuleParam_Int_0   = includeVirtualWalls ? 1 : 0;
            return(constraint);
        }
 /// <summary>
 /// Constructs an object placement constraint requesting that the placement volume
 /// be placed away from the specified position.
 /// </summary>
 /// <param name="position">The center point from switch minDistance and maxDistance define their volumes</param>
 /// <returns>Constructed object placement constraint</returns>
 public static ObjectPlacementConstraint Create_AwayFromPoint(Vector3 position)
 {
     ObjectPlacementConstraint constraint = new ObjectPlacementConstraint();
     constraint.Type = ObjectPlacementConstraintType.Constraint_AwayFromPoint;
     constraint.RuleParam_Vec3_0 = position;
     return constraint;
 }
 /// <summary>
 /// Constructs an object placement constraint requesting that the placement volume
 /// be placed away from other place objects.
 /// </summary>
 /// <returns>Constructed object placement constraint</returns>
 public static ObjectPlacementConstraint Create_AwayFromOtherObjects()
 {
     ObjectPlacementConstraint constraint = new ObjectPlacementConstraint();
     constraint.Type = ObjectPlacementConstraintType.Constraint_AwayFromOtherObjects;
     return constraint;
 }
 /// <summary>
 /// Constructs an object placement constraint requesting that the placement volume
 /// be placed near the center of the playspace.
 /// </summary>
 /// <param name="minDistance">The minimum distance from the center to place the object</param>
 /// <param name="maxDistance">The maximum distance from the center to place the object</param>
 /// <returns>Constructed object placement constraint</returns>
 public static ObjectPlacementConstraint Create_NearCenter(float minDistance = 0.0f, float maxDistance = 0.0f)
 {
     ObjectPlacementConstraint constraint = new ObjectPlacementConstraint();
     constraint.Type = ObjectPlacementConstraintType.Constraint_NearCenter;
     constraint.RuleParam_Float_0 = minDistance;
     constraint.RuleParam_Float_1 = maxDistance;
     return constraint;
 }
 /// <summary>
 /// Constructs an object placement constraint requesting that the placement volume
 /// be placed no closer than minDistance and no further than maxDistance from 
 /// a wall.
 /// </summary>
 /// <param name="minDistance">The minimum distance from position to place the object</param>
 /// <param name="maxDistance">The maximum distance from position to place the object</param>
 /// <param name="minWallHeight">Minimum height of a wall to be considered by this rule</param>
 /// <param name="includeVirtualWalls">Indicates virtual walls should be considered in this query</param>
 /// <returns>Constructed object placement constraint</returns>
 public static ObjectPlacementConstraint Create_NearWall(float minDistance = 0.0f, float maxDistance = 0.0f, float minWallHeight = 0.0f, bool includeVirtualWalls = false)
 {
     ObjectPlacementConstraint constraint = new ObjectPlacementConstraint();
     constraint.Type = ObjectPlacementConstraintType.Constraint_NearWall;
     constraint.RuleParam_Float_0 = minDistance;
     constraint.RuleParam_Float_1 = maxDistance;
     constraint.RuleParam_Float_2 = minWallHeight;
     constraint.RuleParam_Int_0 = includeVirtualWalls ? 1 : 0;
     return constraint;
 }
 /// <summary>
 /// Constructs an object placement constraint requesting that the placement volume
 /// be placed no closer than minDistance and no further than maxDistance from 
 /// the specified position.
 /// </summary>
 /// <param name="position">The center point from switch minDistance and maxDistance define their volumes</param>
 /// <param name="minDistance">The minimum distance from position to place the object</param>
 /// <param name="maxDistance">The maximum distance from position to place the object</param>
 /// <returns>Constructed object placement constraint</returns>
 public static ObjectPlacementConstraint Create_NearPoint(Vector3 position, float minDistance = 0.0f, float maxDistance = 0.0f)
 {
     ObjectPlacementConstraint constraint = new ObjectPlacementConstraint();
     constraint.Type = ObjectPlacementConstraintType.Constraint_NearPoint;
     constraint.RuleParam_Vec3_0 = position;
     constraint.RuleParam_Float_0 = minDistance;
     constraint.RuleParam_Float_1 = maxDistance;
     return constraint;
 }