我有2个简单的节点(2个球:一个在另一个之上,没有接触),每个节点都有一个具有相同特征的物理体。下面是父节点,上面的节点是子节点。
当我向父节点应用强制时,两个节点都在移动,但子节点的物理体不会移动。我已经激活了showphysicsshape选项,我看到孩子的物理身体停留在原来的位置。
我错过了什么吗?
Class Character3DClass: CharacterClass
{
var CharacterNode: SCNNode!
var CenterBody: SCNNode!
func InitChar()
{
InitBodyParentNode()
AddCenterBody()
}
func InitBodyParentNode()
{
CharacterNode.physicsBody = SCNPhysicsBody(type: .dynamic, shape: SCNPhysicsShape(node: CharacterNode, options: [:]))
CharacterNode.physicsBody?.isAffectedByGravity = false
CharacterNode.physicsBody?.mass = 1
CharacterNode.physicsBody?.charge = 0
CharacterNode.physicsBody?.friction = 0
CharacterNode.physicsBody?.rollingFriction = 0
CharacterNode.physicsBody?.restitution = 0
CharacterNode.physicsBody?.damping = 0
CharacterNode.physicsBody?.angularDamping = 0
// Affectation des caractéristiques pour la gestion des collisions
CharacterNode.physicsBody?.categoryBitMask = eNodePhysics.Player.rawValue
CharacterNode.physicsBody?.contactTestBitMask = eNodePhysics.Player.rawValue | eNodePhysics.Ennemy.rawValue
CharacterNode.physicsBody?.collisionBitMask = eNodePhysics.TileBorder.rawValue
}
func AddCenterBody()
{
CenterBody = SCNNode(geometry: Level3D.Dot.geometry)
CenterBody.categoryBitMask = eNodePhysics.PlayerCenter.rawValue
CenterBody.position = SCNVector3.init(0, 3, 0)
CenterBody.scale = SCNVector3.init(0.4, 0.4, 0.4)
CenterBody.physicsBody = SCNPhysicsBody(type: .dynamic, shape: SCNPhysicsShape(geometry: CenterBody.geometry!, options: nil))
CenterBody.physicsBody?.isAffectedByGravity = false
CenterBody.physicsBody?.mass = 1
CenterBody.physicsBody?.charge = 0
CenterBody.physicsBody?.friction = 0
CenterBody.physicsBody?.rollingFriction = 0
CenterBody.physicsBody?.restitution = 0
CenterBody.physicsBody?.damping = 0
CenterBody.physicsBody?.angularDamping = 0
CenterBody.physicsBody?.categoryBitMask = eNodePhysics.PlayerCenter.rawValue
CenterBody.physicsBody?.contactTestBitMask = eNodePhysics.PlayerCenter.rawValue
CenterBody.physicsBody?.collisionBitMask = eNodePhysics.NoValue.rawValue
CharacterNode.addChildNode(CenterBody)
}
}
答案 0 :(得分:0)
您可以使用SELECT
Q.ControlNo
,sum(fid.amtbilled) as Premium
FROM
[dbo].tblQuotes Q
inner join [dbo].[tblFin_Invoices] FI on Q.QuoteID = FI.QuoteID and FI.failed = 0
inner join [dbo].[tblFin_InvoiceDetails] FID on FI.[InvoiceNum] = FID.InvoiceNum
WHERE (
SELECT TOP 1 NewQuoteStatusID
FROM tblQuoteStatusChangeLog
WHERE (ControlNo = Q.ControlNo)
ORDER BY Timestamp DESC
) <> 12
Group by
Q.ControlNo
方法使物理物体与它的节点匹配,但是会降低性能:https://developer.apple.com/documentation/scenekit/scnphysicsbody/1514782-resettransform