public Vector3D BoundPosition() {
Vector3D vectord2 = new Vector3D();
if (position.X < Aviary.X) {
vectord2.X = SpeedLimit;
}
else if (position.X > (Aviary.X + Aviary.SizeX)) {
vectord2.X = -SpeedLimit;
}
if (position.Y < Aviary.Y) {
vectord2.Y = SpeedLimit;
}
else if (position.Y > (Aviary.Y + Aviary.SizeY)) {
vectord2.Y = -SpeedLimit;
}
if (position.Z < Aviary.Z) {
vectord2.Z = SpeedLimit;
return vectord2;
}
if (position.Z > (Aviary.Z + Aviary.SizeZ)) {
vectord2.Z = -SpeedLimit;
}
return vectord2;
}