Global Navigation Satellite Systems (GNSS) based attitude determination has become an essential alternative to conventional techniques. carrier-phase integer ambiguity resolution is the primary challenge for high-precision GNSS attitude determination. In this contribution, we develop a constrained wrapped least squares (C-WLS) method to estimate a vehicle's attitude innovatively. The proposed method avoids the complicated process of resolving integer ambiguities by directly employing ambiguous carrier-phase observations to determine a vehicle's attitude through a search procedure in the solution space. The proposed method also takes advantage of a novel optimization model, which leverages prior information such as antenna configuration, the integer property of the carrier-phase ambiguity, and the noise distribution of carrier-phase observations. The performance of the proposed method is verified using both simulation and experimental data. The results show that the proposed C-WLS method outperforms the renowned constrained LAMBDA method in various performance areas.