anchor.diff:  [<AutoOpen>]
   module RigidBodyFacetModule =
   
  -    type Entity with
  +    type EntityRep with
   
           // TODO: consider implementing Awake, AngularVelocity, and LinearVelocity fields to make
           // physics resets less destructive.
   
  -        member entity.MinorId = entity?MinorId : Guid
  -        static member getMinorId (entity : Entity) = entity.MinorId
  -        static member setMinorId (value : Guid) (entity : Entity) = entity?MinorId <- value
  -        
  -        member entity.BodyType = entity?BodyType : BodyType
  -        static member getBodyType (entity : Entity) = entity.BodyType
  -        static member setBodyType (value : BodyType) (entity : Entity) = entity?BodyType <- value
  -        
  -        member entity.Density = entity?Density : single
  -        static member getDensity (entity : Entity) = entity.Density
  -        static member setDensity (value : single) (entity : Entity) = entity?Density <- value
  -        
  -        member entity.Friction = entity?Friction : single
  -        static member getFriction (entity : Entity) = entity.Friction
  -        static member setFriction (value : single) (entity : Entity) = entity?Friction <- value
  -        
  -        member entity.Restitution = entity?Restitution : single
  -        static member getRestitution (entity : Entity) = entity.Restitution
  -        static member setRestitution (value : single) (entity : Entity) = entity?Restitution <- value
  -        // remaining members elided for space
  -        member entity.FixedRotation = entity?FixedRotation : bool
  -        static member getFixedRotation (entity : Entity) = entity.FixedRotation
  -        static member setFixedRotation (value : bool) (entity : Entity) = entity?FixedRotation <- value
  -        
  -        member entity.LinearDamping = entity?LinearDamping : single
  -        static member getLinearDamping (entity : Entity) = entity.LinearDamping
  -        static member setLinearDamping (value : single) (entity : Entity) = entity?LinearDamping <- value
  -        
  -        member entity.AngularDamping = entity?AngularDamping : single
  -        static member getAngularDamping (entity : Entity) = entity.AngularDamping
  -        static member setAngularDamping (value : single) (entity : Entity) = entity?AngularDamping <- value
  -        
  -        member entity.GravityScale = entity?GravityScale : single
  -        static member getGravityScale (entity : Entity) = entity.GravityScale
  -        static member setGravityScale (value : single) (entity : Entity) = entity?GravityScale <- value
  -        
  -        member entity.CollisionCategories = entity?CollisionCategories : string
  -        static member getCollisionCategories (entity : Entity) = entity.CollisionCategories
  -        static member setCollisionCategories (value : string) (entity : Entity) = entity?CollisionCategories <- value
  -        
  -        member entity.CollisionMask = entity?CollisionMask : string
  -        static member getCollisionMask (entity : Entity) = entity.CollisionMask
  -        static member setCollisionMask (value : string) (entity : Entity) = entity?CollisionMask <- value
  -        
  -        member entity.CollisionExpr = entity?CollisionExpr : string
  -        static member getCollisionExpr (entity : Entity) = entity.CollisionExpr
  -        static member setCollisionExpr (value : string) (entity : Entity) = entity?CollisionExpr <- value
  -        
  -        member entity.IsBullet = entity?IsBullet : bool
  -        static member getIsBullet (entity : Entity) = entity.IsBullet
  -        static member setIsBullet (value : bool) (entity : Entity) = entity?IsBullet <- value
  -        
  -        member entity.IsSensor = entity?IsSensor : bool
  -        static member getIsSensor (entity : Entity) = entity.IsSensor
  -        static member setIsSensor (value : bool) (entity : Entity) = entity?IsSensor <- value
  -        
  -        member entity.PhysicsId = { SourceId = entity.Id; BodyId = entity.MinorId }
  +        member this.GetMinorId world : Guid = (this.GetXtension world)?MinorId
  +        member this.SetMinorId (value : Guid) world = this.UpdateXtension (fun xtension -> xtension?MinorId <- value) world
  +        member this.GetBodyType world : BodyType = (this.GetXtension world)?BodyType
  +        member this.SetBodyType (value : BodyType) world = this.UpdateXtension (fun xtension -> xtension?BodyType <- value) world
  +        member this.GetDensity world : single = (this.GetXtension world)?Density
  +        member this.SetDensity (value : single) world = this.UpdateXtension (fun xtension -> xtension?Density <- value) world
  +        member this.GetFriction world : single = (this.GetXtension world)?Friction
  +        member this.SetFriction (value : single) world = this.UpdateXtension (fun xtension -> xtension?Friction <- value) world
  +        member this.GetRestitution world : single = (this.GetXtension world)?Restitution
  +        member this.SetRestitution (value : single) world = this.UpdateXtension (fun xtension -> xtension?Restitution <- value) world
  +        member this.GetFixedRotation world : bool = (this.GetXtension world)?FixedRotation
  +        member this.SetFixedRotation (value : bool) world = this.UpdateXtension (fun xtension -> xtension?FixedRotation <- value) world
  +        member this.GetLinearDamping world : single = (this.GetXtension world)?LinearDamping
  +        member this.SetLinearDamping (value : single) world = this.UpdateXtension (fun xtension -> xtension?LinearDamping <- value) world
  +        member this.GetAngularDamping world : single = (this.GetXtension world)?AngularDamping
  +        member this.SetAngularDamping (value : single) world = this.UpdateXtension (fun xtension -> xtension?AngularDamping <- value) world
  +        member this.GetGravityScale world : single = (this.GetXtension world)?GravityScale
  +        member this.SetGravityScale (value : single) world = this.UpdateXtension (fun xtension -> xtension?GravityScale <- value) world
  +        member this.GetCollisionCategories world : string = (this.GetXtension world)?CollisionCategories
  +        member this.SetCollisionCategories (value : string) world = this.UpdateXtension (fun xtension -> xtension?CollisionCategories <- value) world
  +        member this.GetCollisionMask world : string = (this.GetXtension world)?CollisionMask
  +        member this.SetCollisionMask (value : string) world = this.UpdateXtension (fun xtension -> xtension?CollisionMask <- value) world
  +        member this.GetCollisionExpr world : string = (this.GetXtension world)?CollisionExpr
  +        member this.SetCollisionExpr (value : string) world = this.UpdateXtension (fun xtension -> xtension?CollisionExpr <- value) world
  +        member this.GetIsBullet world : bool = (this.GetXtension world)?IsBullet
  +        member this.SetIsBullet (value : bool) world = this.UpdateXtension (fun xtension -> xtension?IsBullet <- value) world
  +        member this.GetIsSensor world : bool = (this.GetXtension world)?IsSensor
  +        member this.SetIsSensor (value : bool) world = this.UpdateXtension (fun xtension -> xtension?IsSensor <- value) world
  +        member this.GetPhysicsId world = { SourceId = this.GetId world; BodyId = this.GetMinorId world }
   
       type RigidBodyFacet () =
           inherit Facet ()
   
  -        static let getBodyShape (entity : Entity) =
  -            Physics.evalCollisionExpr (entity.Size : Vector2) entity.CollisionExpr
  +        static let getBodyShape (entityRep : EntityRep) world =
  +            Physics.evalCollisionExpr (entityRep.GetSize world) (entityRep.GetCollisionExpr world)
   
           static member FieldDefinitions =
               [variable? MinorId <| fun () -> Core.makeId ()
  
positive.code:         override facet.RegisterPhysics (entityRep, world) =
              let bodyProperties = 
                  { BodyId = (entityRep.GetPhysicsId world).BodyId
                    Position = entityRep.GetPosition + entity.Size * 0.5f
                    Rotation = entityRep.GetRotation
                    Shape = getBodyShape entity
                    BodyType = entityRep.GetBodyType
                    Density = entityRep.GetDensity
                    Friction = entityRep.GetFriction
                    Restitution = entityRep.GetRestitution
                    FixedRotation = entityRep.GetFixedRotation
                    LinearDamping = entityRep.GetLinearDamping
                    AngularDamping = entityRep.GetAngularDamping
                    GravityScale = entityRep.GetGravityScale
                    CollisionCategories = Physics.toCollisionCategories entityRep.GetCollisionCategories
                    CollisionMask = Physics.toCollisionCategories entityRep.GetCollisionMask
                    IsBullet = entityRep.GetIsBullet
                    IsSensor = entityRep.GetIsSensor }
              World.createBody address entityRep.GetId bodyProperties world
  
          override facet.UnregisterPhysics (entity, _, world) =
              World.destroyBody entity.PhysicsId world
  
          override facet.PropagatePhysics (address, entity, world) =
              let world = facet.UnregisterPhysics (address, entity, world)
              facet.RegisterPhysics (address, entity, world)
  
  [<AutoOpen>]
  module SpriteFacetModule =
  
      type Entity with
  
          member entity.SpriteImage = entity?SpriteImage : AssetTag
          static member getSpriteImage (entity : Entity) = entity.SpriteImage
          static member setSpriteImage (value : AssetTag) (entity : Entity) = entity?SpriteImage <- value
  
      type SpriteFacet () =
          inherit Facet ()
  
negative.code:              define? AnimationStutter 4L
               define? AnimationSheet { PackageName = DefaultPackageName; AssetName = "Image7" }]
  
          override facet.GetRenderDescriptors (entityRep, world) =
              if  entityRep.GetVisible world &&
                  Camera.inView3 (entityRep.GetViewType world) (entityRep.GetPosition world) (entityRep.GetSize world) world.State.Camera then
                  [LayerableDescriptor
                      { Depth = entityRep.GetDepth world
                        LayeredDescriptor =
                          SpriteDescriptor
                              { Position = entityRep.GetPosition world
                                Size = entityRep.GetSize world
                                Rotation = entityRep.GetRotation world
                                ViewType = entityRep.GetViewType world
                                OptInset = getOptSpriteInset entityRep world
                                Image = entityRep.GetAnimationSheet world
                                Color = Vector4.One }}]
              else []
  
          override facet.GetQuickSize (entityRep, world) =
              entityRep.GetTileSize world
  
  [<AutoOpen>]
  module EntityDispatcherModule =
  