for exmple
Post
Replies
Boosts
Views
Activity
this is my code
let portal = Entity()
// 添加 ModelComponent
portal.components[ModelComponent.self] = .init(
mesh: .generatePlane(
width: Float(size.width),
height: Float(size.height),
cornerRadius: 0.02
),
materials: [PortalMaterial()]
)
// 添加 PortalComponent
portal.components[PortalComponent.self] = .init(target: world)
portal.components[PortalComponent.self]?.clippingPlane = .init(
position: SIMD3(x: 0, y: 0, z: 0),
normal: SIMD3(x: 0, y: 0, z: 0)
)
// 添加 HoverEffectComponent
portal.components.set(HoverEffectComponent())