mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 14:22:26 +08:00
场景group分suite加载、读取掉落表
This commit is contained in:
@@ -161,9 +161,9 @@ func regionCubicContainPos(cubic *RegionCubic, pos *Vector3) bool {
|
||||
|
||||
// 检测一个点是否在球体内
|
||||
func regionSphereContainPos(sphere *RegionSphere, pos *Vector3) bool {
|
||||
distance3D := math.Sqrt(math.Pow(float64(sphere.pos.X-pos.X), 2) +
|
||||
math.Pow(float64(sphere.pos.Y-pos.Y), 2) +
|
||||
math.Pow(float64(sphere.pos.Z-pos.Z), 2))
|
||||
distance3D := math.Sqrt(float64(sphere.pos.X-pos.X)*float64(sphere.pos.X-pos.X) +
|
||||
float64(sphere.pos.Y-pos.Y)*float64(sphere.pos.Y-pos.Y) +
|
||||
float64(sphere.pos.Z-pos.Z)*float64(sphere.pos.Z-pos.Z))
|
||||
if float32(distance3D) < sphere.radius {
|
||||
return true
|
||||
} else {
|
||||
@@ -173,8 +173,8 @@ func regionSphereContainPos(sphere *RegionSphere, pos *Vector3) bool {
|
||||
|
||||
// 检测一个点是否在圆柱体内
|
||||
func regionCylinderContainPos(cylinder *RegionCylinder, pos *Vector3) bool {
|
||||
distance2D := math.Sqrt(math.Pow(float64(cylinder.pos.X-pos.X), 2) +
|
||||
math.Pow(float64(cylinder.pos.Z-pos.Z), 2))
|
||||
distance2D := math.Sqrt(float64(cylinder.pos.X-pos.X)*float64(cylinder.pos.X-pos.X) +
|
||||
float64(cylinder.pos.Z-pos.Z)*float64(cylinder.pos.Z-pos.Z))
|
||||
if float32(distance2D) >= cylinder.radius {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user