Spatial computing could change our interaction with the physical world, yet development tools still largely apply to outdated methods, representing 3D objects with 2D text in code editors. This discrepancy makes the programming of spatial applications more complicated. PhyOOP, our Physical Object-Oriented Programming Environment, trying to solve this issue by capturing object states through camera feeds for direct code insertion and attaching executable snippets to objects for camera-triggered actions. The user study, involving 16 participants, suggests that PhyOOP is easy-to-use and has potential applications in various domains.