public override void Setup() { base.Setup(); INTERACTION_SPHERE_DESCRIPTION sphere = new INTERACTION_SPHERE_DESCRIPTION(); sphere.shape.type = ShapeType.Sphere; sphere.radius = 1.0f; IntPtr spherePtr = StructAllocator.AllocateStruct(ref sphere); InteractionC.AddShapeDescription(ref _scene, spherePtr, out _shapeDescriptionHandle); INTERACTION_CREATE_SHAPE_INFO info = new INTERACTION_CREATE_SHAPE_INFO(); info.shapeFlags = ShapeInfoFlags.None; INTERACTION_TRANSFORM transform = new INTERACTION_TRANSFORM(); transform.position = Vector3.zero.ToCVector(); transform.rotation = Quaternion.identity.ToCQuaternion(); transform.wallTime = 0; InteractionC.CreateShapeInstance(ref _scene, ref _shapeDescriptionHandle, ref transform, ref info, out _shapeInstanceHandle); }
protected virtual void createInteractionShape(IInteractionBehaviour interactionBehaviour) { INTERACTION_SHAPE_DESCRIPTION_HANDLE descriptionHandle = interactionBehaviour.ShapeDescriptionHandle; INTERACTION_SHAPE_INSTANCE_HANDLE instanceHandle = new INTERACTION_SHAPE_INSTANCE_HANDLE(); INTERACTION_CREATE_SHAPE_INFO createInfo; INTERACTION_TRANSFORM createTransform; interactionBehaviour.GetInteractionShapeCreationInfo(out createInfo, out createTransform); InteractionC.CreateShapeInstance(ref _scene, ref descriptionHandle, ref createTransform, ref createInfo, out instanceHandle); _instanceHandleToBehaviour[instanceHandle] = interactionBehaviour; interactionBehaviour.NotifyInteractionShapeCreated(instanceHandle); }